NixOS:nixos-rebuild build-vm: Difference between revisions

From NixOS Wiki
imported>Nixinator
No edit summary
imported>Nixinator
No edit summary
Line 1: Line 1:
A virtual machine can be created , it will use your /etc/nixos/configuration.nix to make a 'clone' of your system. Useful for testing new configurations.  
A virtual machine can be created , it will use your /etc/nixos/configuration.nix to make a 'clone' of your system. Useful for testing new configurations.  


<code>
nixos-rebuild build-vm
nixos-rebuild build-vm
</code>


You will that you will not be able to login to this virtual machine, as the passwords are not carried over to the virtual machine you build.
You will that you will not be able to login to this virtual machine, as the passwords are not carried over to the virtual machine you build.

Revision as of 13:00, 7 January 2021

A virtual machine can be created , it will use your /etc/nixos/configuration.nix to make a 'clone' of your system. Useful for testing new configurations.

nixos-rebuild build-vm

You will that you will not be able to login to this virtual machine, as the passwords are not carried over to the virtual machine you build.

If you have a user called nixosvmtest, then

users.users.nixosvmtest.initialHashedPassword = test;

to your /etc/nixos/configuration.nix

you should now be able to login test your system with this user and password.

https://discourse.nixos.org/t/default-login-and-password-for-nixos/4683/2