Install VirtualBox 5 on CentOS 7 / RHEL 7


Using VirtualBox, you can create and run guest operating systems (“virtual machines”) such as Linux and Windows under a host operating system. There are two ways of installing VirtualBox; from pre-compiled binaries and the sources code. This tutorial shows you how to set up VirtualBox 5.1 from the pre-compiled binaries.

From the version 2.0 VirtualBox supports 32 and 64bit host and guest operating systems (if you want to install 64bit guests your processor must support hardware virtualization and, of course, the host operating system must be 64bit as well).

This tutorial shows how to install VirtualBox 5.1 on CentOS 7 / RHEL 7 via yum repository.

Step 1: Please setup EPEL repository for RHEL 7 / CentOS 7.

rpm -Uvh

Step 2: Install header and development tools.

yum install kernel-devel kernel-headers dkms 
yum groupinstall "Development Tools"
yum update

Step 3: Download Oracle public key.


Step 4: Import Oracle public key.

rpm --import oracle_vbox.asc

Step 5: Download VirtualBox repo file for CentOS 7 / RHEL 7 and move it into /etc/yum.repos.d directory.

 wget -O /etc/yum.repos.d/virtualbox.repo


Create /etc/yum.repos.d/virtualbox.repo file and use the following repo information.

name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox

Step 6: Install VirtualBox v5.2.

yum install VirtualBox-5.2

Step 7: Rebuild the kernel.

service vboxdrv setup

Step 7: Add your user name in to vboxuser group.

usermod -a -G vboxusers raj

Step 8: Start VirtualBox using following command.


Now you can start adding VM’s on VirtualBox.

Install VirtualBox 5 on CentOS 7
Install VirtualBox 5 on CentOS 7

That’s All!. You have successfully installed VirtualBox on CentOS 7.

Further Reading

You might also like