malat
malat

Reputation: 12505

FATAL: Module kvm_intel is in use

I am trying to remove a module, but it keeps on failing with:

$ sudo modprobe -r kvm_intel
FATAL: Module kvm_intel is in use.

while:

$ lsmod | grep kvm
kvm_intel             120858  4 
kvm                   296583  1 kvm_intel

How should I remove kvm_intel ?

Upvotes: 5

Views: 12232

Answers (2)

elig
elig

Reputation: 3078

You could start by finding out what is using kvm with lsof:

# sudo lsof | grep kvm

Relevant processes are often qemu instances so pgrep -a qemu may also come handy.

Then try to kill the processes you find after making sure you don't need them.

Upvotes: 2

malat
malat

Reputation: 12505

For posterity, I tried:

$ sudo rmmod -f kvm_intel

And suddenly my computer started beeping, and switched to a virtual screen full of kernel message.

After a reboot, I simply tried:

$ sudo apt-get remove libvirt-bin

and then:

$ sudo modprobe -r kvm_intel

Upvotes: 6

Related Questions