···5757Once the connection is established, you can enter commands in the socat terminal
5858where socat is running.
59596060+## Port forwarding to NixOS test VMs {#sec-nixos-test-port-forwarding}
6161+6262+If your test has only a single VM, you may use e.g.
6363+6464+```ShellSession
6565+$ QEMU_NET_OPTS="hostfwd=tcp:127.0.0.1:2222-127.0.0.1:22" ./result/bin/nixos-test-driver
6666+```
6767+6868+to port-forward a port in the VM (here `22`) to the host machine (here port `2222`).
6969+7070+This naturally does not work when multiple machines are involved,
7171+since a single port on the host cannot forward to multiple VMs.
7272+7373+If the test defines multiple machines, you may opt to _temporarily_ set
7474+`virtualisation.forwardPorts` in the test definition for debugging.
7575+6076## Reuse VM state {#sec-nixos-test-reuse-vm-state}
61776278You can re-use the VM states coming from a previous run by setting the