Erreur VERR_VMX_IN_VMX_ROOT_MODE sur Debian 13

Erreur VERR_VMX_IN_VMX_ROOT_MODE sur Debian 13

Since installing Debian 13 on my workstation, I've been having issues with VirtualBox. When I launch any virtual machine, I get the error VERR_VMX_IN_VMX_ROOT_MODE when I launch my VM, and VirtualBox refuses to launch it.

The problem is that KVM is enabled by default when Debian 13 is launched, and other virtualization software that does not use it is unable to work.

Temporary solution

To temporarily resolve the issue, launch a terminal and run the following command to disable the KVM module:

# For Intel processors sudo modprobe -r kvm_intel
# For AMD processors sudo modprobe -r kvm_amd

The virtual machine should now launch.

Final solution

To permanently solve the problem, we need to edit the GRUB configuration file, and add a parameter to the startup:

sudo nano /etc/default/grub

In the GRUB_CMDLINE_LINUX line, add the text kvm.enable_virt_at_load=0. This should look something like:

GRUB_CMDLINE_LINUX="kvm.enable_virt_at_load=0"

Finally, regenerate the Grub config, and KVM will not be loaded the next time the computer starts.

sudo grub-mkconfig -o /boot/grub/grub.cfg