How to Install VirtualBox on CentOS 7

Install VirtualBox on CentOS 7

In this article, we will have explained the necessary steps to install and configure VirtualBox on CentOS 7. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

VirtualBox is an open-source hypervisor software that helps you create and run multiple guest operating systems (“virtual machines”) on a single hardware machine. Oracle VM VirtualBox lets you create one or more VMs on a single physical server. Virtual Machines are computers that use the hardware components of the host computer, each running its own operating system. VB supports the installation of MS Windows, Linux, BDS, and MS-DOS on the installed VMs.

Install VirtualBox on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo yum install epel-release
sudo yum update

Step 2. Install VirtualBox.

First, Install packages which are required for installation of VirtualBox:

sudo yum install kernel-devel kernel-headers make patch gcc

Next, download the Oracle Linux repo file to /etc/yum.repos.d directory:

sudo wget -P /etc/yum.repos.d

Now install VirtualBox typing following command:

sudo yum install VirtualBox-5.2

Verify that your VirtualBox installation was successful, run the following command:

systemctl status vboxdrv

Step 3. Install VirtualBox extension on CentOS.

Before downloading the extension pack using the command below you should check the VirtualBox download page to see if a newer version is available:


Then, import the extension pack using the following command:

sudo VBoxManage extpack install  Oracle_VM_VirtualBox_Extension_Pack-5.2.20.vbox-extpack

Step 4. Starting VirtualBox.

Now that VirtualBox is installed on your CentOS system you can start it either from the command line by typing virtualbox or by clicking on the VirtualBox icon (Applications -> System Tools -> Oracle VM VirtualBox.).

Congratulation, you have learned how to install and configure VirtualBox on CentOS 7. If you have any question, please leave a comment below.