First things first, install
dkms or VirtualBox will break with every kernel upgrade.
apt-get install dkms
Now, download the Linux alternate installer for your architecture from here (under “All distributions”). Transfer it to your Ubuntu Server as needed.
Run the installer:
You should get the following output:
Verifying archive integrity... All good. Uncompressing VirtualBox for Linux installation............ VirtualBox Version 4.2.12 r84980 (2013-04-12T10:28:02Z) installer Installing VirtualBox to /opt/VirtualBox Python found: python, installing bindings... Building the VirtualBox kernel modules VirtualBox has been installed successfully. You will find useful information about using VirtualBox in the user manual /opt/VirtualBox/UserManual.pdf and in the user FAQ http://www.virtualbox.org/wiki/User_FAQ We hope that you enjoy using VirtualBox.
Now, download the extension pack from here, transferring it to your server as necessary. Install it with
VBoxManage extpack install /path/to/extpack
Now, to set up phpVirtualBox to manage VirtualBox.
Create a user call phpvirtualbox with a hard-to-guess password.
(You may need to SSH into your host as the new user for their directory and settings to be created completely.)
Now, create and edit
/etc/default/virtualbox with your favorite text editor, and paste in the following
Start the virtualbox web service
Have it autostart at boot
sudo update-rc.d -f vboxweb-service remove && sudo update-rc.d vboxweb-service defaults
Download the appropriate version of phpVirtualBox from here, transfer it to somewhere on your server, unzip it, and move it to a location under /var/www (such as ‘phpvirtualbox’) for web access. Chown it www-data:www-data recursively.
Rename config.php-example to config.php and edit it
Edit the following to match your phpvirtualbox username and password
/* Username / Password for system user that runs VirtualBox */ var $username = 'vbox'; var $password = 'pass';
Now browse to http://yourserver/phpvirtualbox
Default login is admin:admin
If you want the hard drive images stored somewhere other than /home/phpvirtualbox, click file > preferences and set it.
If you have problems with the remote not cursor not matching the local mouse cursor, do your best to install Guest Additions to the guest OS. This does correct it, even if you’re logging in via RDP.