How To Install VirtualBox on CentOS 7 / RHEL 7


VirtualBox is an open-source hypervisor software that helps you create and run multiple guest operating systems (“virtual machines”) on a single hardware machine. VirtualBox can be installed on host operating systems, including Linux, Windows, Solaris, OS X, and OpenSolaris.

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

VirtualBox is released under GPL v2 and Oracle VM VirtualBox extension pack is released under PUEL (Personal Use and Evaluation License).

From VirtualBox 5.1, installers no longer rely on DKMS for module rebuilding.

This tutorial shows how to install VirtualBox on CentOS 7 / RHEL 7.



Update System

Update the system to the latest version.

yum update -y

Install Development Tools

Once the system is up, install header and development tools.

yum install -y kernel-devel kernel-headers gcc make perl

Also, install the wget package to download items using the terminal.

yum -y install wget

Reboot the system.


Install VirtualBox on CentOS 7 / RHEL 7

Set up VirtualBox repository

Download the Oracle public key.


Import the Oracle public key.

rpm --import oracle_vbox.asc

Download the VirtualBox repository file for CentOS 7 / RHEL 7 and move it into /etc/yum.repos.d/ directory.

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


Create the /etc/yum.repos.d/virtualbox.repo file with the following repository information.

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

Install VirtualBox

Install VirtualBox using the yum command.

VirtualBox v6.0

yum install -y VirtualBox-6.0

VirtualBox v5.2

yum install -y VirtualBox-5.2

Run the below command to check the status of the VirtualBox Linux kernel module service.

systemctl status vboxdrv


 vboxdrv.service - VirtualBox Linux kernel module
   Loaded: loaded (/usr/lib/virtualbox/; enabled; vendor preset: disabled)
   Active: active (exited) since Wed 2019-11-20 02:46:52 EST; 29s ago
  Process: 6389 ExecStart=/usr/lib/virtualbox/ start (code=exited, status=0/SUCCESS)
    Tasks: 0

Nov 20 02:46:52 centos7.itzgeek.local systemd[1]: Starting VirtualBox Linux k...
Nov 20 02:46:52 centos7.itzgeek.local[6389]: Starting ...
Nov 20 02:46:52 centos7.itzgeek.local systemd[1]: Started VirtualBox Linux ke...
Hint: Some lines were ellipsized, use -l to show in full.

Access VirtualBox

Start VirtualBox: Application >> System Tools >> Oracle VM VirtualBox.

Start VirtualBox
Start VirtualBox



What are you waiting for? just go and create virtual machines.

VirtualBox 6.0 Running VMs on CentOS 7
VirtualBox 6.0 Running VMs on CentOS 7
VirtualBox 5.2 Running VMs on CentOS 7
VirtualBox 5.2 Running VMs on CentOS 7

Install Oracle VM VirtualBox Extension Pack

Oracle offers an extension pack to add additional functionalities such as USB 2.0/3.0, VirtualBox Remote Desktop Protocol (VRDP) support, Disk encryption, Host webcam passthrough, Intel PXE boot ROM, and PCI passthrough.

Please install the same version extension pack as your installed version of VirtualBox.

Download the Oracle VM VirtualBox extension pack using the wget command.

### VirtualBox 6.0 ###

cd /tmp


### VirtualBox 5.2.22 ###

cd /tmp


To install the extension pack, go to VirtualBox >> Preference >> Extensions >> browse for extension pack (/tmp) by clicking on the + icon.

Install VirtualBox Extension Pack
Install VirtualBox Extension Pack

Click on the Install button to install the VirtualBox extension pack.

Accept the VirtualBox license to start the installation.


That’s All. You have successfully installed VirtualBox on CentOS 7 / RHEL 7. Please share your feedback in the comments section.

You might also like