VirtualBox stopped working

after the last CachyOS update VirtualBox stopped working. Starting any os ends with an error message:

“VirtualBox cant operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_VMX_IN_VMX_ROOT _MODE)”

Can anyone advise how to fix this? Or will the next CachyOS update fix it?

Today, I encountered the same issue. The error occurs due to a conflict between VirtualBox and KVM (a kernel module used for virtualization on Linux). VirtualBox requires exclusive access to the processor’s VMX root mode, but KVM is already using this mode.

Solution:

Temporary Fix:

  1. Disable the KVM Module (temporary solution):
    Check if the KVM module is loaded and disable it for the current session:
    lsmod | grep kvm
    
    If the output shows kvm_intel or kvm_amd, unload them:
    sudo modprobe -r kvm_intel
    sudo modprobe -r kvm_amd
    sudo modprobe -r kvm
    
    This will temporarily disable KVM until the next reboot.

Permanent Fix:

  1. Prevent KVM from Loading at Boot Using nano (permanent solution):
    To ensure the KVM modules don’t load again after a reboot, manually create a blacklist configuration file:

    Open the blacklist file in a text editor like nano:

    sudo nano /etc/modprobe.d/blacklist-kvm.conf
    

    Add the following lines to the file:

    blacklist kvm
    blacklist kvm_intel
    blacklist kvm_amd
    

    Save the file by pressing CTRL+O, then exit nano with CTRL+X.

    Update the initramfs to apply changes:

    sudo update-initramfs -u
    
  2. Restart the System:
    After making these changes, restart your system:

    sudo reboot
    
  3. Test VirtualBox:
    Launch VirtualBox and try starting a virtual machine. It should work without any issues.

Hope that it will be fixed soon.

vawaver:
Thanks for the reply it helped me. I chose Permanent fix but “sudo update-initramfs -u” doesn’t work (command not found)

I tried only reboot and after that VirtualBox works.
Thank you again

1 Like

Noticed that, too.

Came this with the update to kernel 6.12? Because that’s when I noticed it happening.

And what changed so the module is loaded now?
Was this also the case before?
Did 6.12 bring it with it?
Did some configuration change?

commonly dkms modules need to be adjusted with new major kernel version. Often they are slow to update and therefore they dont work.

Looking on the arch pkg and also locally tested it works.

Solved this for me and my setup by downgrading to latest 6.11 kernel again until updates roll in:

# Download and install latest 6.11 kernel + matching nivida-open
sudo pacman -U \
  https://archive.cachyos.org/archive/cachyos-v3/linux-cachyos-6.11.8-2-x86_64_v3.pkg.tar.zst \
  https://archive.cachyos.org/archive/cachyos-v3/linux-cachyos-headers-6.11.8-2-x86_64_v3.pkg.tar.zst \
  https://archive.cachyos.org/archive/cachyos-v3/linux-cachyos-nvidia-open-6.11.8-2-x86_64_v3.pkg.tar.zst

pacman -Syu will, however, upgrade again to 6.12 unless you exclude the packages from upgradeing, see: Skip package from being upgraded.

So either refrain from the urge to click that “upgrade system” button of yours :smiley: or accept holding back individual packages in arch, which is considered unsupported or at least discourgaed.

For the kernel packages this is probably not too disrupting as it would be for libraries and other applications. That is, if you haven’t done stuff running 6.12 that now requires 6.12 features/changes, probably filesystem related.

Indeed blacklisting the other KVM modules seems to be necessary on kernel 6.12 because then it defaulted to initialize those on load.

See: Changelog-7.1 – Oracle VirtualBox

Linux Guest Additions: Introduce initial support for kernel 6.12 (NOTE: In kernel 6.12, KVM initializes virtualization on module loading by default. This prevents VirtualBox VMs from starting. In order to avoid this, either add “kvm.enable_virt_at_load=0” parameter into kernel command line or unload corresponding kvm_XXX module)