Page 1 of 1

Kernel headers not found CentOS 6.5

Posted: 27. Feb 2015, 22:00
by Versteckt
Hi =D, i'm having some issues when i'm trying to install virtualbox on Centos 6.5.

This is the error i get:

Code: Select all

# sudo /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [  OK  ]
Uninstalling old VirtualBox DKMS kernel modules            [  OK  ]
Trying to register the VirtualBox kernel modules using DKMS
Error! Your kernel headers for kernel 2.6.32-431.1.2.0.1.el6.x86_64 cannot be found at
/lib/modules/2.6.32-431.1.2.0.1.el6.x86_64/build or /lib/modules/2.6.32-431.1.2.0.1.el6.x86_64/source.
                                                           [FAILED]
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules                      [FAILED]
  (Look at /var/log/vbox-install.log to find out what went wrong)
this is my uname -r kernel:

Code: Select all

# uname -r
2.6.32-431.1.2.0.1.el6.x86_64
This is my /var/log/vbox-install.log:

Code: Select all

Uninstalling modules from DKMS
  removing old DKMS module vboxhost version  4.3.22

------------------------------
Deleting module version: 4.3.22
completely from the DKMS tree.
------------------------------
Done.
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxhost/4.3.22/source ->
                 /usr/src/vboxhost-4.3.22

DKMS: add Completed.
You can use the --kernelsourcedir option to tell DKMS where it's located.
Failed to install using DKMS, attempting to install without
Makefile:183: *** Error: unable to find the sources of your current Linux kerne$


I've alredy tryed all bug fix i find on the interent =/ Please anyone know how to fix it ?

Re: Kernel headers not found CentOS 6.5

Posted: 27. Feb 2015, 22:28
by Perryg
Did you install the headers for the running kernel?

Re: Kernel headers not found CentOS 6.5

Posted: 27. Feb 2015, 22:33
by Versteckt
i think i did, but i just use

Code: Select all

yum install kernel-headers.x86_64 
Result:

Code: Select all

# yum install kernel-headers.x86_64
Loaded plugins: fastestmirror, refresh-packagekit
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror [dot] yellowfiber[dot]net
 * epel: mirror[dot]symnds[dot]com
 * extras: mirror[dot]yellowfiber[dot]net
 * rpmforge: mirror[dot]us[dot]leaseweb[dot]net
 * updates: mirror[dot]yellowfiber[dot]net
Package kernel-headers-2.6.32-504.8.1.el6.x86_64 already installed and latest version
Nothing to do

Re: Kernel headers not found CentOS 6.5

Posted: 27. Feb 2015, 22:44
by Perryg

Code: Select all

uname -r = 2.6.32-431.1.2.0.1.el6.x86_64
Package kernel-headers-2.6.32-504.8.1.el6.x86_64 already installed and latest version
They don't match

It looks like you have installed a new kernel but are booting to the older kernel. In any case you must get them to match before it will work.

Code: Select all

yum install kernel-headers-$(uname -r)
Should do it if the repo has the proper headers. You might also need kernel-devel not sure about centos or make sure you are actually booting to the 504.8.1 kernel.

Re: Kernel headers not found CentOS 6.5

Posted: 27. Feb 2015, 23:12
by Versteckt
i got this:

Code: Select all

# yum install kernel-headers-$(uname -r)
Loaded plugins: fastestmirror, refresh-packagekit
Setting up Install Process
Loading mirror speeds from cached hostfile
No package kernel-headers-2.6.32-431.1.2.0.1.el6.x86_64 available.
Error: Nothing to do
BTW, thanks for helping =D

Re: Kernel headers not found CentOS 6.5

Posted: 27. Feb 2015, 23:21
by Perryg
And do you see a new kernel at the boot screen to choose from?

Re: Kernel headers not found CentOS 6.5

Posted: 27. Feb 2015, 23:30
by Versteckt
No, because it is a VPS.

i got all these kernels =/

Code: Select all

#rpm -q kernel
kernel-2.6.32-431.1.2.0.1.el6.x86_64
kernel-2.6.32-431.11.2.el6.x86_64
kernel-2.6.32-431.29.2.el6.x86_64
kernel-2.6.32-504.3.3.el6.x86_64
kernel-2.6.32-504.8.1.el6.x86_64

Re: Kernel headers not found CentOS 6.5

Posted: 27. Feb 2015, 23:38
by Perryg
It clearly shows you have the kernel-2.6.32-431.1.2.0.1el6.x86_64 kernel so you need to boot into it. Anyway this is an issue you need to take up with the provider and or the centos group.