Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Failed to load modules on QEMU/KVM VPS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
spetex
n00b
n00b


Joined: 26 Oct 2019
Posts: 4

PostPosted: Sat Oct 26, 2019 6:06 am    Post subject: Failed to load modules on QEMU/KVM VPS Reply with quote

Hello everyone!

I have recently started to experiment with Gentoo on a VPS that is running QEMU/KVM virtualization.

I did the basic install of AMD64 Gentoo, did genkernel to be safe, because I was treading into the unknown.
I managed to boot and run the system easy, but quickly found out I cannot run iptables because my kernel module are missing.

I did a research and found out when I do

Code:
make modules_install


it fails with:

Code:
depmod: ERROR: fstatat(3, 4.9.0-8-amd64): Too many levels of symbolic links


Ive discovered that my modules are in the /lib/modules/4.19.72-gentoo folder, but the uname -r command returns the kernel of the host system so my modpobe looks to wrong folder and fails to find any modules.

What am I missing?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45451
Location: 56N 3W

PostPosted: Sat Oct 26, 2019 9:19 am    Post subject: Reply with quote

spetex,

Welcome to Gentoo.

/lib/modules/4.19.72-gentoo is the correct path for the modules that belong to the kernel 4.19.72-gentoo
If
Code:
uname -r
shows a different kernel then modules from /lib/modules/4.19.72-gentoo will correctly not be found.

How do you boot your virtual machine?
What does
Code:
ls -l /boot
show for the VM?

It sounds like you are not booting the kernel that you think your are in your Gentoo.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
spetex
n00b
n00b


Joined: 26 Oct 2019
Posts: 4

PostPosted: Sat Oct 26, 2019 1:00 pm    Post subject: Reply with quote

Hi Neddy!

I am for sure certain I am booting the correct kernel.
I have configured the grub and put the correct kernel together with the initramfs in my /boot folder.

This is the output of ls of my /boot folder:

Code:
-rw-r--r-- 1 root root  164734 Oct 26 05:21 config-4.19.72-gentoo
-rw-r--r-- 1 root root  164284 Oct 25 15:44 config-4.19.72-gentoo.old
drwxr-xr-x 1 root root      78 Oct 24 06:56 grub
-rw-r--r-- 1 root root 8542688 Oct 23 16:14 initramfs-genkernel-x86_64-4.19.72-gentoo
-rw-r--r-- 1 root root       0 Oct 20 21:53 .keep
-rw-r--r-- 1 root root 6517408 Oct 23 15:01 kernel-genkernel-x86_64-4.19.72-gentoo
-rw-r--r-- 1 root root 3421157 Oct 26 05:21 System.map-4.19.72-gentoo
-rw-r--r-- 1 root root 3389384 Oct 25 15:44 System.map-4.19.72-gentoo.old
-rw-r--r-- 1 root root 3279049 Oct 23 15:01 System.map-genkernel-x86_64-4.19.72-gentoo
-rw-r--r-- 1 root root 6914720 Oct 26 05:21 vmlinuz-4.19.72-gentoo
-rw-r--r-- 1 root root 6840992 Oct 25 15:44 vmlinuz-4.19.72-gentoo.old


I don't understand why
Code:
uname -r
shows a different kernel than I am running.

I have experimentally verified that I am in fact running the gentoo kernel because I have changed some configuration to enable my networking. This was before I found out my modules are not linked correctly.
I can change the baked in <K> config add see the results after reboot.

I am unsure of the details of the QEMU/KVM emulator because I am not the person running the VPS software, that is my provider. I am renting an instance.
Unfortunately I have not found any detailed information. I can run debian/ubuntu installations without a problem.

I just realized that I want to run gentoo there as it is my daily runner on my laptop for past year.

Thanks for the help!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45451
Location: 56N 3W

PostPosted: Sat Oct 26, 2019 1:52 pm    Post subject: Reply with quote

spetex,

You have three versions of the 4.19.72 kernel in /boot

Code:
kernel-genkernel-x86_64-4.19.72-gentoo
vmlinuz-4.19.72-gentoo
vmlinuz-4.19.72-gentoo.old


uname -r will show that they are all called 4.19.72-gentoo, so we can't tell them apart that way.

You only have a single initrd called initramfs-genkernel-x86_64-4.19.72-gentoo. That only works with the kernel-genkernel-x86_64-4.19.72-gentoo kernel.
That pair was made at about Oct 23 16:14. Thats the oldest kernel you have

We can tell kernels apart from the output of
Code:
uname -a

Code:
$ uname -a
Linux NeddySeagoon_Static 5.2.3-gentoo #1 SMP PREEMPT Sat Jul 27 21:34:25 BST 2019 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux

The date and time is the kernel build time. The #1 means its the first build but that's not always reliable.

Grub has a wrinkle too. Your newest kernel may be hidden in the Advanced menu - its not used by default.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
spetex
n00b
n00b


Joined: 26 Oct 2019
Posts: 4

PostPosted: Sat Oct 26, 2019 2:07 pm    Post subject: Reply with quote

My
Code:
 uname -r
prints:

Code:

4.9.0-8-amd64


Actually my
Code:
uname -a
is:

Code:
Linux spetex 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 QEMU Virtual CPU version 0.12 GenuineIntel GNU/Linux


I am certain I have never build a 4.9.0 kernel.

I can pick the kernel in my grub, that's how I verified I am running the gentoo kernel and not 4.9.0 which is the output of my uname because I can change the config and see the result i.e. my network interface working or not.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45451
Location: 56N 3W

PostPosted: Sat Oct 26, 2019 2:21 pm    Post subject: Reply with quote

spetex,

A Debian kernel too :)

KVM/QEMU con be configured to boot two ways, directly from the host or from /boot inside the KVM.
Its an option on the QEMU command line.

Depending on what QEMU parameters you have control over yourself, you may not be able to change that.
Its not your Gentoo install. It happens before your Gentoo starts.

If you get the grub menu, its not your grub menu. They may be an option there to let you boot your kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
spetex
n00b
n00b


Joined: 26 Oct 2019
Posts: 4

PostPosted: Sat Oct 26, 2019 3:21 pm    Post subject: Reply with quote

I have changed the Boot Method from Debian 4.9.0 to Direct Disk and am running the correct (my) kernel now.

Thanks a lot! You have been very helpful.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum