How To Install VirtualBox on Rocky Linux 8 / CentOS 8 / RHEL 8


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 Rocky Linux 8 / 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.

egrep -c '(vmx|svm)' /proc/cpuinfo

Output: (Must be nonzero)


Update System (Optional)

Update the system to the latest version.

dnf update -y

Install Development Tools

Install the kernel-header and other development tools.

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

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

dnf install -y wget

Reboot your system.


Install VirtualBox on Rocky Linux 8 / 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 Rocky Linux 8 / 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.1

dnf install -y VirtualBox-6.1

VirtualBox v5.x

dnf 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 Sat 2021-07-03 00:54:03 EDT; 1min 3s ago
  Process: 10758 ExecStart=/usr/lib/virtualbox/ start (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 23360)
   Memory: 0B
   CGroup: /system.slice/vboxdrv.service
Jul 03 00:54:02 rocky8.itzgeek.local systemd[1]: Starting VirtualBox Linux kernel module...
Jul 03 00:54:03 rocky8.itzgeek.local[10758]: Starting VirtualBox services.
Jul 03 00:54:03 rocky8.itzgeek.local systemd[1]: Started VirtualBox Linux kernel module.

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.1 Running Fedora Virtual Machine
VirtualBox 6.1 Running Fedora Virtual Machine

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.1 ###
cd /tmp
### VirtualBox 5.2.44 ###
cd /tmp

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 confirmation message below.

VirtualBox Extension Installed Successfully
VirtualBox Extension Installed Successfully


That’s All. You have learned how to install VirtualBox on Rocky Linux 8 / CentOS 8 / RHEL 8. Would you mind sharing your feedback in the comments section?

You might also like