Oracle VirtualBox is great enterprise-ready virtualisation software. However, what it lacks is a powerful Web-based management interface. Usually, people prefer VMWare over VirtualBox, as it has a good Web-based remote management interface.
phpVirtualBox provides an interface that’s a VirtualBox-look-alike for people who are not command-line savvy. Through phpVirtualBox, you can control a headless VirtualBox VM from a Web browser, including operations such as start/stop VMs, take snapshots, configure VMs, import/export VMs, and much more. Some of its code is based on the now inactive VBoxWeb project.
The requirements are:
- Any Web server with PHP 5.2.0 or later; xampp will be good.
- A working installation of Oracle VirtualBox 3.2.2 or later.
- Any Web browser — Firefox, Opera, Chrome or IE — will do the job.
Installation on Windows
Installation is very simple. Here, I’m using Windows XP SP3.
Install Oracle VirtualBox OSE 3.2.10, and then install xampplite-win32-1.7.3
. Download phpVirtualBox and extract the files/folder into the htdocs
directory. phpVirtualBox requires that vboxwebsrv.exe
must be running on the Oracle VirtualBox host machine. This file is located at C:\Program Files\Oracle\VirtualBox\
.
Vboxmanage setproperty websrvauthlibrary null Vboxwebsrv.exe >null
Now, edit the config.php
file and change it to the following settings:
/* Username / Password for system user that runs Oracle VirtualBox */ var $username = 'administrator'; var $password = 'guesswhat'; var $location = 'http://localhost:18083/'; /*don't change if using single machine for VirtualBox and phpVirtualBox*/
Now navigate to the resulting folder in your Web browser (see Figure 1).
Installation on Linux
The installation on Linux is also very simple. I am using Ubuntu 9.10 for this demo, and installed xampp-linux-1.7.3
. It comes with the latest PHP version. To install Oracle VirtualBox 3.2 on Ubuntu, first you have to add the repos for VirtualBox in your /etc/apt/sources.list
:
deb http://download.virtualbox.org/virtualbox/debian karmic non-free
After that, update your repository cache with the following command:
apt-get update
Now install Oracle VirtualBox:
apt-get install virtualbox-3.2
phpVirtualBox requires you to start the vboxwebsrv
program, located under /usr/bin
:
su vbox -c '/usr/bin/vboxwebsrv -b -logfile /dev/null>/dev/null' vbox -- user created to run vboxwebsrv(optional step, you can use your own username)
Here, the parameters are as follows:
-
-b
— run program in the background -logfile
— log file location forvboxwebsrv
Now download phpVirtualBox:
wget http://phpvirtualbox.googlecode.com/files/phpvirtualbox-0.5.zip
Unpack it to /var/www
or /usr/local/apache2/htdocs
. In config.php
, edit the following parameters:
/* Username / Password for system user that runs Oracle VirtualBox */ var $username = 'administrator'; var $password = 'guesswhat'; var $location = 'http://localhost:18083/'; /*don't change if using single machine for VirtualBox and phpVirtualBox*/
Now navigate to the resulting folder in your Web browser.
Pros and cons
Pros: Clutter-free interface for remote management, with all the goodies.
Cons: Intended to run only on a local area network, as it relies on a plain-text password.
In Windows:
Vboxwebsrv.exe -h ip.address.of.virtualbox.host /* Username / Password for system user that runs Oracle VirtualBox */ var $username = 'administrator'; var $password = 'guesswhat'; var $location = 'http://ip.address.of.virtualbox.host:18083/'; /*don't change if using single machine for VirtualBox and phpVirtualBox*/
In Linux:
su vbox -c '/usr/bin/vboxwebsrv -b -logfile /dev/null -host ip.address.of.virtualbox.host -port 18083'
Change config.php
as for Windows.
kool
Owh! that is great!
mush try!
that’s Great….
without switching the monitor now i can start the VM gr8….
very useful article, thanks
yes very useful article
Woooooow Cool , Revolution of open source software… thx for sharing the article
Thanks! Harsh It is working for me !