How to Install VirtualBox on RHEL 9 Step-by-Step

In this post, we will cover how to install VirtulaBox on RHEL 9 step-by-step.

As we know that VirtualBox is a free cross-platform virtualization tool for x86 and Intel64/AMD64 hardware. Using VirtualBox, we can run multiple operating systems simultaneously and help users to setup their test environment on their desktop or laptops. It is generally used as desktop level and provides a graphical user interface for managing virtual machines.

Basic terminology used for VirtualBox

  • Host OS: It is the operating of your physical system on which VirtualBox is installed.
  • Guest OS: It is the operating system which is running inside the virtual machine.
  • VM (Virtual Machine): It is a virtual environment created by virtualbox for running the OS.
  • Guest Additions: These are special software designed to install inside the VM to improve guest OS performance.

Prerequisites

  • Pre-Installed RHEL 9 with desktop environment
  • Sudo User with admin privileges
  • Red Hat Subscription or locally configure Yum Repo
  • Internet Connectivity

Without any delay, let’s deep dive into VirtualBox Installation Steps on RHEL 9

1) Enable VirtualBox and EPEL Repository

Login to your RHELL 9 system and open the terminal and run following dnf command to enable official virtualbox package repository.

$ sudo dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo

Import VirtualBox public key, run

$ sudo rpm --import https://www.virtualbox.org/download/oracle_vbox.asc

Run following to enable EPEL repository

$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y

2) Install VirtualBox Dependencies

Install following virtualbox dependencies with the help of beneath dnf command,

$ sudo dnf install binutils kernel-devel kernel-headers libgomp make patch gcc glibc-headers glibc-devel dkms -y

Once all the dependencies are installed successfully then reboot the system once with beneath command,

$ sudo reboot

3) Install VirtualBox 7 / 6

Before start installing the virtualbox, first verify what exact version of VirtualBox is available in the repository, run

$ sudo dnf search virtualbox

dnf-search-virtualbox-rhel9

As we can see we have VirtualBox-7.0 and 6.1 available in repository, so to install virtualbox 7, run beneath command.

$ sudo dnf install VirtualBox-7.0 -y

Output,

dnf-install-virtualbox7-rhel9

In case, you are interested to install virtualbox 6.1, then run

$ sudo dnf install VirtualBox-6.1 -y

Once VirtualBox is installed, add your local user to vboxuser group so that it can perform all the operations on virtualbox,

$ sudo usermod -aG vboxusers $USER
$ newgrp vboxusers

4) Launch VirtualBox GUI

Search virtualbox from Activity menu and click on its icon

Launch-VirtualBox7-RHEL9

We will get following VirtualBox GUI when we click on its icon,

VirtualBox7-GUI-RHEL9

Above screen confirms that VirtualBox-7.0 is installed successfully.

To add following additional functionality to the VirtualBox, you must install extension pack.

  • USB 2.0/3.0 support
  • Virtual RDP
  • Disk Encryption
  • Pxe Boot

5) Install VirtualBox Extension Pack

Use following wget command to download extension pack file.

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

Once it is downloaded, first build the kernel module and run following VBoxManage command to install

$ sudo /sbin/vboxconfig
$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.2.vbox-extpack

Press ‘y’ to accept license terms and conditions,

Accept-License-Terms-Conditions-VirtualBox-Extension-Pack

To verify VirtualBox Extension Pack Installation,

Head to VirtualBox GUI, File –> Tools –> Extension-Pack-Manager

Verify-VirtualBox-Extension-Pack-RHEL9

Perfect, above confirms that extension packages are installed successfully.

That’s all from this post, I hope you have found this post useful and able to install virtualbox on your RHEL 9 system.

Leave a Comment

Your email address will not be published. Required fields are marked *