1.8 KiB
How can I disable the kvm Kernel in Linux, so that I can launch a virtual machine in VirtualBox
When you run VirtualBox on a Linux host, it can conflict with the KVM kernel modules (kvm and kvm_intel or kvm_amd). VirtualBox doesn’t use KVM, and if those modules are loaded, they can prevent VirtualBox VMs from starting properly.
To disable KVM, you can either temporarily unload the modules or permanently blacklist them.
🔹 Option 1: Temporarily Disable KVM
Run the following commands (with root privileges):
sudo modprobe -r kvm_intel
sudo modprobe -r kvm_amd
sudo modprobe -r kvm
-
If your CPU is Intel, unload
kvm_intel. -
If your CPU is AMD, unload
kvm_amd. -
Then unload the generic
kvmmodule.
This will disable KVM until the next reboot.
🔹 Option 2: Permanently Disable KVM
To prevent KVM from loading on boot, blacklist the modules:
-
Create a blacklist file:
sudo nano /etc/modprobe.d/blacklist-kvm.conf -
Add these lines:
blacklist kvm blacklist kvm_intel blacklist kvm_amd -
Save and exit.
-
Update initramfs (on some distros, required):
sudo update-initramfs -u -
Reboot your system.
🔹 Verify
After reboot (or unloading), check that no KVM modules are loaded:
lsmod | grep kvm
If the output is empty, KVM is disabled and VirtualBox should work.
⚠️ Note: If you ever want to use QEMU/KVM again, you’ll need to remove those blacklist entries and reboot.
Would you like me to also show you how to make VirtualBox auto-unload KVM just when you launch a VM (without disabling it system-wide)? That way, you can keep using both VirtualBox and KVM on the same system.