Issue with Virtual Box 7.0 on Ubuntu 22.04

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

How can I resolve this ?? Any Idea ??

Found this command

lsmod | grep kvm
kvm_intel             487424  2
kvm                  1409024  1 kvm_intel
irqbypass              12288  1 kvm
sudo rmmod kvm_intel
sudo rmmod kvm

Will it break my system by disabling and blacklisting KVM or do we have any other path for this issue

In between I tried Gnome Boxes - the major issue with Boxes is State is not saving - every time I need to install the OS after every login to VM in Boxes

1 Like

I just use Gnome Boxes. Load the iso, use the virtual live distro for 5 minutes or 5 hours or 5 days, then close it. If I need more extensive testing, I’ll just carve a new 100G partition in one of the HDDs and install it. Virtual programs are just for temporary, non-critical uses.

3 Likes

You can try

lsof | grep /dev/kvm

or

sudo lsof | grep /dev/kvm

to see what application is using KVM

edited to include using “sudo”

1 Like

Can you explain why you need to operate in this strange mode?

My understanding of it-

KVM and VirtualBox are trying to use the same hardware virtualization feature. Only one can use it at a time.

2 Likes

I used Vbox some time ago in Solus linux. It did not ask for this disabling of KVM?
I suppose it depends on whether the kernel has the KVM module loaded?
It cant hurt to unload it. You can always load it again.

Most people would use modprobe -r rather than rmmod… they are the same.
They only temporarily remove it for the current session. When you reboot it will be loaded. To remove it permanently you need to edit /etc/modules . Only do that after testing it with a temporary removal.

There is a KVM backend fir Virtualbox

so you dont have to use Vbox’s native hypervisor.

3 Likes

Since I was bored and curious- I tried it out. If you have an application using KVM and start VirtualBox it will give the above error. I had a qemu-kvm virtual machine running and VirtualBox gave the error. If I shut the qemu-kvm machine down (did not have to unload modules), VirtualBox ran fine.

I noticed some posts where people were getting the error because of Docker Desktop was running.

more info
https://github.com/cyberus-technology/virtualbox-kvm

2 Likes

It is the response or error - while creating VM on Virtual Box - copied and pasted here

1 Like

I resolved it by not using Virtual Box

VM for Fedora 40

Used Gnome Boxes - last time when I tried to create VM with Boxes it got failed - I used Firmware as BIOS - which is default option

Later on I changed firmware option to use UEFI while creating VM - it worked - no issues - thanks for your responses

But most of the Linux users use Oracle Virtual Box - how they tackle this issue - gone through Ubuntu forums, but not found any answer for this - I came to know that KVM, KVM Intel - should be stopped and to be blacklisted - but no one mentioned about issues after doing so

3 Likes

I would say most Linux users of VM’s use virt-manager, which is QEMU/KVM.Try it, it is more flexible than gnome-boxes. It requires libvirt. You can also use virsh as a command line interface.

VirtualBox is very Windows oriented. It does not fit well into Linux.

1 Like