How to manage Headless Virtualbox using phpvirtualbox on Ubuntu Server

On our previous tutorial, I already show you how to install Virtualbox on an Ubuntu Server. Now, I want to share how to manage the headless virtualbox on Ubuntu Server using phpvirtualbox. As a result we will have an ordinary Virtualbox interface on a web browser.
In order to manage Headless Virtualbox using phpvirtualbox on Ubuntu Server, follow these steps below. I assume you already installed Virtualbox on Ubuntu Server.

Installing phpvirtualbox

First we need to create a new user called vbox and add it to vboxusers group. Use this command to do this
useradd -m vbox -G vboxusers
Create password for vbox
passwd vbox
Now create a new file /etc/default/virtualbox
nano /etc/default/virtualbox
and paste this line below into the file
VBOXWEB_USER=vbox
Now execute this command to create service and start the service

update-rc.d vboxweb-service defaults
/etc/init.d/vboxweb-service start
Next we need to install some packages for the phpvirtualbox
apt-get install apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common apache2 apache2-doc apache2-suexec libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libapr1 php5-common php5-mysql php5-suhosin php-pear wget
Now restart Apache2
/etc/init.d/apache2 restart
Download and install phpvirtualbox
cd /var/www
wget https://phpvirtualbox.googlecode.com/files/phpvirtualbox-4.2-2.zip
unzip phpvirtualbox-4.2-2.zip
mv phpvirtualbox-4.2-2.zip phpvirtualbox
cd phpvirtualbox
Now create config.php
cp config.php-example config.php
Now edit the config.php file and change the password with your vbox user password we created earlier.

/* Username / Password for system user that runs VirtualBox */
var $username = 'vbox';
var $password = 'gamblis';
OK that's it. Now open web browser and type this address to open the phpvirtualbox
http://youripaddress/phpvirtualbox
Change youripaddress with your Ubuntu server IP address. Use admin and password admin to login.