unable to find the sources of your current Linux kernel

Discussions related to using VirtualBox on Linux hosts.
Post Reply
rodyz
Posts: 13
Joined: 14. Oct 2008, 10:38

unable to find the sources of your current Linux kernel

Post by rodyz »

I am not a newbie, but pretty unexperienced concerning linux. I am running a freshly installed RHEL 5.4. The installation of the RPM-package, downloaded 1 h ago, failed partly with the following details:
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.

Compilation of the kernel module FAILED! VirtualBox will not start until this
problem is fixed. Please consult /var/log/vbox-install.log to find out why the
kernel module does not compile. Most probably the kernel sources are not found.
Install them and execute

/etc/init.d/vboxdrv setup

as root.
The content of the log file is:
** Compiling vboxdrv
Makefile:152: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.
Any suggestions what to do very appreciated

TIA Rodyz
miros84
Posts: 20
Joined: 29. Jan 2010, 18:45
Primary OS: Debian Lenny
VBox Version: PUEL
Guest OSses: windows

Re: unable to find the sources of your current Linux kernel

Post by miros84 »

Try

Code: Select all

/etc/init.d/vboxdrv setup
if that doesnot work, install linux-headers
miros84
Posts: 20
Joined: 29. Jan 2010, 18:45
Primary OS: Debian Lenny
VBox Version: PUEL
Guest OSses: windows

Re: unable to find the sources of your current Linux kernel

Post by miros84 »

I dont use redhad, but try this:

Code: Select all

yum install kernel-devel
then do that as root

Code: Select all

    /etc/init.d/vboxdrv setup
rodyz
Posts: 13
Joined: 14. Oct 2008, 10:38

Re: unable to find the sources of your current Linux kernel

Post by rodyz »

Solved - thanks miros84

I have installed the kernel for xen, using yum, but that does not automatically install the headers too, as I know now.
In addition I had to add the path to the actual kernel.

After

Code: Select all

/etc/init.d/vboxdrv setup KERN_DIR=/usr/src/kernels/<actual_kernel>
I could create guests.
rodyz
Posts: 13
Joined: 14. Oct 2008, 10:38

Re: unable to find the sources of your current Linux kernel

Post by rodyz »

Ups, forgot to mention. (Maybe interesting for others)

I had also to recompile.

Code: Select all

/usr/src/vboxdrv-<version_number>/make
/usr/src/vboxdrv-<version_number>/make install
Post Reply