Cannot compile the VBox kernel on Debian Lenny.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Spyros
Posts: 4
Joined: 27. Jun 2008, 22:57

Cannot compile the VBox kernel on Debian Lenny.

Post 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.

:?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Spyros
Posts: 4
Joined: 27. Jun 2008, 22:57

Post 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? :?
hellblade
Posts: 1
Joined: 8. Jul 2008, 13:31

Post 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
NickLeverton
Posts: 4
Joined: 8. Jul 2008, 12:41
Location: UK
Contact:

Post 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 :)
Post Reply