To resolve the `VERR_VMX_IN_VMX_ROOT_MODE` error in VirtualBox on Debian Linux,

To resolve the VERR_VMX_IN_VMX_ROOT_MODE error in VirtualBox on Debian Linux, follow these steps:

Cause

The error occurs because the KVM hypervisor is active and monopolizes hardware virtualization (VMX), preventing VirtualBox from accessing it.


Solutions

Choose one of the methods below:

Method 1: Unload KVM Modules Temporarily (Test First)

  1. Unload KVM modules (reverts after reboot):
    sudo rmmod kvm_intel kvm_amd kvm
  2. Verify modules are unloaded:
    lsmod | grep kvm  # Should return nothing
  3. Launch your VirtualBox VM. If successful, make the change permanent with Method 2.

Method 2: Permanently Disable KVM via Blacklisting

  1. Create a blacklist file:
    sudo nano /etc/modprobe.d/blacklist-kvm.conf
  2. Add these lines (based on your CPU):
    • For Intel CPUs:
      blacklist kvm_intel
      blacklist kvm
    • For AMD CPUs:
      blacklist kvm_amd
      blacklist kvm
  3. Save (Ctrl+OEnterCtrl+X) and update:
    sudo update-initramfs -u
  4. Reboot:
    sudo reboot

Method 3: Kernel Boot Parameter (If KVM is Built-In)

  1. Edit GRUB configuration:
    sudo nano /etc/default/grub
  2. Append to GRUB_CMDLINE_LINUX:
    • For Intel:
      modprobe.blacklist=kvm_intel,kvm
    • For AMD:
      modprobe.blacklist=kvm_amd,kvm
    Example line:
    GRUB_CMDLINE_LINUX="...existing options... modprobe.blacklist=kvm_intel,kvm"

By following these steps, VirtualBox will regain access to hardware virtualization or fall back to software emulation.

Comments

Popular Posts