How To Install VirtualBox on CentOS 8 / RHEL 8


Install VirtualBox on CentOS 8
Install VirtualBox on CentOS 8

server-spaces=”true”>VirtualBox is an open-source hypervisor software that helps us to create and run virtual machines of Linux, Windows, OS/2, Solaris, and other supported operating systems on top of the host operating system. 

VirtualBox can run on Linux, Windows, macOS, and Solaris. It is an alternative to proprietary hypervisor VMware workstation and Kernel Virtual Machine.

VirtualBox is released as free software under GPL v2, and its extension pack that contains drivers is released under PUEL which restricts commercial usage.

Here, we will see how to install VirtualBox on CentOS 8 / RHEL 8.



To run 64bit virtual machine’s operating systems, make sure your system processor supports hardware virtualization (VT) and is enabled in BIOS. Also, the host operating system must be 64bit as well.

Update System

Update the system to the latest version.

yum update -y

Install Development Tools

Install the kernel-header and other development tools.

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

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

yum -y install wget

Reboot your system.


Install VirtualBox on CentOS 8 / RHEL 8

Set up VirtualBox repository

Download the Oracle VirtualBox public key.


Import the downloaded Oracle public key to the system.

rpm --import oracle_vbox.asc

Download the VirtualBox repository file for CentOS 8 / RHEL 8 from official site and move it into /etc/yum.repos.d/ directory.

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


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

cat <<EOF >> /etc/yum.repos.d/virtualbox.repo
name=Oracle Linux / RHEL / CentOS - 8 x86_64 - 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


VirtualBox Linux Kernel Module Service Status
VirtualBox Linux Kernel Module Service Status

If the service is inactive, then you may need to start the service. 

systemctl start vboxdrv

Access VirtualBox

Goto Activities >> Search for 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 8
VirtualBox 6.0 Running VMs on CentOS 8
VirtualBox 5.2 Running VMs on CentOS 8
VirtualBox 5.2 Running VMs on CentOS 8

Install Oracle VM VirtualBox Extension Pack

Oracle offers an extension pack to add additional functionalities to VirtualBox like 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.

NOTE: Install the same version extension pack as your VirtualBox version.

Download the VirtualBox extension pack using the wget command.

### VirtualBox 6.0 ### cd /tmp wget ### VirtualBox 5.2.22 ### cd /tmp wget

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

Locate VirtualBox Extension Pack
Locate VirtualBox Extension Pack

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

Install VirtualBox Extension
Install VirtualBox Extension

Scroll down the license page to agree to the VirtualBox license.

Agree to VirtualBox License
Agree to VirtualBox License

Upon successful installation, you would see below confirmation message.

VirtualBox Extension Installed Successfully
VirtualBox Extension Installed Successfully


That’s All. You have learned how to install VirtualBox on CentOS 8 / RHEL 8. Please share your feedback in the comments section.