I added the following to my configuration.nix
to install VirtualBox (successfully):
# virtualbox
virtualisation.virtualbox.host.enable = true;
users.extraGroups.vboxusers.members = [ "my-name" ];
# virtualbox exts (for use with usb)
# forgive me
nixpkgs.config.allowUnfree = true;
virtualisation.virtualbox.host.enableExtensionPack = true;
virtualisation.virtualbox.host.enableHardening = false;
Note that hardening is disabled in an attempt to solve the problem (why? see this issue thread).
I imported an OVA file and then tried to start the VM, but it failed with the following error messages:
Cannot access the kernel driver!
The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing
'/sbin/vboxconfig'
as root.
If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.
Failed to open a session for the virtual machine [redacted].
The virtual machine '[redacted]' has terminated unexpectedly during startup with exit code 1 (0x1).
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {85632c68-b5bb-4316-a900-5eb28d3413df}
I couldn’t find any mention of kernel drivers on the NixOS wiki’s tutorial, and I’m not sure what to make of VirtualBox’s suggestion to run vboxconfig
, seeing as there is no sbin
directory.
What should I do to solve this?