Virtualbox on Ubuntu 12.04 Server

Instructions for a headless Virtualbox server on Ubuntu 12.04

Prerequisites: web server with php5

apt-get install apache2-mpm-prefork php5-suhosin libapache2-mod-php5 unzip

Install virtualbox and extension pack

apt-get install dkms

apt-get install virtualbox-[current version] --no-install-recommends

wget http://[latest extension pack]

vboxmanage extpack install [latest extension pack]

Add vbox user and add to vboxusers group


adduser vbox

adduser vbox vboxusers

Create /etc/default/virtualbox file with the following content (used by SOAP API)

VBOXWEB_USER=vbox

Create startup links for vboxwebsrv

update-rc.d vboxweb-service defaults

/etc/init.d/vboxweb-service start

Download phpvirtualbox

wget http://phpvirtualbox.googlecode.com/files/[current version]

Unzip and move to proper location with proper name

unzip phpvirtualbox-[current version].zip

mv phpvirtualbox-[current version] /var/www/phpvirtualbox

Go to /var/www/phpvirtualbox

cp config.php-example config.php

nano config.php

var $username = ‘vbox’;

var $password = ‘[password]’;

var $consoleHost = ‘[host ip address]’;

Restart server, open browser to http://[server]/phpvirtualbox, log in as admin/admin

Set Remote Desktop port, then start guest OS, use RDP to view guest OS