How To Install VirtualBox 6.0 / 5.2 on CentOS 7 / RHEL 7

21

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 the 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 6.0 / 5.2 on CentOS 7 / RHEL 7 via yum repository.

Install VirtualBox 6.0 / 5.2 on CentOS 7 / RHEL 7

Update the system to the latest version.

yum update

Reboot the system.

reboot

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

Download the Oracle public key.

wget https://www.virtualbox.org/download/oracle_vbox.asc

Import 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 http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo

OR

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

[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc

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 VirtualBox Linux kernel module service.

systemctl status vboxdrv

Output:

 vboxdrv.service - VirtualBox Linux kernel module
   Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled; vendor preset: disabled)
   Active: active (exited) since Sun 2018-12-23 09:13:15 IST; 41min ago
  Process: 57159 ExecStart=/usr/lib/virtualbox/vboxdrv.sh start (code=exited, status=0/SUCCESS)
    Tasks: 0

Dec 23 09:13:15 server.itzgeek.local systemd[1]: Starting VirtualBox Linux kernel module...
Dec 23 09:13:15 server.itzgeek.local vboxdrv.sh[57159]: vboxdrv.sh: Starting VirtualBox services.
Dec 23 09:13:15 server.itzgeek.local systemd[1]: Started VirtualBox Linux kernel module.

Access VirtualBox

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

Install VirtualBox 6.0 on CentOS 7 - Start VirtualBox
Install VirtualBox 6.0 on CentOS 7 – Start VirtualBox

OR

virtualbox

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

VirtualBox 6.0 Running VMs on CentOS 7:

Install VirtualBox 6 on CentOS 7 - VirtualBox 6.0 running on CentOS 7
Install VirtualBox 6 on CentOS 7 – VirtualBox 6.0 running on CentOS 7

VirtualBox 5.2 Running VMs on CentOS 7:

Install VirtualBox 5.2 on CentOS 7 - VirtualBox 5.2 running on CentOS 7
Install VirtualBox 5.2 on CentOS 7 – VirtualBox 5.2 running on CentOS 7

Install Oracle VM VirtualBox Extension Pack

Oracle offers 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 to the Oracle VM VirtualBox base installation.

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 ###

wget https://download.virtualbox.org/virtualbox/6.0.0/Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack

### VirtualBox 5.2.22 ###

wge https://download.virtualbox.org/virtualbox/5.2.22/Oracle_VM_VirtualBox_Extension_Pack-5.2.22.vbox-extpack

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

Install VirtualBox 6.0 on CentOS 7 - Install VirtualBox Extension Pack
Install VirtualBox 6.0 on CentOS 7 – Install VirtualBox Extension Pack

Click on the Install button.

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

Further Reading

You might also like

How To Install VirtualBox 6.0 / 5.2 on CentOS 7 / RHEL 7

21