VirtualBox can't enable the AMD-V extension

VirtualBox can't enable the AMD-V extension. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_SVM_IN_USE).Result Code:NS_ERROR_FAILURE (0x80004005)Component:ConsoleWrapInterface:IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}

[

VirtualBox no longer working after latest update - openSUSE Forums

[

After upgrading to kernel 6.12, VirtualBox fails to start

youtube

How to fix AMD-V Is Disabled In The BIOS Error on Oracle VM...Launchpad

[

All Virtualbox VM crash after upgrade of Host to Linux 6.14

This error occurs because both VirtualBox and the KVM kernel extension (commonly used for QEMU/virt-manager) attempt to control hardware virtualization, which creates a conflict on modern Linux kernels (6.12 and above) where KVM is automatically enabled at boot.bugs.launchpad +2

Causes

  • When the KVM module (kvm_amd for AMD chips, or kvm_intel for Intel) is loaded, it claims the virtualization hardware, preventing VirtualBox from enabling AMD-V.github +2
  • Running both KVM (QEMU, Virt-Manager, etc.) and VirtualBox at the same time, or having the module loaded, triggers this failure.

Solutions

Temporary Fixes

  • Unload the KVM modules before launching VirtualBox:
    bash
    sudo modprobe -r kvm_amd kvm
    
    (For Intel CPUs, use kvm_intel instead of kvm_amd).diogoferreira +1
  • If you need to re-enable KVM for QEMU, reload the modules:
    bash
    sudo modprobe kvm_amd kvm
    
    Restarting the machine may also reload the modules automatically.diogoferreira

Permanent Workaround

  • To prevent KVM from automatically grabbing virtualization on boot, add the following parameter to your kernel command line:
    text
    kvm.enable_virt_at_load=0
    
    Refer to your Linux distribution's documentation on how to modify kernel parameters (usually in /etc/default/grub, then run sudo update-grub and reboot).github +1
  • Alternatively, blacklist the KVM modules:
    • Create a blacklist file, e.g. /etc/modprobe.d/blacklistvm.conf, with:
      text
      blacklist kvm
      blacklist kvm_amd
      
      This will prevent the modules from loading, but disables KVM-based virtualization entirely.reddit

Additional Notes

  • If QEMU/KVM is required for other purposes, you will need to switch between enabling/disabling the KVM modules before using VirtualBox vs QEMU.reddit +1
  • This issue became widespread with recent kernel updates, so future VirtualBox releases or kernel patches may address it.bugs.launchpad +1

Summary Table

Solution Permanent Compatible with QEMU How-To
Unload KVM modules No Yes (reload modules) sudo modprobe -r ...
Kernel parameter kvm.enable_virt... Yes Yes (opt-in) Edit grub, update, reboot
Blacklist KVM modules Yes No Create blacklist file

Always cite actions to reliable distribution documentation for making kernel changes.github +2

The error "modprobe: FATAL: Module kvm_amd is in use" means the kvm_amd module is currently in use by some process or service and cannot be unloaded directly. This often happens because there are running virtual machines or services (like libvirt or QEMU) that depend on the KVM modules.

How to unload kvm_amd properly:

  1. Check if any virtual machines are running:

    bash

    virsh list --all

    Stop any that are running with:

    bash

    virsh shutdown <vm-name>

  2. Check and stop any services that use KVM, such as libvirt or QEMU:

    bash

    sudo systemctl stop libvirtd sudo systemctl stop qemu-kvm

  3. Unload the relevant kernel modules in the correct order (AMD example):

    bash

    sudo modprobe -r kvm_amd sudo modprobe -r kvm

    If the dependency is on kvm_amd, unload it first, then kvm.

  4. If the modules still cannot be unloaded but you are sure no VMs or services are using them, you can force removal (careful: this may cause system instability):

    bash

    sudo rmmod -f kvm_amd sudo rmmod -f kvm

  5. If all else fails, rebooting will reset the modules and dependencies.

It is important to ensure all virtual machines and services using KVM are fully stopped before unloading these modules to avoid this error and maintain system stability.bobcares+2

STOPPING

sudo systemctl stop libvirtd sudo systemctl stop qemu-kvm

shows

libvirtd-admin.socket
libvirtd-ro.socket
libvirtd.socket

sudo systemctl stop libvirtd-admin.socket sudo systemctl stop libvirtd-ro.socket sudo systemctl stop libvirtd.socket

sudo modprobe -r kvm_amd sudo modprobe -r kvm

or

sudo rmmod -f kvm_amd sudo rmmod -f kvm

Alternatively, blacklist the KVM modules:

- Create a blacklist file, e.g. `/etc/modprobe.d/blacklistvm.conf`, with:
    
    text
    
    `blacklist kvm blacklist kvm_amd`
    

This will prevent the modules from loading, but disables KVM-based virtualization entirely.

reboot

Move to /home/garyrust/tmp if you don't want to blacklist - then reboot