How to install Virtualbox 4.2 on Clear OS 6.3 Server

ClearOS is a perfect server appliance built on top of CentOS Linux. It has many features such as active directory, LDAP server, file server, gateway and many more. On this tutorial, I will show you how to install Virtualbox 4.2 on ClearOS 6.3.

1. Add RPMForge repository to ClearOS

You can follow this guide to install or enable the RPMForge repository to ClearOS 6.3

 

2. Install Virtualbox.

Execute these commands as root.

yum groupinstall “Development Tools”
yum install SDL kernel-devel kernel-headers dkms

 

The commands above will install files needed by Virtualbox.

Now check if your system has the same kernel version that is currently running with the one inside /usr/src/kernels.

uname –r

[root@system ~]# uname -r
2.6.32-279.5.2.v6.i686

Now check if you have the same entry under /usr/src/kernels

cd /usr/src/kernels
ls

[root@system ~]# ls /usr/src/kernels
2.6.32-279.11.1.v6.i686  2.6.32-279.9.1.v6.i686


On the example above, there is no entry for the kernel version 2.6.32-279.5.2.v6.i686 on /usr/src/kernels. We need to create symlink to it. Execute this command under /usr/src/kernels

ln –s 2.6.32-279.11.1.v6.i686 `uname -r`

Add Virtualbox repository

cd /etc/yum.repos.d
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
yum
install VirtualBox-4.2

Dependencies Resolved
================================================================================
Package              Arch       Version                 Repository        Size
================================================================================
Installing:
VirtualBox-4.2       i686       4.2.4_81684_el6-1       virtualbox        64 M
Installing for dependencies:
libXmu               i686       1.0.5-1.el6             ol6_latest        58 k
Transaction Summary
================================================================================
Install       2 Package(s)
Total download size: 65 M
Installed size: 131 M

If you encounter virtualbox kernel module error, you may need to execute this command to fix it.

/etc/init.d/vboxdrv setup

3. Add admin user to vboxusers

/usr/sbin/usermod -G vboxusers admin

You can change admin with your own user.

 

4. Install Virtualbox Extension Pack

Download the latest extension pack from the Virtualbox website

wget http://download.virtualbox.org/virtualbox/4.2.4/Oracle_VM_VirtualBox_Extension_Pack-4.2.4-81684.vbox-extpack

Install it using command

VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.2.4-81684.vbox-extpack

That’s it. Now, Virtualbox is installed on your server. Now you can start create VM’s and boot them up. For list commands used to create, edit or start the VM, you can type

VBoxManage –help

or visit the howtoforge website: http://www.howtoforge.com/vboxheadless-running-virtual-machines-with-virtualbox-4.1-on-a-headless-centos-6.2-server

You can also manage Virtualbox via web interface by installing phpvirtualbox. Next post will explain how to do this,