How to Install VirtualBox & phpVirtualBox on Centos / Redhat

VirtualBox is virtualization product which can run on a variety of operating systems, virtualbox is a product similar to other virtualization platform software tools like VMware , XEN , KVM & Hypervisor.

VirtualBox, this support various of a guest OS system which includes windows XP, Windows 7, Windows 2008, Linux, Centos & Solaris. VirtualBox is freely available as Open Source Virtualization software tool developed by Sun Microsystems. Distributed under either the GNU GPL.

VirtualBox also supports web based management console using (phpVirtualBox) , You can access virtual box web based management console using URL “http://IP/Virtualbox”  in order to create VM’s,  Edit VM’s, settings, VM clone,  Snapshot “snapshot can be taken before /after any update takes place in the selected Virtual Machine like installing tools or modify configuration settings” .

Note :- VM Clone, if you have installed a Virtual Machine by installing standard tools and made necessary configuration as per the requirements. You can perform cloning in order to replicate the Vm inage which can be used for similar requirment.

Dependencies :

Binutils gt gcc make patch libgomp glibc-headore glibc-devel kernel-headers kernel-devel dkms php php-devel httpd httpd-devel unzip php-soap zip..

In our installation guide we are going to install virtualbox and phpvirtualbox for web based management console.

VirtualBox and phpVirtualBox installations and configuration guide has prepaared for following platform and services.

Operating System         :  CentOS release 6.5 (server)  64bit

VirtualBox               :   VirtualBox-4.2-4.2.12_84980_el6-1.x86_64

phpVirtualBox            :   phpvirtualbox-4.2-6

IP Address               :   192.168.1.42

Steps :

Step 1  :  Install Dependency software packages.

Step 2  :  Download, install and configure VirtualBox.

Step 3  :  Install and configure phpvirtualbox.

Step 4  :  Access phpvirtualbox web based console.

Let us see the steps in Details :

Step 1 : Install Dependency software packages.

1.1  Install virtualbox and SDL.

#yum install binutils qt gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms php php-devel httpd httpd-devel

#cd  /etc/yum.repos.d/

#wget  http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

#yum install SDL

1.2  Reboot linux server by executing below command , kernel changes to take effect.

#cd

#reboot        //after completion login again as root user

Step 2 :  Download , install and configure virtualbox.

Following is the download location.

http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2-4.2-12 84980 e16-1.x86 64.rpm

2.1  You can download virtualbox software package (RPM) suitable to your requirement.

In our guide we are downloading 4.2.12 from below command.

#cd /opt/

#wget  http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2-4.2-12 84980 e16-1.x86 64.rpm

Install  VirtualBox rpm package using below command.

#rpm –ivh  VirtualBox-4.2-4.2-12_84980_e16-1.x86_64.rpm

Note :- If you got error like “error: Failed dependencies: libXmu.so.6()(64bit) is needed by VirtualBox-4.2-4.2.12_84980_el6-1.x86_64″ then use following command to install the dependency package

#yum install libX*

2.3  Rebuild kernel module.

Building kernel module for virtualbox is required to get all modules loaded. Below command shall create the vboxusers group. In order to trace build fails, you can look at the log /var/log/vbox-install.log.

If you encounter kernel related error

Export KERN_DIR=/usr/src/kernels/2.6.32-431.5.1.e16.x86_64/

Uninstall and install it back

#service vboxdrv setup

2.4  Set  vboxdrv service on in the default pool level.

#chkconfig vboxdrv on

2.5  Check the service status.

#service vboxdrv status

Step 3 : Install and configure phpvirtualbox.

3.1  Start httpd service and set it on at default bool level

#service httpd start

#chkconfig httpd on

3.2  Disable selinux.

#vi /etc/selinux/config

#reboot

3.3  Go to /var/www/html/  folder structure , /var/www/html  is the default location for apache docs

#cd  /var/www/html

3.4  Download phpvirtualbox source code from following location.

http://phpvirtualbox.googlecode.com/files/phpvirtualbox-4.2-6.zip

#wget   http://phpvirtualbox.googlecode.com/files/phpvirtualbox-4.2-6.zip

Extract the .zip source package.

#unzip  phpvirtualbox-4.2-6.zip

3.5  Rename phpVirtualBox-4.2-6 to virtualbox.

#mv  phpvirtualbox-4.2-6  virtualbox

Change the owner and group.

#chown  -R  apache:apache  /var/www/html/virtualbox

3.6 Rename the sample configuration files located in  /var/www/html/virtualbox/config.php-example.

Copy / rename config.php-example to config.php

#cp  -rp  /var/www/html/virtualbox/config.php-example   /var/www/html/virtualbox/config.php

3.7  VirtualBox user authentication .

Create following user account in linux box map the user to a group.

#useradd admin

#passwd admin

#usermod  -G  vboxusers admin

#VBoxManage  setproperty websrvauthlibrary null

3.8  Run vboxwebsrv service , which listens on  “18083” and option –b for start the service in background.

#vboxwebsrv –b

“-b is to run daemon in background “

Step 4 :  Access phpvirtualbox web based console.

Invoke below url from browser.

http://192.168.1.42/virtualbox

user : admin

pass : admin  (default)

Note :- If got exception message box like “PHP does not have the SOAP extension enabled.” then install the  php-soap package that is

#yum install php-soap

Thank You

For more Detail you can watch video and subscribe for more Videos :    

Both comments and pings are currently closed.

Comments are closed.

Copyright ©Solutions@Experts.com
Copyright © NewWpThemes Techmark Solutions - www.techmarksolutions.co.uk