Phpvirtualbox is the web GUI to manage the headless Virtualbox installed on ClearOS 6.3. Read our previous tutorial on how to install virtualbox 4.2 on ClearOS 6.3 server. phpvirtualbox enable us to create, edit, delete or view the guest host console via web browser. It’s a pretty cool to view virtualbox on a web browser.
This tutorial is going to show you how to install and configure phpvirtualbox on ClearOS 6.3 server. I assume you have installed the latest Virtualbox 4.2 on ClearOS 6.3.
Login as root.
su
Add new vbox user and add to vboxusers group and create password for this vbox user.
useradd -m vbox -G vboxusers
passwd vbox
Create file /etc/default/virtualbox and fill this file with VBOXWEB_USER=vbox.
[...] /* Username / Password for system user that runs VirtualBox */ var $username = 'vbox'; var $password = 'secret'; [...]nano /etc/default/virtualbox
and enter this line into it.
VBOXWEB_USER=vbox
Next add entry to the system so it will load vboxweb-service to be loaded on system startup
chkconfig --levels 235 vboxweb-service on
/etc/init.d/vboxweb-service restart
Now install Apache web server and PHP
yum install httpd php php-mysql php-pear apr apr-util-sqlite apr-util-ldap apr-util wget
Configure system to start the web server upon boot
chkconfig --levels 235 httpd on
Start Apache
/etc/init.d/httpd start
Now download and configure the phpvirtualbox
cd /var/www/html
wget http://phpvirtualbox.googlecode.com/files/phpvirtualbox-4.2-3b.zip
Since the phpvirtualbox version changed over time, you can check the latest one here: http://code.google.com/p/phpvirtualbox/downloads/list
unzip phpvirtualbox-4.2-3b.zip
mv phpvirtualbox-4.2-3b phpvirtualbox
cd phpvirtualbox
cp config.php-example config.php
Now open config.php and change the password with the vbox user password we’ve created earlier.
nano config.php
[...]
/* Username / Password for system user that runs VirtualBox */
var $username = 'vbox';
var $password = 'secret';
[...]
Now we can start using phpvirtualbox. Open web browser and type this address (change the ip address with your own server.
http://192.168.1.100/phpvitrtualbox
Use username: admin and password admin to log in. Now we can start managing the Virtualbox on ClearOS 6.3 Server.