[WorksForMe] Centos 7.5 driver compile problem

Discussions related to using VirtualBox on Linux hosts.
Post Reply
LarryE
Posts: 4
Joined: 14. Oct 2018, 04:04

[WorksForMe] Centos 7.5 driver compile problem

Post by LarryE »

Hi

I'm running Centos 7.5 kernel 4.9.127-32.el7.x86_64 and I can't get the drivers to compile. Here is the error:

Code: Select all

gremlin ~]$ sudo /sbin/vboxconfig 
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-4.9.127-32.el7.x86_64
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-4.9.127-32.el7.x86_64

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
Yes I have the matching kernel-devel installed

Code: Select all

gremlin ~]$ rpm -q kernel-devel
kernel-devel-4.9.127-32.el7.x86_64
Yes I have dev tools installed

Code: Select all

Installed Groups:
   Development Tools
Yes I'm running the kernel

Code: Select all

gremlin ~]$ uname -a
Linux gremlin 4.9.127-32.el7.x86_64 #1 SMP Mon Sep 17 13:40:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Even uninstalled all the other kernels

Code: Select all

gremlin ~]$ ls /boot
config-4.9.127-32.el7.x86_64  initramfs-0-rescue-8ef3d6c3a2954d529c943c457be799f6.img  System.map-4.9.127-32.el7.x86_64
efi                           initramfs-4.9.127-32.el7.x86_64.img                      vmlinuz-0-rescue-8ef3d6c3a2954d529c943c457be799f6
grub                          initrd-plymouth.img                                      vmlinuz-4.9.127-32.el7.x86_64
grub2                         symvers-4.9.127-32.el7.x86_64.gz
Any ideas?
Last edited by socratis on 16. Oct 2018, 08:31, edited 1 time in total.
Reason: Marked as [WorksForMe].
LarryE
Posts: 4
Joined: 14. Oct 2018, 04:04

Re: Centos 7.5 driver compile problem

Post by LarryE »

Monte Carlo debugging continues

I've tried installed dkms - same problem
Installed VirtualBox-5.2-5.2.19_125724_el7-1.x86_64.rpm devel release - same problem
Installed VirtualBox-5.2-5.2.97_125811_el7-1.x86_64.rpm snapshot - same problem

This is nuts...nobody else is having a problem with 5.2.18 using the latest Centos 7.5 updates?

Can someone who is running 5.2.18 on Centos 7.5 let me know what kernel you are on?

Thanks.
LarryE
Posts: 4
Joined: 14. Oct 2018, 04:04

Re: Centos 7.5 driver compile problem

Post by LarryE »

Ok I quit doing the random debugging nonsense and started looking at the actual problem.

Turns out that on my system for some reason I have a broken symlink.
This symlink /lib/modules/4.9.127-32.el7.x86_64/build/ was pointing to ../../../usr/src/kernels/4.9.127-32.el7.x86_64 which is one level to shallow.

To fix:

Code: Select all

rm build
ln -s ../../../../usr/src/kernels/4.9.127-32.el7.x86_64 build
Boom!

As to the culprit? Looks like Centos

Code: Select all

rpm -qif /lib/modules/4.9.127-32.el7.x86_64/build
Name        : kernel
Version     : 4.9.127
Release     : 32.el7
Architecture: x86_64
Good night
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Centos 7.5 driver compile problem

Post by socratis »

LarryE wrote:I've tried installed dkms - same problem
VirtualBox hasn't had the need for DKMS since the 5.0.x days, so that shouldn't change the situation, you're right...
LarryE wrote:Installed VirtualBox-5.2-5.2.97_125811_el7-1.x86_64.rpm snapshot - same problem
So, I take it that you were trying the official packages from the VirtualBox site, not the repo's depository. Good to know!
LarryE wrote:This symlink /lib/modules/4.9.127-32.el7.x86_64/build/ was pointing to ../../../usr/src/kernels/4.9.127-32.el7.x86_64 which is one level to shallow.
Any idea how that link got there? Was it something that you did? CentOS did? An app installer did? That's most probably the reason why there were no replies to your post, no one else was seeing that...

Glad you got it going. Thank you for the feedback and for providing the solution, hope someone finds it useful in the future. I really don't know how to "mark" this, but given the unusual link, I tend to want to mark this as a [WorksForMe]. If this is a standard link, and it's an issue that needs to be addressed for every CentOS 7.5 installation, I'll change it to [Solved].
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
LarryE
Posts: 4
Joined: 14. Oct 2018, 04:04

Re: [WorksForMe] Centos 7.5 driver compile problem

Post by LarryE »

Yet another update.

It just occurred to me how in world did a 4.x kernel get installed on my Centos 7.5 load? It should be running a 3.10.x kernel!
Turns out I somehow enabled the centos-virt-xen-46 repo which installed the 4.x kernel. The 4.x rpm still should have installed properly but it at least explains why nobody else ran into this problem.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [WorksForMe] Centos 7.5 driver compile problem

Post by socratis »

Hey, thanks for letting us know. At least you figured out the issue, that's good... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply