VirtualBox install questions to fix a failure

I’ve been trying to install NixOS in VirtualBox but I’m not too clued up on the file system side of things, so I’m not 100% sure what options to choose running VirtualBox on a MacBook Air.

Would I have to go the BIOS system route, or the UEFI route? I followed the Install Summary and went with the UEFI route, but GRUB complains with:

/nix/store/i2qa7wxsvyvizc1g2nsk1bnk9z0dcwrb-grub-2.02/sbin/grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won’t be possible.

I did create a boot partition with the instructions:

mkfs.fat -F 32 -n boot /dev/sda3
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot

So I’m not sure why it’s complaining. The full output from nix-install is on pastebin if it’s of any use to anyone willing to help diagnose the problem.

Anyone know if this is a common gotcha when installing in VirtualBox? I initially tried just installing the VirtualBox appliance, but it doesn’t seem setup for adapting to permanent use.

This totally depends on the settings you choose when creating the VM.

As far as I can remember, Virtual Box usually does the legacy BIOS stuff, and you need to explicitely activate it if you want EFI.

Also, as far as I remember, the partition an EFI boots from needs to be FAT.

If I select the Enable EFI (Special OSes Only) in VirtualBox it boots me into an EFI prompt which is of zero use to my skillset. I’ll try the BIOS route then. The other weird thing I’m experiencing is when I attempt to create partitions in the GParted app (I’ve gone the command line route too), it only makes linux-swap and minix available as partition formats. So I can’t actually format the partitions to anything useful like Fat or Ext.

I haven’t done anything exotic with the VM setup, I just followed the advice in the Install Guide and chose the VirtualBox defaults for the most part.

When I wanted to partition my laptop from the nixOS installation medium, I was only able to deal with ext and fat. Since my laptop was already preoccupied by NTFS and BTRFS partitions I had to create a medium from scratch which contained all the necessary parts (it also contained the necessary unfree network driver for my wifi).

Can’t give you much about the details, as I have currently no access to the nix file I used to create that medium that finally worked…

Thanks for the advice. I do some reading on the weekend regarding a bare metal install, and perhaps see if I can’t DIY it from that in VirtualBox. I’ve really just focused on the package manager up until now, but would like to get something running in VB so I can test my work on macOS and Linux, and learn more about NixOS.

  1. Install NixOS on the same partition (in place!), from your existing non-NixOS Linux distribution using NIXOS_LUSTRATE .

Might try this approach with a bare bones install of Fedora or Debian. Let them setup the partitioning etc.