Ubuntu – Help me install guest additions on Ubuntu 11.04

10.0411.04virtualboxwindows xp

I'm having problems installing guest additions on a Ubuntu 11.04 guest os. The host os is Windows XP pro

On the host os (Windows XP), I also have another guest os Ubuntu 10.04, and I have had no problem installing guest additions on that.

When I try installing guest additions on the guest os Ubuntu 11.04, I get a message saying

The headers for the current running
kernel was not found

So I installed

linux-headers-generic

Tried installing guest additions again, and got the same message as before:

The headers for the current running
kernel was not found

So my question is, how do I install guest additions on the guest os ubuntu 11.04 where Windows XP is the host os. I just checked with uname -a to get the correct version, then check using aptitude and noticed that the correct version is already installed.

I am using VirtualBox 4.0.8.

Best Answer

You will need to install the kernel modules (headers) package that match the kernel version you are running the Ubuntu virtual machine with.

Type the following command in the terminal:

uname -a

This will give you line like this:

Linux dirk-Studio-1558 2.6.38-9-generic #43-Ubuntu SMP Thu Apr 28 15:23:06 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

The first word is the type of system, the second is the name of your machine and the third one is the one you are looking for. It gives the kernel version.

So you need to install the linux-headers-{my kernel version here} package from Synaptic org using apt-get. In my case it would be

sudo apt-get install linux-headers-2.6.38-9-generic

or directly in one generic command:

sudo apt-cache search linux-headers-`uname -r`

Hope that helps!

edit:

Ok, if that is setup correctly you can try to install the packages listed here Check post #12