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

Discussions about using Linux guests in VirtualBox.
Post Reply
bradsmith74
Posts: 3
Joined: 13. Apr 2010, 05:10
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu, Windows

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

Post 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.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

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

Post 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
hubmair
Posts: 1
Joined: 9. Sep 2010, 19:07
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: kubuntu

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

Post 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
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

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

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply