phpVirtualBox is an open source web interface for Oracle VirtualBox, written in php with AJAX implementation. It allows you to remotely manage VirtualBox instance, really useful when you don’t have GUI in operating system. phpVirtualBox allows you control and manage guest instance as like the VirtualBox GUI do, you wont find any difference between the web interface and VirtualBox GUI. More to that phpVirtualBox supports remote console via Oracle RDP web client that comes with Extension Pack.
Article will continue after the ad
Here is the small guide to setup phpVirtualBox on Ubuntu (Its supports all Linux Variants, its minimum requirement is to have the web server installed with PHP support).
Install Apache with PHP.
sudo apt-get install apache2 php5 libapache2-mod-php5
Issue the following command to download the lastest phpVirtualBox.
sudo unzip phpvirtualbox-*.zip
Move it to default document root of web server.
sudo mv phpvirtualbox-* /var/www/html/virtualbox
We need to modify the phpVirtualBox configuration to make the successful communication with VirtualBox installation, first we need to rename sample config file (config.php-example to config.php).
sudo mv /var/www/html/virtualbox/config.php-example /var/www/html/virtualbox/config.php
Modify the config file
sudo nano /var/www/html/virtualbox/config.php
Following are the minimum configuration for phpVirtualBox. User Name / Password for the system that runs VirtualBox, in my case i am using user “raj”, because he will be configured to run vboxwebsrv service( will be set in next step).
var $password = ‘x’;
If you are running VirtualBox and php are on the same host, leave the following $location as it is.
VirtualBox setup creates init script vboxweb-service when it is installed, this is used to start and stop the vboxwebserv, before starting the service, we need to have /etc/default/virtualbox file because it contains settings for the service . We need to create it manually if it does not exists.
sodo nano /etc/default/virtualbox
We must set minimum VBOXWEB_USER to run the vboxweb-service, now VirtualBox will run as “raj”; this user and password must be entered in phpVirtualBox config file.
If you are running phpVirtualBox in some other host, VBOXWEB_HOST is need to be set in the same file, in this case phpVirtualBox will communicate with vboxweb-service over the network.
Restart the vboxweb-service.
sudo /etc/init.d/vboxweb-service restart
Now open a web browser and point to http://your-ip-address/virtualbox, you will be asked to login. Default login is admin /admin.
You can find the created vm’s. You can either create a new vm or work on existing vms by taking console.
To take a remote console you must install VirtualBox Extension Pack and also you have to Enable Remote Console.
You can take console by clicking console tab in browser.
Take mstsc of host server where VirtualBox is running.
That’s All. We welcome your comments, please do comment in comments section.