# Cannot modprobe KVM

## c0ntrarian

I cannot get KVM working on my machine. I am currently running Linux 5.4.31-ck kernel. I have rebuilt the kernel several times now -- with KVM as modules and built-in. The kernel just refuses to load the kvm and kvm_intel modules every time. I don't know where else to look for help.

```
~ % sudo modprobe kvm -vv

modprobe: INFO: custom logging function 0x55cbaffb9f20 registered

insmod /lib/modules/5.4.31-ck/kernel/arch/x86/kvm/kvm.ko 

modprobe: INFO: Failed to insert module '/lib/modules/5.4.31-ck/kernel/arch/x86/kvm/kvm.ko': No such file or directory

modprobe: ERROR: could not insert 'kvm': Unknown symbol in module, or unknown parameter (see dmesg)

modprobe: INFO: context 0x55cbb0c6c440 released

```

```
[   32.796808] kvm: Unknown symbol user_return_notifier_unregister (err -2)

[   32.796811] kvm: Unknown symbol preempt_notifier_inc (err -2)

[   32.796822] kvm: Unknown symbol preempt_notifier_register (err -2)

[   32.796836] kvm: Unknown symbol irq_bypass_unregister_consumer (err -2)

[   32.796871] kvm: Unknown symbol user_return_notifier_register (err -2)

[   32.796873] kvm: Unknown symbol preempt_notifier_dec (err -2)

[   32.796878] kvm: Unknown symbol irq_bypass_register_consumer (err -2)

[   32.796881] kvm: Unknown symbol preempt_notifier_unregister (err -2)

```

Here is my .kernel config: http://dpaste.com/0S936AZ

I have ensured that VT-d is enabled in my BIOs as well. I even updated the BIOS firmware to the latest. 

Any suggestions?

----------

## fturco

Welcome to the Gentoo forums!

 *c0ntrarian wrote:*   

> 
> 
> ```
> modprobe: INFO: Failed to insert module '/lib/modules/5.4.31-ck/kernel/arch/x86/kvm/kvm.ko': No such file or directory
> ```
> ...

 

Does the /lib/modules/5.4.31-ck/kernel/arch/x86/kvm/kvm.ko file exist on your system?

Also, what does the following command return?

```
uname -r
```

----------

## c0ntrarian

 *fturco wrote:*   

> Welcome to the Gentoo forums!
> 
>  *c0ntrarian wrote:*   
> 
> ```
> ...

 

Yes, both kvm.ko and kvm-intel.ko exist in that folder.

uname shows this:

```
/lib/modules/5.4.31-ck/kernel/arch/x86/kvm % uname -r

5.4.31-ck

```

----------

## Anon-E-moose

Typically you load with modprobe kvm-amd/intel and let it load kvm under it.

Edit to add: what does modinfo kvm and kvm-intel return?

----------

## NeddySeagoon

c0ntrarian,

```
[   32.796808] kvm: Unknown symbol user_return_notifier_unregister (err -2)
```

Unknown symbol like this usually means that your kernel and modules are not from the same kernel build.

This is easy to get when you forget to mount boot for the kernel install.

It all looks right but you get your old kernel and new modules.

Its easy to detect.

What is the date/time in 

```
uname -a
```

That's the build date and time of the running kernel. Is it what you expected?

----------

## c0ntrarian

 *NeddySeagoon wrote:*   

> c0ntrarian,
> 
> ```
> [   32.796808] kvm: Unknown symbol user_return_notifier_unregister (err -2)
> ```
> ...

 \

May 5th which is a few weeks ago. This doesn't seem right since I make cleaned, and make'd my kernel yesterday and installed to boot. Although, I mount boot through fstab and is always mounted while I use the machine. (lsblk shows /boot mounted to partition 3) My kernel in /boot shows up as being modified on May 28th Should I manually cp my kernel to my boot partition?

----------

## c0ntrarian

 *NeddySeagoon wrote:*   

> c0ntrarian,
> 
> ```
> [   32.796808] kvm: Unknown symbol user_return_notifier_unregister (err -2)
> ```
> ...

 

Solved thank you so much. My PC was mounting boot to the wrong drive after I DD'd it. Silly me. I KNEW it was something silly and obvious.

----------

## Hu

It may be obvious now, but it is a sufficiently common mistake that long time helpers have learned to prompt requesters to check it early in the troubleshooting process.

----------

