Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Having trouble installing GuestAdditions in VirtualBox / Vagrant running under Mac OS X 10.8 (Mountain Lion). I haven't worked with VB/Vagrant before nor much with Linux so looking for a little guidance...

Error! Your kernel headers for kernel 2.6.32-38-server cannot be found at /lib/modules/2.6.32-38-server/build or /lib/modules/2.6.32-38-server/source.

The error can be found in context down at the bottom of the shell output (below)

vagrant@lucid64:~$ sudo apt-get install dkms -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  fakeroot make patch
Suggested packages:
  make-doc diffutils-doc
The following NEW packages will be installed:
  dkms fakeroot make patch
0 upgraded, 4 newly installed, 0 to remove and 23 not upgraded.
Need to get 458kB of archives.
After this operation, 2,359kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main make 3.81-7ubuntu1 [166kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/main patch 2.6-2ubuntu1 [121kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main dkms 2.1.1.2-2ubuntu1 [70.8kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ lucid/main fakeroot 1.14.4-1ubuntu1 [101kB]
Fetched 458kB in 1s (337kB/s) 
Selecting previously deselected package make.
(Reading database ... 44864 files and directories currently installed.)
Unpacking make (from .../make_3.81-7ubuntu1_amd64.deb) ...
Selecting previously deselected package patch.
Unpacking patch (from .../patch_2.6-2ubuntu1_amd64.deb) ...
Selecting previously deselected package dkms.
Unpacking dkms (from .../dkms_2.1.1.2-2ubuntu1_all.deb) ...
Selecting previously deselected package fakeroot.
Unpacking fakeroot (from .../fakeroot_1.14.4-1ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up make (3.81-7ubuntu1) ...
Setting up patch (2.6-2ubuntu1) ...
Setting up dkms (2.1.1.2-2ubuntu1) ...

Setting up fakeroot (1.14.4-1ubuntu1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode.

vagrant@lucid64:~$ sudo vbox/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.18 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.16 of VirtualBox Guest Additions...
tar: Record size = 16 blocks
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions ...done.
Installing the Window System drivers ...fail!
(Could not find the X.Org or XFree86 Window System.)

look at /var/log/vboxadd-install.log:

vagrant@lucid64:~$ cat /var/log/vboxadd-install.log
Uninstalling modules from DKMS
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxguest/4.1.18/source ->
                 /usr/src/vboxguest-4.1.18

DKMS: add Completed.

Error! Your kernel headers for kernel 2.6.32-38-server cannot be found at
/lib/modules/2.6.32-38-server/build or /lib/modules/2.6.32-38-server/source.
You can use the --kernelsourcedir option to tell DKMS where it's located, or you could install the linux-headers-2.6.32-38-server package.
Failed to install using DKMS, attempting to install without
/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
share|improve this question
    
What happens when you download the linux-headers package? –  qweet Aug 9 '12 at 0:03
    
how does one do that? Again, I don't have much experience with Linux. –  Meltemi Aug 9 '12 at 0:24

1 Answer 1

up vote 3 down vote accepted

Error! Your kernel headers for kernel 2.6.32-38-server cannot be found at /lib/modules/2.6.32-38-server/build or /lib/modules/2.6.32-38-server/source.

You can use the --kernelsourcedir option to tell DKMS where it's located, or you could install the linux-headers-2.6.32-38-server package.

Failed to install using DKMS, attempting to install without /tmp/vbox.0/Makefile.include.header:97: * Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.

# sudo apt-get install linux-headers-2.6.32-38-server

and try again.

share|improve this answer
    
Yup, this worked...after a restart. Thanks! –  Meltemi Aug 9 '12 at 18:02
    
I have same issue but on CentOS... I have all kernel-devel installed etc... yum install linux-headers-2.6.32-358-server == "No package available" now what? –  Brock Hensley Oct 16 '13 at 15:10
    
uname -r? rpm -qa | grep kernel? –  quanta Oct 16 '13 at 15:32
    
@quanta [dirt@loki ~]$ uname -r 2.6.32-358.6.2.el6.x86_64 [dirt@loki ~]$ rpm -qa | grep kernel kernel-devel-2.6.32-358.18.1.el6.x86_64 kernel-headers-2.6.32-358.18.1.el6.x86_64 kernel-firmware-2.6.32-358.18.1.el6.noarch dracut-kernel-004-303.el6.noarch kernel-2.6.32-358.0.1.el6.x86_64 kernel-2.6.32-358.18.1.el6.x86_64 kernel-2.6.32-358.6.2.el6.x86_64 kernel-2.6.32-358.14.1.el6.x86_64 –  Brock Hensley Oct 16 '13 at 15:43
    
Oh I think I see the issue; Im running 6.2 but only have headers for 18.1.... Found missing headers via: sudo yum install kernel-devel-2.6.32-358.6.2.el6.x86_64 –  Brock Hensley Oct 16 '13 at 15:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.