Issue with Virtualbox in 24.11

I just tried to boot up a virtualbox host for the first time since upgrading to find out that virtualbox no longer works for me (error below).

VirtualBox can't enable the AMD-V extension. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_SVM_IN_USE)

I found the following link which indicates that it is probably related to kvm being enabled by default in kernel 6.1.2.

https://bbs.archlinux.org/viewtopic.php?id=301155

There are two suggested fixes on the arch forum. One is to upgrade to the latest Virtualbox (which I can’t do using even the unstable channel in NixOS. The other is to make grub changes, is there a nixos way to make these? I didn’t actually try either for the reasons given.

I did find a kind of work around by adding the following.

   virtualisation.virtualbox.host.enableKvm = true;
   virtualisation.virtualbox.host.addNetworkInterface = false;

The second row is necessary as KVM only supports NAT. After rebuilding with these parameters and changing my bridged interface to NAT I was able to boot.

However what is the real solution here? Should a more recent version of virtualbox be pushed out? Is there something that can be turned off in the kernel configuration in the nixos config?

I’m happy enough for now but I assume that this is something that will affect other people so it might need some attention

1 Like

Nope, the thread is saying to update to the latest release where they added a kernel param in Arch.
Which is what you can do, for now.
PS do search nixpkgs for reported issues in the future

Specifically:

boot.kernelParams = [ "kvm.enable_virt_at_load=0" ];

Though, this itself is a workaround while upstream (kernel) adjusts the design a bit.

1 Like

Thanks,

I thought I’d searched everywhere that I could but forgot about the obvious place.

This answers my question.