Page 1 of 1

Cannot compile the VBox kernel on Debian Lenny.

Posted: 6. Jul 2008, 12:55
by Spyros
Hello.

Yesterday I've installed the latest VBox using the .deb package from the Sun download site. Unfortunately, the installation finishes, but the VBox kernel driver cannot compile.

This is the message the log file contains;

Code: Select all

Makefile:127: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
I did search the web to find a solution, to end up installing make, automake, gcc and binutils. Unfortunately I couldn't install kernel-devel, as apt-get couldn't find it. Neither I did find a package for it.

I also did "export KERN_DIR=/usr/src/" in an effort to point VBox to my kernel, but it failed.

Can anyone help me with this? What I could try myself is already done, now I'm in the confused state.

:?

Posted: 6. Jul 2008, 12:59
by Sasquatch
Do you have your kernel headers installed? You need those if you want to compile kernel modules. Run 'sudo apt-get install kernel-headers-$(uname -r)'. You might need to add something in front of 'kernel', as for Ubuntu it's ubuntu-kernel-headers. I don't know how it's done for Debian.

Posted: 6. Jul 2008, 13:14
by Spyros
I tried;

Code: Select all

# apt-get install kernel-headers-2.6.24-1-686
# apt-get install linux-kernel-headers-2.6.24-1-686
but both returned the same error message; E: Couldn't find package <package>.

Searching the web, I came up with this page from withing the Debian site; http://packages.debian.org/lenny/linux-kernel-headers. As it seems, in Debian the kernel headers are included in the linux-libc-dev package, which is already installed on my system.

Any more ideas? :?

Posted: 8. Jul 2008, 13:36
by hellblade
debian's naming is linux-headers-... so you need to run

Code: Select all

# aptitude install linux-headers-$(uname -r)
For my 64bit installation I have linux-headers-2.6.24-1-amd64

Posted: 8. Jul 2008, 13:53
by NickLeverton
If you want to make sure the kernel and its headers get updated in step, you can install the meta-packages:

linux-image-2.6-686
linux-headers-2.6-686

These will always point to the latest kernel for your version of Debian (now at 2.6.24-1 for Lenny, but will soon be updated to the intended Lenny release version 2.6.25). Adjust the -686 as needed for your hardware of course :)