7

I'm trying to install the Guest Additions in VirtualBox 4.04.on ubuntu 11.10

I have this error:

The headers for the current running kernel were not found.
If the module compilation fails then this could be the reason.

Note that I have already installed the headers but still get this error.

Do you have you an ideas please?

Takkat
  • 142,284
  • the headers have already installed !! –  Jul 19 '12 at 14:34
  • i have done apt-get install virtualbox-guest-additions and in the restart i have this message: modprobe vboxsf failed! starting the virtualbox-guest-additions fail ! –  Jul 19 '12 at 16:54
  • Did you install the guest additions in the guest? (Edited my answer to make that clear). – Takkat Jul 19 '12 at 20:37
  • @Takkat yes i have done apt-get install virtualbox-guest-additions in ubuntu 11.10 now i canot open the virtual machine 11.10 i don't know why , have you an idea please it display that starting the virtualbox-guest-additions fail ! it still blocked –  Jul 20 '12 at 12:21
  • Is this a duplicate of http://askubuntu.com/questions/98416/error-kernel-headers-not-found-but-they-are-in-place ? – David Cary Sep 17 '14 at 21:31

6 Answers6

11

I found that installing dkms with

sudo apt-get install dkms

resolved this error/warning for me. See this answer.

  • dkms is not required these days - there's a script over at https://forums.virtualbox.org/viewtopic.php?f=3&t=86144&p=412599&hilit=dkms+necessary#p412428 which might be able to help install guest additions – Ben Creasy Feb 11 '18 at 21:46
  • This fixed my issue in a Debian 10 (Buster) VM running under VirtualBox 6.1. The error I was getting VirtualBox Guest Additions: Kernel headers not found for target kernel. – f0nzie Sep 01 '20 at 16:53
9

This command will install the kernel headers:

sudo apt-get install linux-headers-$(uname -r)

Now, try to install the Guest Additions again.

SirCharlo
  • 39,486
2

For me (Ubuntu 12.04 LTS host; Ubuntu 13.04 guest; virtualbox 4.1.18 running on the host), it seems that the downloaded guest-additions iso on the host was old, so installing by mounting that iso through vbox's menus failed consistently. There was no package virtualbox-guest-additions available on the guest, so I installed

$ sudo apt-get install virtualbox-guest-dkms

instead, which also pulled in dkms, fakeroot, virtualbox-guest-utils, and virtualbox-guest-x11. Then I rebooted the guest, and copy/paste worked (also, the resolution jumped up).

1

It seems that ubuntu 11.10 does not ship compiler by default. Try apt-get install gcc gcc-4.7

friendzis
  • 111
0

The message you get may not be related to the failure building the Guest Additions. I usually do see this message but Guest Additions build fine and run as expected.

Here are some steps we can try in case we cannot install the guest additions:

  • We may just try to install them again after rebooting the guest OS. If that still does not succeed we can also try to install guest additions as root from command line.

  • It may also be worth to update the guest OS before we install the Guest Additions.

  • Older versions of virtual box may have bugs that stand against a successful install of the GA. Update Virtual Box to the current version (at present 4.1.18).

  • If all fails you can also download and install the ready-built guest additions from the repositories (these will also run with the PUEL version of Virtual Box but they may be out-dated in some aspects) by running the following in the guest Ubuntu:

     sudo apt-get install virtualbox-guest-additions
    
Takkat
  • 142,284
0

First of all find your kernel version by:

$ uname -a
Linux ibm **3.5.0-24**-generic #37-Ubuntu SMP Thu Feb 7 01:50:30 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Next update apt by:

$ sudo apt-get update

Finally install your kernel version (3.5.0-24) header package by apt

$ sudo apt-get install linux-headers-3.5.0-24-generic
Aboozar
  • 31