manual: Don't suggest exposing VM port to local network.

The setting

QEMU_NET_OPTS="hostfwd=tcp::2222-:22"

caused the VM's port 2222 to be advertised on the host as
`0.0.0.0:2222`, thus anybody in the local network of the host
could SSH into the VM.
Instead, port-forward to localhost only.

Use `127.0.0.1` also on the VM side, otherwise connections to
services that, in the VM, bind to `127.0.0.1` only
(doing the safe approach) do not work.

See e.g. https://github.com/NixOS/nixpkgs/issues/100192
for more info why localhost listening is the best default.

authored by

Niklas Hambüchen and committed by
Jörg Thalheim
5d73d954 db926939

+1 -1
+1 -1
nixos/doc/manual/installation/changing-config.chapter.md
··· 89 89 port 22 (SSH): 90 90 91 91 ```ShellSession 92 - $ QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vm 92 + $ QEMU_NET_OPTS="hostfwd=tcp:127.0.0.1:2222-127.0.0.1:22" ./result/bin/run-*-vm 93 93 ``` 94 94 95 95 allowing you to log in via SSH (assuming you have set the appropriate