I settle with VirtualBox and installed version 4.1 from Oracle repository
Installation procedure:
- Make sure we have the dependencies installed which is kernel-devel, gcc and make
# yum install kernel-devel gcc make - Create virtualbox repo in /etc/yum.repos.d/
# vi /etc/yum.repos.d/virtualbox.repo
[virtualbox]name=RHEL/CentOS/ScientificLinux-$releasever / $basearch - VirtualBox baseurl=http://download.virtualbox.org/virtualbox/rpm/rhel/6Server/$basearchenabled=1gpgcheck=1gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc - Notice that we have hardcoded the path of baseurl to 6Server, because i can not find 6.1 branch yet from http://download.virtualbox.org/virtualbox/rpm/rhel. In case this situation changes in the future we can use the stock virtualbox.repo from Oracle
- Install VirtualBox # yum install VirtualBox-4.1
- Installation will take a couple of minutes, because during installation a new kernel module will be compiled from source. Any error can be examined from /var/log/virtualbox.log. VirtualBox also depends on quite some packages amounting to 96M download
I planned to do vboxheadless, so i do not install any X Window or Desktop package, since this is a testing machine i do not want to play with firewall headache so turn off firewall and SELinux. I'll cover the firewall rules later :).
# vi /etc/selinux/config
SELINUX=permissive
# system-config-firewall-tui
Turn off Firewall
To control this machine, we will install phpVirtualBox
SELINUX=permissive
# system-config-firewall-tui
Turn off Firewall
To control this machine, we will install phpVirtualBox
- Create /etc/default/virtualbox
# vi /etc/default/virtualbox
VBOXWEB_USER=vbox
VBOXWEB_HOST=<ip>
VBOXWEB_PORT=18083
VBOXWEB_LOGFILE=/var/log/virtualbox/vboxweb
INSTALL_DIR=/usr/lib/virtualbox - Create user vbox with primary group vboxusers (created during VirtualBox installation)
# useradd vbox -g vboxusers
# passwd vbox - Create log directory
# mkdir /var/log/virtualbox
# chgrp vboxusers /var/log/virtualbox
# chmod g+rwx /var/log/virtualbox - Activate vboxweb-service
# service vboxweb-service start
# chkconfig vboxweb-service on - Download the latest phpVirtualBox from http://code.google.com/p/phpvirtualbox/downloads/list
- Install php-soap (phpVirtualBox requirement)
# yum install php-soap - Extract the latest phpVirtualBox to /var/www/html/phpVirtualBox
- Edit config.php, with the most important settings
var $username = vbox
var $password = <the password that is set before>
var $location = http://<vbox_server_ip>:18083/ - Point your browser to http://<vbox_server_ip>/phpVirtualBox
- Login with username admin, password admin. Change the password immediately
- Voila! We are ready to virtualize
To install OS to the VMs, we will need to install VirtualBox Extpack, so we can have Remote Display
- Download the corresponding extension pack from virtualbox website. As of this article, it is Oracle_VM_VirtualBox_Extension_Pack-4.1.8-75467.vbox-extpack
- Install
# vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.8-75467.vbox-extpack - In the VM definition, activate Remote Display and give Video Memory at least 4 MB (otherwise your virtual OS will crashed with GuestAddition). We can use any high numbered ports as long the ports are not locked by other process.
- Since VirtualBox OSE do not include absolute pointing device, mouse movement will be difficult during OS installation, but after your VM OS installed, the GuestAddition will correct that