Page 1 of 1

Installing Guest Adds in Ubuntu, can't build kernel modules

Posted: 15. Apr 2010, 08:53
by bradsmith74
Hello, I am having trouble installing the Guest Additions into an appliance. I'm running VirtualBox 3.1.6 on Mac OS X 10.6.3 as my host and the LAMP/Symfony appliance from Turnkey Linux (v2009.10-2) (which is Ubuntu) is the guest. I've been trying to read the various instructions and hints, but I can't get the GAs to install. After downloading and installing the appliance (and confirming that networking and everything else is working), I perform the following:

Code: Select all

# apt-get update
# apt-get install dkms
# apt-get install bzip2
# apt-get install build-essential linux-headers-generic
# apt-get upgrade
I then rebooted the guest, mounted the Guest Additions and then ran VBoxLinuxAdditions-x86.run:

Code: Select all

# mount /dev/cdrom /mnt/cdrom
# cd /mnt/cdrom
# sh ./VBoxLinuxAdditions-x86.run
Here is the response I get:

Code: Select all

# sh ./VBoxLinuxAdditions-x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 3.1.6 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version of VirtualBox Guest Additions...
Building the VirtualBox Guest Additions kernel modules ...fail!
(Your system does not seem to be set up to build kernel modules.
Look at /var/log/vboxadd-install.log to find out what went wrong)
Installing the Window System drivers ...fail!
(Could not find the X.Org or XFree86 Window System.)
Here is the content of log file:

Code: Select all

# cat /var/log/vboxadd-install.log
Makefile:23: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again..  Stop.
This is my version of the Turnkey appliance:

Code: Select all

# uname -r
2.6.24-27-virtual
I'm very new at this, so any pointers would be appreciated. Thanks.

Re: Installing Guest Adds in Ubuntu, can't build kernel modules

Posted: 15. Apr 2010, 10:31
by fixedwheel
Hi,
bradsmith74 wrote:

Code: Select all

# apt-get install build-essential linux-headers-generic
linux-headers-generic is the headers of the default "-generic" Ubuntu kernel

Code: Select all

# uname -r
2.6.24-27-virtual
this is not the default "-generic" Ubuntu kernel

install the matching headers using your favourite package manager - if you dont know what it is try synaptic from the gnome desktop menu and feed the synaptic search field w/ linux-headers

Re: Installing Guest Adds in Ubuntu, can't build kernel modules

Posted: 9. Sep 2010, 19:19
by hubmair
I am not the best with command line strings. I tried it all and it did not work. It asked for my kubuntu disk to be placed in the cd drive. However I did figure it all out. First I downloaded synaptic, works so much better. Using synaptic I went to kernel universe and installed virtualbox-ose-dkms package. It will ask for your kunbuntu cd to be put in you cdrom. So I burned the iso and activated the cdrom in virtualbox. Once this is installed, you have everything you need to install the guest addons.

Being a bit lazy I also downloaded Krusader and ran it in root mode. I used it to install the addons. For me it just simplifies things. If I have to use the command line I can

Re: Installing Guest Adds in Ubuntu, can't build kernel modules

Posted: 9. Sep 2010, 20:44
by Sasquatch
The reason you got asked for the install disc, is because the default sources are still pointing to it. Edit /etc/apt/sources.list and remove or comment out the cdrom part. It's at the top.

Installing the virtualbox-ose-dkms is something you should never do when you have the PUEL edition. It can cause problems.