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

imported>Mcdonc
Get setting names right
imported>Ibizaman
Add some info about build-vm-with-bootloader
Line 6: Line 6:
nixos-rebuild build-vm -I nixos-config=./configuration.nix -I nix_path='<nixpkgs/nixos>' --max-jobs 4  --show-trace # e.g. to specify the environment variables / cores used
nixos-rebuild build-vm -I nixos-config=./configuration.nix -I nix_path='<nixpkgs/nixos>' --max-jobs 4  --show-trace # e.g. to specify the environment variables / cores used
</code>
</code>
You can also use <code>build-vm-with-bootloader</code>. From the man page: this boots using the regular boot loader of your configuration rather than booting directly into the kernel and initial ramdisk of the system.


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 not be able to login to this virtual machine, as the passwords are not carried over to the virtual machine you build.
Line 39: Line 41:
   };
   };
}
}
</syntaxhighlight>


</syntaxhighlight>
Use <code>virtualisation.vmVariantWithBootLoader</code> option if you used `build-vm-with-bootloader` earlier.


== Troubleshooting ==
== Troubleshooting ==