VMs started under virtualbox-7.1.4 on a system running kernel version 6.12.16 fail to start with the following error: VirtualBox can't operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_VMX_IN_VMX_ROOT_MODE). Result Code: NS_ERROR_FAILURE (0x80004005) Component: ConsoleWrap Interface: IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8} =app-emulation/virtualbox-modules-7.1.4-r1 have been recompiled and loaded successfully on boot. Although the following appears under dmesg when a VM is attempted to be started: [ 99.177565] vboxdrv: 0000000000000000 VMMR0.r0 [ 99.272123] vboxdrv: 0000000000000000 VBoxDDR0.r0 Reproducible: Always
Created attachment 920290 [details] kernel-config-6.12.16-gentoo-x86_64
KVM has been enabled on previous kernel versions with no issues. I believe it's required for qemu, which I also use.
virtualbox-7.1.6a, virtualbox-modules-7.1.6 also fail.
I suppose the answer is to compile KVM as a module and load it and unload it as needed. Does not feel like the cleanest solution.
I'm not certain, but setting the kernel command line parameter "kvm.enable_virt_at_load=0" may allow the kernel to enable and disable KVM as required by applications.
Known issue, we have an entry about this in the wiki. I added your error message there, we only had the AMD equivalent. If kvm is compiled as a module, there is an entry in /etc/modprobe.d to add enable_virt_at_load=0 to it. For built-in, adding kvm.enable_virt_at_load=0 to the kernel command line should solve it. *** This bug has been marked as a duplicate of bug 945135 ***