Page 1 of 1

[Solved] Ubuntu jaunty virtualbox 3.0.0 error Compiling vbox

Posted: 4. Jul 2009, 16:06
by arysar
I tried to install virtualbox 3.0.0 but I get an error compiling vboxdrv the following is the /var/log/vbox-install.log:

** Compiling vboxdrv
Attempting to install using DKMS

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

DKMS: add Completed.

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


I already have installed
build-essential
linux-headers-generic

any ideas?

Thanks!

Re: Ubuntu jaunty virtualbox 3.0.0 error Compiling vboxdrv

Posted: 4. Jul 2009, 16:32
by Perryg
Type uname -r and see if the kernel you are using matches the one that is being asked for.
I found that the grub update in my Ubuntu 9.04 failed (when the last kernel was updated) to update and caused this very problem.
I simply edited my /boot/grub/menu.lst to include the new kernel and all was right with the world once again.
Be sure not to deleted any lines until you are sure it works, and make a backup of this file before you start or you could be reloading the OS!

Re: Ubuntu jaunty virtualbox 3.0.0 error Compiling vboxdrv

Posted: 5. Jul 2009, 01:45
by arysar
uname -r gives me:

2.6.27-7-generic


and the grub

title Ubuntu 8.10, kernel 2.6.27-7-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=c55ce624-30fb-4254-895e-b8b375c563d5 ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic

so I think they are ok...

thanks!

Re: Ubuntu jaunty virtualbox 3.0.0 error Compiling vboxdrv

Posted: 5. Jul 2009, 14:16
by Sasquatch
They are not ok. Ubuntu 8.10 uses 2.6.27, 9.04 uses 2.6.28. That line isn't there, you have to manually add it.

Re: Ubuntu jaunty virtualbox 3.0.0 error Compiling vboxdrv

Posted: 5. Jul 2009, 22:27
by alukin
Solution is easy. You need some parts of kernel source (heacders) to compile VB drivers.

On Ubuntu just do:

apt-get install build-essential

Re: Ubuntu jaunty virtualbox 3.0.0 error Compiling vboxdrv

Posted: 14. Jul 2009, 12:09
by mrwoodbrick
Hey thanks. I was tearing my hair out over the same error. All I did was:

sudo gedit /boot/grub/menu.lst

and changed the top lines to reflect the new kernel version on my system (2-6-28-13-generic)

After restart, the Virtualbox kernel module compiled with no hitch.

Thanks again.