VirtualBox can't running virtual machine

Ubuntu Support Template

Ubuntu Version:
Ubuntu 24.04

Desktop Environment (if applicable):
GNOME

Problem Description:
I just finish installed VirtualBox 7.2.4 r170995 (Qt6.8.0 on xcb). I also install extension package, The VirtualBox’s version can be check in help menu, the extension package also can be check in ManageToolsExtension. After I config a Win XP virtual machine, when I power on this machine, the guest machine window open and close immediately. The error said:

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).
Error Code: NS_ERROR_FAILURE (0X80004005)
component: ConsoleWrap
interface: IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}

In the Vbox.log, the last few lines as below:

00:00:00.735766 E1000#0: Received frames : 0

00:00:00.735766 E1000#0: Transmitted frames: 0

00:00:00.735769 E1000#0: TX frames up to 1514: 0

00:00:00.735770 E1000#0: TX frames up to 2962: 0

00:00:00.735770 E1000#0: TX frames up to 4410: 0

00:00:00.735770 E1000#0: TX frames up to 5858: 0

00:00:00.735771 E1000#0: TX frames up to 7306: 0

00:00:00.735771 E1000#0: TX frames up to 8754: 0

00:00:00.735772 E1000#0: TX frames up to 16384: 0

00:00:00.735772 E1000#0: TX frames up to 32768: 0

00:00:00.735773 E1000#0: Larger TX frames : 0

00:00:00.735773 E1000#0: Max TX Delay : 0

00:00:00.736761 vmmR3LogFlusher: Terminating (VERR_OBJECT_DESTROYED)

00:00:00.861921 VMSetError: /home/vbox/tinderbox/build-trunk/svn/src/VBox/VMM/VMMR3/VM.cpp(341) int VMR3Create(uint32_t, PCVMM2USERMETHODS, uint64_t, PFNVMATERROR, void*, PFNCFGMCONSTRUCTOR, void*, VM**, UVM**); rc=VERR_VMX_IN_VMX_ROOT_MODE

00:00:00.861931 VMSetError: VirtualBox can’t operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot

00:00:00.862269 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={6ac83d89-6ee7-4e33-8ae6-b257b2e81be8} aComponent={ConsoleWrap} aText={VT-x is being used by another hypervisor (VERR_VMX_IN_VMX_ROOT_MODE).

00:00:00.862274 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)}, preserve=false aResultDetail=-4011

00:00:00.862359 Console: Machine state changed to ‘PoweredOff’

00:00:00.871536 Power up failed (vrc=VERR_VMX_IN_VMX_ROOT_MODE, hrc=NS_ERROR_FAILURE (0X80004005))

00:00:00.886231 GUI: Aborting startup due to power up progress issue detected…

00:00:00.888963 GUI: UICommon: Handling aboutToQuit request..

00:00:01.663399 GUI: UICommon: aboutToQuit request handled!

Relevant System Information:
My computer is HP-Zbook-power-16-inch-G11-Mobile-workstation

Screenshots or Error Messages:

What I’ve Tried:

I have restart Ubuntu 24.04, but problem still exist.

Before Posting:
:mag: Please check if similar issues have already been reported and resolved.

:blue_book: See the “Start here” guide:

With that you sadly have to seek support at a VirtualBox community, per policy we can only support software installed from the archive here (which has been tested against the respective release the packages are provided for) …

3 Likes

This is well-documented, and easy to fix.
It has nothing to do with XP.
It has everything to do with a change VirtualBox upstream made in version 7+.

While your choice of bolting new software onto a an older release was unfortunate (it may break in the future due to version collisions), it’s also NOT the cause of the error. The same error does occur in the Ubuntu-packaged deb too, and is on-topic.

First, please show us the complete output of the following commands to tell us which kvm module your system is using and whether or not that module is in use.

lsmod | grep kvm
lsof | grep kvm
2 Likes

You can try temporarily removing the KVM module and then starting the virtual machine.

sudo rmmod kvm_intel

If your computer is on an AMD platform, please use the following command.

sudo rmmod kvm_amd

Next, remove the base KVM module temporarily with:

sudo rmmod kvm

Then go back to VirtualBox and start the virtual machine immediately.

this is the output:

lsmod | grep kvm
kvm_intel 487424 0
kvm 1425408 1 kvm_intel
irqbypass 12288 1 kvm

when I type lsmof, it told me can’t find this command. Then I try to install it, but I can’t find lsmof package in synaptic. How can I do?

Thank you for your reply.

Before I install VirtualBox 7.2.4, I have install VirtualBox 7.0.16 by Synaptic. The same result, I can config a new virtual machine, but when I power on, it shutdown immediately.

Apologies for my typo.

This means that you are using the kvm_intel kernel module, as expected. Note the similarity to your error message.

Test: Try sudo rmmod kvm_intel
Then see if VirtualBox starts properly.

This is just a test. The problem will re-occur after a reboot without an additional step.

1 Like

Now the VirtualBox work normal. Just I need to type “sudo rmmod kvm_intel” every time. Does it cause any problem, like un-stable or un-security anythig? Thank you again!

I suppose you can do it that way if you wish.

When you tire of typing in that command every time,

  1. Create a new config file in /etc/modprobe.d . That sub-system determines which kernel modules get loaded at boot. Since it affects Virtualbox, let’s call the file virtualbox.conf. (You can use any name you wish).

    sudo nano /etc/modprobe.d/virtualbox.conf

  2. Let’s populate that empty file with an explanation and tell the system to NOT load the kvm_intel module at boot.

    # This prevents the VirtualBox error "VirtualBox can’t operate in VMX root mode. Please disable the KVM kernel extension"
    blacklist kvm_intel
    
  3. Save the new file (CTRL + o)

  4. Exit the nano editor (CTRL + x)

That’s it. You should not need to retype every time.


Note for future readers: As @qwedsaz suggested, there are TWO possible modules that cause this issue kvm_intel and kvm_amd.

You can use the lsmod and rmmod commands on both if you don’t want to bother with troubleshooting. You can also blacklist both in the same /etc/modprobe.d/ file.

However, if the rmmod test doesn’t solve the error message, then it’s likely that you have a different problem, so please open a new question.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.