How To Install VirtualBox on Centos / RHEL

0
373

Overview:

VirtualBox is an x86 virtualization software package, created by software company Innotek GmbH, purchased in 2008 by Sun Microsystems, and now developed by Oracle Corporation as part of its family of virtualization products. Oracle VM VirtualBox is installed on an existing host operating system as an application; this host application allows additional guest operating systems, each known as a Guest OS, to be loaded and run, each with its own virtual environment.

Installation Steps :

Step:1 Download the Virtualbox repository
[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

 

Step:2 Set the EPEL repository according to Centos/RHEL Version

In case of Centos 5 / RHEL 5

[root@localhost yum.repos.d]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

 

In case of Centos 6/ RHEL 6

[root@localhost yum.repos.d]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

 

Step:3 Install all dependencies of virtual box
[root@localhost yum.repos.d]# yum install binutils gcc make patch libgomp glibc- headers glibc-devel kernel-headers kernel-devel dkms

 

Step:4 Now Install Latest version of VirtualBox
[root@localhost yum.repos.d]# yum install VirtualBox-4.2

 

Step:5 Build the Kernel Module for Virtual-Box , using below command
#/etc/init.d/vboxdrv setup

If getting an error “Recompiling VirtualBox kernel modules [FAILED]”

OR

virtuabox-error

Solution : check the Kernel Version , using below command

[root@localhost ~]# uname -r
2.6.32-220.el6.x86_64

set the Below Variable , replace the kernel version of yours

KERN_DIR=/usr/src/kernels/2.6.32-220.el6.x86_64
export KERN_DIR

Reboot the Machine

Note: In My Case, I have Installed the latest Version of Kernel and boot the Linux with new kernel , then above mentioned problem resolved.

Step:6 Start the VirtualBox

Open the Terminal , type virtualbox  , below windows will appear on the screen

OR

Go To Applications —> System Tools —-> Oracle VM Virtual Box

virtuabox

SHARE

LEAVE A REPLY