PDA

View Full Version : VirtualBox, unable to find kernel sources



James.Elsey
28th December 2009, 08:46 PM
Hi,

How can I use DKMS to force the virtualbox setup to run using the correct kernel sources?

This is the error I'm getting in the vbox logs


Attempting to install using DKMS
removing old DKMS module vboxdrv version 3.1.2

------------------------------
Deleting module version: 3.1.2
completely from the DKMS tree.
------------------------------
Done.

Creating symlink /var/lib/dkms/vboxdrv/3.1.2/source ->
/usr/src/vboxdrv-3.1.2

DKMS: add Completed.

Error! Your kernel source for kernel 2.6.31.6-166.fc12.x86_64 cannot be found at
/lib/modules/2.6.31.6-166.fc12.x86_64/build or /lib/modules/2.6.31.6-166.fc12.x86_64/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
Failed to install using DKMS, attempting to install without
Makefile:152: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.


[root@nevada Downloads]# uname -r
2.6.31.6-166.fc12.x86_64

scottro
28th December 2009, 08:50 PM
Try

yum install kernel-devel

You should probably, at a bare minimum, also install gcc gcc-c++ make and automake. Otherwise, various other things that have to compile may not work.

James.Elsey
28th December 2009, 10:26 PM
Hi Scottro,

I've installed kernel-devel

I should have all the necessary packages to install as I've installed wine from source so gcc etc should already be there

Thanks

scottro
28th December 2009, 10:49 PM
Yup, they should be.

Hate to say this, but maybe try a reboot. You should have a /lib/modules/$(uname -r)/build directory and it should be populated with various things--it's a symlink to /usr/src/kernels/$(uname -r)

glennzo
28th December 2009, 10:55 PM
su
yum install kernel-devel gcc
yum groupinstall 'Development Tools'

If you use the PAE kernel then

su
yum install kernel-PAE-devel gcc
yum groupinstall 'Development Tools'
Then

/etc/init.d/vboxdrv setup

May need to add your user the the vbox group.

James.Elsey
29th December 2009, 07:10 PM
Hi Guys,

I've tried what you have suggested, I've done the groupinstall for development tools and have restarted, but I'm still facing the same issue

I can load up virtual box and see my VM, but I can't start it as it complains that I need to run /etc/init.d/vboxdrv setup

I've tried that and this is what I'm still getting in the logs


Attempting to install using DKMS
removing old DKMS module vboxdrv version 3.1.2

------------------------------
Deleting module version: 3.1.2
completely from the DKMS tree.
------------------------------
Done.

Creating symlink /var/lib/dkms/vboxdrv/3.1.2/source ->
/usr/src/vboxdrv-3.1.2

DKMS: add Completed.

Error! Your kernel source for kernel 2.6.31.6-166.fc12.x86_64 cannot be found at
/lib/modules/2.6.31.6-166.fc12.x86_64/build or /lib/modules/2.6.31.6-166.fc12.x86_64/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
Failed to install using DKMS, attempting to install without
Makefile:152: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.

Hlingler
29th December 2009, 07:23 PM
Please post results:
rpm -qa | grep kernel | sort

V

James.Elsey
29th December 2009, 08:47 PM
[root@nevada james]# rpm -qa | grep kernel | sort
abrt-addon-kerneloops-1.0.0-1.fc12.x86_64
abrt-plugin-kerneloopsreporter-1.0.0-1.fc12.x86_64
kernel-2.6.31.6-162.fc12.x86_64
kernel-2.6.31.6-166.fc12.x86_64
kernel-2.6.31.9-174.fc12.x86_64
kernel-devel-2.6.31.9-174.fc12.x86_64
kernel-firmware-2.6.31.9-174.fc12.noarch
kernel-headers-2.6.31.9-174.fc12.x86_64

Hlingler
30th December 2009, 05:07 AM
I see it now:
Error! Your kernel source for kernel 2.6.31.6-166.fc12.x86_64 cannot be found at
/lib/modules/2.6.31.6-166.fc12.x86_64/build or /lib/modules/2.6.31.6-166.fc12.x86_64/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
Failed to install using DKMS, attempting to install without
Makefile:152: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.But:
kernel-devel-2.6.31.9-174.fc12.x86_64So: what kernel are you booted into ? Try booting into kernel-2.6.31.9-174.fc12.x86_64, then it should all "Just Work".

V