Installing VirtualBox on Ubuntu server

From Joe's Boredom

The following info took place on 03/30/2010 while SSH into Ubuntu 8.04 server and installing VirtualBox 3.1

This little howto was put together from bits-and-pieces of information i gathered while searching around along with two problems i ran into and how they where resolved.


  • Add the "non-free" Vbox repo to our sources.list, the current Virtual Box in the repository is a bit dated.
Terminal
name@machine:/$ sudo vi /etc/apt/sources.list

Add the following to the bottom of the list, then save.

deb http://download.virtualbox.org/virtualbox/debian hardy non-free


  • Get Sun's public key...
Terminal
name@machine:/$ sudo wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -


  • Update and Upgrade the server
Terminal
name@machine:/$ sudo aptitude update
name@machine:/$ sudo aptitude upgrade


  • Install the correct Linux Headers along with Vbox (v3.1)
Terminal
name@machine:/$ sudo aptitude install linux-headers-$(uname -r) build-essential virtualbox-3.1


During the install i received an error
* Modprobe vboxdrv failed. Please use 'dmesg' to find out why.
I ran the follow which fixed the problem.

Terminal
name@machine:/$ sudo /etc/init.d/vboxdrv setup
name@machine:/$ sudo /etc/init.d/vboxdrv start


After that i tried to run the following to get alittle info about the Vbox host and received another error...

Terminal
name@machine:/$ VBoxManage list hostinfo

Sun VirtualBox Command Line Management Interface Version 3.1.6
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

ERROR: failed to create the VirtualBox object!
ERROR: Error in /home/**USER**/.VirtualBox/VirtualBox.xml (line 3) -- Cannot handle settings version '1.2-linux'.
/home/vbox/vbox-3.1.6/src/VBox/Main/VirtualBoxImpl.cpp[420] (nsresult VirtualBox::init())
Details: code NS_ERROR_FAILURE (0x80004005), component VirtualBox, interface IVirtualBox, callee <NULL>


So i opened up the /home/**USER**/.VirtualBox/VirtualBox.xml file and edited the following line, changing 1.2-linux to 1.3-linux
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.2-linux">
Saved and now everything seams to be working good.




_