Install VirtualBox on RHEL/CentOS and Fedora

VirtualBox is an open source cross-platform virtualization software, it can be installed on any operating system and enable you to install and run multiple guest operating systems on same computer. For example, if you install it on your Linux system, you can run Windows XP operating system under it as a Guest OS or run Linux OS on your Windows system and so on. This way, you can install and run as many as guest operating systems as you like, the only limit is disk space and memory.

You can see the complete new change log details about VirtualBox 4.2.10 on their Official Changelog Page.

Adding VirtualBox Repository

We use VirtualBox own repository to install latest VirtualBox 4.2.10 on following systems.

For RHEL/CentOS 6.4-5.9
## RHEL 6.4/6.3/6.2/6.1/6.0/5.9/5.8/5.6 and CentOS 6.4/6.3/6.2/6.1/6.0/5.9/5.8/5.6 ##
# cd /etc/yum.repos.d/
# wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
For RHEL/CentOS 5
## RHEL 5 and CentOS 5 ##
# wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh epel-release-5-4.noarch.rpm
For Fedora 18,17,16,15,14,13,12
## Fedora 18,17,16,15,14,13,12 ##
# cd /etc/yum.repos.d/
# wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo

Install Dependency Packages for VirtualBox

VirtualBox uses vboxdrv kernel module to control and allocate physical memory for execution of guest operating systems. Without this module, you can still use the VirtualBox to create and configure virtual machines, but they will not work. So, to make VirtualBox fully functional you will need to update your system first, then install some additional modules like DKMSkernel-headers and kernel-devel and some dependency packages.

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

Install VirtualBox 4.2.10

Once you’ve installed all the needed dependency packages, you can install latest version ofVirtualBox using following command.

# yum install VirtualBox-4.2

Rebuild Kernel Modules for VirtualBox 4.2.10

The below command will automatically create vboxusers group and user and also search and automatically rebuild required kernel modules. If the below build process fails, you will get a warning messages. Please have a look at /var/log/vbox-install.log to trace why the build process failed.

# /etc/init.d/vboxdrv setup
# service vboxdrv setup

Start VirtualBox

Simply execute following command to start it from the terminal or use launcher from menu to start.

# VirtualBox
VirtualBox Screenshots
VirtualBox 4.2.10
VirtualBox 4.2.10


If you get any error message like KERN_DIR or if your kernel source directory not detected automatically by build process, you can set it by using following command. Make sure you change kernel version according to your system as shown in red color.

## RHEL / CentOS / Fedora ##

## Export KERN_DIR ##
export KERN_DIR

Update VirtualBox

If you want to update the VirtualBox with latest version in the future, you can simply run the yum update command to update it.

# yum update VirtualBox-4.2

Remove VirtualBox

If in case you want to remove VirtualBox completely, just use the following command to remove it completely from your system.

# cd /etc/yum.repos.d/
# rm -rf virtualbox.repo
# yum remove VirtualBox-4.2

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button