How to Install VirtualBox on CentOS 7

It is Important to have virtualization software on CentOS 7 for Testing and development purposes , especially if you are a system administrator who trying to test other operating systems or if you are students who wants get your hands on multiple operating systems. We can use Oracle VM VirtualBox to run other operating systems top of the CentOS 7 desktop.

For those of you new to virtualization, It is simply allowing us to create virtual computers inside our current operating system.  For example, using a virtualization software like oracle VM VirtualBox, we can run Microsoft Windows 7 inside CentOS7 computer.

How to Install VirtualBox on CentOS 7

The purpose of this tutorial is to learn how to install oracle VM VirtualBox on CentOS 7 desktop. So do the following steps to install VirtualBox on CentOS 7 using yum command.

Step One

Install kernel headers, devel and gcc Compiler

We need need to add following three packages kernel-devel, kernel-headers and gcc before we start to install Oracle VM VirtualBox on CentOS 7. Open the terminal and execute the following command as a privileged user.

sudo yum install kernel-devel kernel-headers gcc

Step Two

Download VirtualBox for CentOS 7

Go to Following URL and  Download the installation package which is marked for “Oracle Linux 7 ("OL7") / Red Hat Enterprise Linux 7 ("RHEL7") / CentOS 7” as below screenshot shows.

Download VirtualBox for CentOS 7

The package is a .rpm file. Click on the link to save the file to your computer.

Step Three

Install VirtualBox on CentOS 7 Using yum command

Now we will install the rpm file we downloaded, using yum command.

sudo yum install VirtualBox-5.0-5.0.12_104815_el7-1.x86_64.rpm

Once the installation is finished, you can find the shortcut to open VirtualBox in the Application menu under the system tools.

Application menu > system tools

Now we need to do some additional configuration before we start to use VirtualBox on CentOS 7. That is including, installing extension pack and user configuration. So let's continue our tutorial.

Install Extension Pack

We need to Install Oracle VM Virtualbox extension pack for CentOS 7. Extension pack provides additional features like USB support, which enables you to connect to the USB port of a host computer from guest operating systems.

Oracle VM Virtualbox extension pack

Installing Oracle Virtualbox extension pack on CentOS 7 is very straightforward. Go to download page and Download the Pack which is marked for All supported platforms. Once the file is downloaded, just Double click on the downloaded file to install the extension pack.

Add yourself to the vboxusers group

To access some Features, You need to be a member of  vboxusers group. group was created during the installation. You can use usermod command to add your username to the  vboxusers group.

sudo usermod -a -G vboxusers yourusername

And now you should able to attach usb devices to the VM’s.

VirtualBox is a good Virtualization Softwares, but most of the time use for testing and learning purposes. If you want to run Virtual Machines for production environment it recommend to use KVM hypervisor for CentOS 7, Which is a excellent and powerful free enterprise level hypervisor.