VirtualBox 7.0.20 not working on Ubuntu 25.04

My VirtualBox 7.0.20 doesn’t work on Ubuntu 25.04 (upgraded from 24.10, where VBox worked):

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).

Hello,

I moved your post to its own topic.

Please don’t hijack other threads with support requests that are not related to the original post.

Thanks.

VirtualBox refuses to start when the KVM hyper-visor is already loaded
because Intel/AMD CPUs can only be in one “VMX/S-V” root mode at a
time.
During the 24.10 → 25.04 upgrade the kernel began loading KVM by
default, so the first hyper-visor in (KVM) wins and VirtualBox bails out
with VERR_VMX_IN_VMX_ROOT_MODE.

You have two options:


1 Run VirtualBox and stop using KVM

Unload the KVM modules once:

sudo modprobe -r kvm_intel kvm_amd kvm   # whichever unloads cleanly

then keep them from coming back:

echo "blacklist kvm_intel" | sudo tee /etc/modprobe.d/blacklist-kvm.conf
echo "blacklist kvm_amd"   | sudo tee -a /etc/modprobe.d/blacklist-kvm.conf

Reboot → lsmod | grep kvm should show nothing and VirtualBox will
start normally.

(Reverse the change any time by deleting the file in
/etc/modprobe.d/.)


2- Stay with KVM / QEMU and remove VirtualBox

KVM is now Ubuntu’s preferred hyper-visor (virt-manager,
Quick-emu/Quickgui, multipass, lxd --vm … all use it).
If you are happy to migrate the old VMs you can uninstall VirtualBox:

sudo apt purge virtualbox-7.0

and import the disks into a KVM front-end (virt-manager,
Quickgui, Boxes, etc.).


If you stick with VirtualBox

Make sure the matching modules are installed/loaded:

sudo apt install virtualbox virtualbox-dkms
sudo systemctl restart vboxdrv

Verify Secure Boot is off or the vboxdrv module is
MOK-enrolled; otherwise the kernel will refuse to load it.

Once KVM is black-listed (or removed) VirtualBox 7.0.20 works fine on
Ubuntu 25.04.

3 Likes

Thank you for the reply. :slightly_smiling_face:

I am willing to switch to Boxes, but I need to be able to tell it where to create the disk image (not on the small system drive).

1 Like

This topic was automatically closed after 29 days. New replies are no longer allowed.