Merge pull request #34710 from markus1189/doc-vm-login

docs: Explain how to login into built vm

authored by Graham Christensen and committed by GitHub 7fb90db6 dc897521

+15 -3
+15 -3
nixos/doc/manual/installation/changing-config.xml
··· 70 70 </screen> 71 71 72 72 The VM does not have any data from your host system, so your existing 73 - user accounts and home directories will not be available. You can 74 - forward ports on the host to the guest. For instance, the following 75 - will forward host port 2222 to guest port 22 (SSH): 73 + user accounts and home directories will not be available unless you 74 + have set <literal>mutableUsers = false</literal>. Another way is to 75 + temporarily add the following to your configuration: 76 + 77 + <screen> 78 + users.extraUsers.your-user.initialPassword = "test" 79 + </screen> 80 + 81 + <emphasis>Important:</emphasis> delete the $hostname.qcow2 file if you 82 + have started the virtual machine at least once without the right 83 + users, otherwise the changes will not get picked up. 84 + 85 + You can forward ports on the host to the guest. For 86 + instance, the following will forward host port 2222 to guest port 22 87 + (SSH): 76 88 77 89 <screen> 78 90 $ QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vm