Easy Steps To Install VirtualBox on Rocky Linux 8 – OrcaCore
In this guide, we aim to provide you with a comprehensive walkthrough on how to Install VirtualBox on Rocky Linux 8. Oracle VM VirtualBox is a powerful, free, and open-source, cross-platform virtualization solution. It allows you to create, manage, and run virtual machines (VMs) on your existing operating system. In essence, virtual machines are software-defined computers where the hardware components are emulated by the host computer.
Oracle VirtualBox empowers you to set up one or more virtual machines (VMs) on a single physical machine and use them simultaneously, along with the actual machine. Each virtual machine can execute its own operating system, including Microsoft Windows, Linux, BSD, and MS-DOS versions. You can install and run as many virtual machines as you like – the only practical limits are disk space and memory. This makes VirtualBox an invaluable tool for testing different operating systems, running legacy applications, and creating isolated development environments. This article will show you how to Install VirtualBox on Rocky Linux 8 so that you can take advantage of these features.
Now, let’s proceed with the steps required to set up VirtualBox on your Rocky Linux 8 system.
Before you begin to Install VirtualBox on Rocky Linux 8, ensure you have the necessary prerequisites in place.
To install VirtualBox, you must log in to your server as a non-root user with sudo privileges. To achieve this, you can refer to our guide on the Initial Server Setup with Rocky Linux 8.
Also, to run 64-bit virtual machine’s operating systems, ensure that your system processor supports hardware virtualization (VT) and that it is enabled in the BIOS. The host operating system must also be 64-bit. You can verify this by running the following command:
egrep -c '(vmx|svm)' /proc/cpuinfo
The output should be a non-zero result. This indicates that your CPU supports virtualization.
1. Install VirtualBox on Rocky Linux 8
By default, VirtualBox packages aren’t available in the standard Rocky Linux repository. Therefore, you’ll need to manually add the VirtualBox repository to your server. Use the following command to achieve this:
sudo dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo

Next, update your local package index to include the newly added repository. Run the following command:
sudo dnf update -y

List Available Versions of VirtualBox
At this point, you can list available versions of VirtualBox on Rocky Linux 8 by running the command below:
sudo dnf search virtualbox

As you can see the latest available version of VirtualBox is 7.0. To install it on your server, run the command below:
sudo dnf install VirtualBox-7.0 -y
2. Install VirtualBox Extension Pack
Now that VirtualBox is installed, you can add the VirtualBox Extension Pack to enable support for various VirtualBox functionalities, such as USB 2.0 and 3.0 support, VirtualBox RDP, disk encryption, NVMe, and PXE boot for Intel cards.
To do this, visit the VirtualBox Downloads page, scroll down, and find the Extension pack.

Click on All Supported Platforms to download it.
Then, from your command terminal, switch to your downloads directory:
cd Downloads
Finally, use the VBoxManage tool for the installation of the Extension Pack:
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-*.vbox-extpack
Accept the License when prompted.
3. Launch Oracle VM VirtualBox
At this point, you can start your VirtualBox application on Rocky Linux 8. To do this, go to Activities, click on “show Applications” and then click the icon of this open-source virtualization platform.
Also, you can launch VirtualBox from the command line. Simply type the following command:
virtualbox
That’s it. You are done.
Conclusion
At this point, you learned how to Install Oracle VM VirtualBox on Rocky Linux 8. VirtualBox enables you to create and manage virtual machines (VMs) on your computer and allows you to run different operating systems in isolated environments.
Hope you enjoy it. You may also like these articles:
Set up OpenCV on Rocky Linux 8
Install and Configure Nagios on Rocky Linux 8
Automatic Updates with dnf-automatic on RHEL 8
WordPress Setup Rocky Linux 8
Secure Apache with Lets Encrypt on Rocky Linux 8
Plesk installation Rocky Linux 8
Alternative Solutions for Virtualization on Rocky Linux 8
While VirtualBox is a solid choice, other virtualization solutions are available for Rocky Linux 8. Let’s explore two alternatives: KVM and VMware Workstation Player.
1. KVM (Kernel-based Virtual Machine)
KVM is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It turns the Linux kernel into a hypervisor. KVM is already part of the Linux kernel, making it a very efficient and resource-friendly option.
Explanation:
KVM leverages the existing Linux kernel infrastructure, which means it’s tightly integrated with the operating system. This close integration results in excellent performance and stability. KVM also benefits from the robust security features of the Linux kernel. To manage KVM, you typically use tools like virt-manager
(a graphical interface) or virsh
(a command-line tool).
Installation and Usage:
-
Install KVM and related tools:
sudo dnf install -y @virtualization-tools libvirt virt-install qemu-kvm
-
Start and enable the
libvirtd
service (the virtualization daemon):sudo systemctl enable --now libvirtd
-
Verify the installation:
lsmod | grep kvm
This should show
kvm_intel
orkvm_amd
loaded, depending on your processor. -
Using
virt-install
to create a VM (example):sudo virt-install --name=myvm --memory=2048 --vcpus=2 --os-variant=rocky8 --location='https://download.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os/' --disk size=20,format=qcow2,bus=virtio
This command creates a VM named
myvm
with 2GB of memory, 2 virtual CPUs, Rocky Linux 8 as the operating system, and a 20GB virtual disk.
Pros:
- Excellent performance due to kernel-level integration.
- Open source and free.
- Robust security.
Cons:
- Can be more complex to set up than VirtualBox, especially from the command line.
- Requires more technical knowledge.
2. VMware Workstation Player
VMware Workstation Player is a free (for non-commercial use) desktop virtualization application. It allows you to run virtual machines on Windows or Linux. While the Player version has some limitations compared to the paid Workstation Pro, it’s still a capable solution for basic virtualization needs.
Explanation:
VMware Workstation Player provides a user-friendly graphical interface for managing virtual machines. It offers good performance and compatibility with a wide range of operating systems. While the free version has some restrictions (e.g., you can’t run multiple VMs simultaneously), it’s a good option for individual users who need a simple and intuitive virtualization solution.
Installation and Usage:
-
Download VMware Workstation Player:
Go to the VMware website and download the Workstation Player bundle for Linux.
-
Make the bundle executable:
chmod +x VMware-Workstation-Player-*.bundle
-
Run the installer:
sudo ./VMware-Workstation-Player-*.bundle
Follow the on-screen instructions to complete the installation. You may need to install additional kernel headers for your running kernel before the install will work.
-
Launch VMware Workstation Player:
You can find it in your applications menu.
-
Create a new virtual machine using the GUI. The GUI will walk you through the creation of a new virtual machine.
Pros:
- User-friendly graphical interface.
- Good performance.
- Wide operating system compatibility.
Cons:
- The free version has limitations compared to the paid version.
- Closed source.
- Potentially more resource-intensive than KVM.
In conclusion, while this article focuses on how to Install VirtualBox on Rocky Linux 8, KVM and VMware Workstation Player offer viable alternatives depending on your specific requirements and preferences. KVM provides excellent performance and security due to its kernel integration, while VMware Workstation Player offers a user-friendly interface and broad compatibility. When deciding which virtualization solution to use, consider factors such as ease of use, performance needs, security requirements, and budget.