Can't install NixOS in virt-manager

I downloaded the non-graphical NixOS ISO, and I’m attempted to follow the install directions here. It’s not 100% clear to me, but I believe I have a UEFI (as opposed to BIOS) setup with this VM. (Is there a way to check?) So I’ve been trying to follow the UEFI instructions. Everything is fine until I get down to the nixos-install step. I get an error:

- You must set the option 'boot.loader.grub.devices' or 'boot.loader.grub.mirroredBoots' to make the system bootable.

This is in contrast to the guidance in the docs:

You must set the option boot.loader.systemd-boot.enable to true. nixos-generate-config should do this automatically for new configurations when booted in UEFI mode.

I tried setting

boot.loader.grub.device = "/dev/disk/by-id/ata-QEMU_HARDDISK_QM00003-part3";

but then I get an error

.../grub-install: warning: File system 'fat' doesn't support embedding.
.../grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
.../grub-install: error: will not proceed with blocklists.
...-install-grub.pl: installation of GRUB on /dev/...-part3 failed

First thing, let’s check the BIOS/UEFI setting for the VM. If you didn’t choose “Customize configuration before install” and then change Firmware: BIOS to UEFI, then you are on a BIOS VM.

This is where you’d change it (only available during creation) and where you can check it now:

1 Like

Ah, yes my firmware was set to BIOS. Thanks for the pointer! I scrapped that VM and created a new one with UEFI, and the install process worked like a charm!

1 Like