In this article, you will learn how to install VirtualBox on CentOS 8 server. However, the same method can be used to install previous versions of Oracle VirtualBox. #centlinux #linux #virtualbox
Table of Contents
What is VirtualBox?
Oracle VirtualBox is free and open source virtualization software for enterprises as well as home users. VirtualBox is distributed under the GNU GPL v2 license by Oracle Corporation. It can be installed on Windows, Mac, Linux, Solaris, FreeBSD, etc.
Nonetheless, Oracle VirtualBox is a complete virtualization platform, it is the preferred provisioning tool used by famous Server Orchestration software like Vagrant and Ansible.
Vagrant uses Oracle VirtualBox to provision required virtual machines by importing the Vagrant boxes in VirtualBox.
Whereas, Ansible uses their playbooks to create and configure the required virtual machines by using VirtualBox.
Read Also: How to install VirtualBox on Rocky Linux 9

Oracle VirtualBox vs VMWare
Choosing between Oracle VirtualBox and VMware can be complex as both have their strengths and weaknesses, and the best choice depends on your specific needs. Here’s a comparison of the two in various aspects:
1. Cost
- VirtualBox: Free and open-source.
- VMware: Offers both free (VMware Player) and paid versions (VMware Workstation Pro, VMware Fusion for Mac).
2. Performance
- VirtualBox: Generally offers good performance but might lag behind VMware in some high-demand scenarios.
- VMware: Often noted for superior performance, particularly in more complex or resource-intensive setups.
3. Ease of Use
- VirtualBox: User-friendly with a straightforward interface, making it a good choice for beginners.
- VMware: Also user-friendly, but the advanced features might be overwhelming for new users.
4. Features
- VirtualBox: Comprehensive feature set for a free tool, including snapshots, shared folders, and seamless mode.
- VMware: Rich feature set, including advanced networking options, snapshot management, and support for DirectX and OpenGL for better graphics performance.
5. Compatibility
- VirtualBox: Available on Windows, macOS, Linux, and Solaris. Good support for a wide range of guest OSes.
- VMware: Also supports Windows, macOS, and Linux. VMware Fusion is specifically designed for macOS.
6. Support and Community
- VirtualBox: Large user community and extensive documentation due to its open-source nature. Oracle provides official support for enterprise users.
- VMware: Offers robust professional support options and a large community. The documentation is thorough, and enterprise support is a strong point.
7. Integration and Ecosystem
- VirtualBox: Integrates well with other Oracle products and has good support for third-party tools.
- VMware: Strong integration with VMware’s suite of enterprise products, making it a preferred choice for businesses already using VMware solutions.
8. Hardware Requirements
- VirtualBox: Generally light on system resources, making it suitable for older or less powerful hardware.
- VMware: Can be more resource-intensive, but this often translates to better performance on modern hardware.
9. Virtual Machine Management
- VirtualBox: Supports a range of management options but might be less powerful than VMware in enterprise environments.
- VMware: Excellent VM management capabilities, particularly in its enterprise solutions like vSphere.
Summary
- VirtualBox: Ideal for individuals, educational purposes, and small-scale use due to its cost (free) and ease of use. It’s suitable for those who need a capable virtualization solution without investing in a paid product.
- VMware: Better suited for professional environments and enterprise use where performance, advanced features, and professional support are critical. Even the free VMware Player provides strong capabilities, while the paid versions offer extensive features for complex scenarios.
In conclusion, if you are a casual user or a student, VirtualBox might be the better choice due to its cost and simplicity. For businesses or users requiring advanced features and superior performance, VMware would likely be the more appropriate choice.
Recommended Training: The Linux Command Line Bootcamp: Beginner To Power User from Colt Steele

Linux Server Specification
We are using a minimal CentOS 8 server with following specification.
- CPU – 3.4 Ghz (2 cores)
- Memory – 4 GB
- Storage – 40 GB
- Operating System – CentOS 8.1
- Hostname – virtualbox-01.centlinux.com
- IP Address – 192.168.116.206 /24
TP-Link Deco AX3000 WiFi 6 Mesh System(Deco X55) – Covers up to 6500 Sq.Ft. , Replaces Wireless Router and Extender, 3 Gigabit ports per unit, supports Ethernet Backhaul (3-pack)
25% OffUpdate Linux Software Packages
Connect to virtualbox-01.centlinux.com as root user by using a SSH tool.
As a best practice, update the existing software packages in your Linux server before installing anything new.
To update installed software packages on Linux server, you can use dnf command.
dnf update -y
Your Linux server has been updated now.
Since, you now have an updated Linux Kernel, therefore, it is a necessary to reboot the operating system with the newly installed Linux Kernel.
systemctl reboot
Installing EPEL Yum Repository
Oracle VirtualBox requires some prerequisite software packages that are not available in standard yum repositories. Therefore, you have to add EPEL (Extra Packages for Enterprise Linux) yum repository in our Linux server.
You can add EPEL yum repository as follows.
dnf install -y epel-release
Install Oracle VirtualBox Yum Repository
However, you can download VirtualBox RPM package from their official website and install it using dnf or rpm commands.

But we prefer to do it by using the Oracle VirtualBox yum repository. For this purpose, you have to add this yum repository in your Linux server.
Download and install VirtualBox repo file as follows.
wget https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo
Build cache for newly added yum repositories.
dnf makecache
Output:
CentOS-8 - AppStream 7.3 kB/s | 4.3 kB 00:00
CentOS-8 - Base 11 kB/s | 3.9 kB 00:00
CentOS-8 - Extras 2.2 kB/s | 1.5 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - 7.7 kB/s | 8.7 kB 00:01
Extra Packages for Enterprise Linux 8 - x86_64 19 kB/s | 7.2 kB 00:00
Oracle Linux / RHEL / CentOS-8 / x86_64 - Virtu 260 B/s | 181 B 00:00
Oracle Linux / RHEL / CentOS-8 / x86_64 - Virtu 846 B/s | 1.7 kB 00:02
Importing GPG key 0x98AB5139:
Userid : "Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>"
Fingerprint: 7B0F AB3A 13B9 0743 5925 D9C9 5442 2A4B 98AB 5139
From : https://www.virtualbox.org/download/oracle_vbox.asc
Is this ok [y/N]: y
Oracle Linux / RHEL / CentOS-8 / x86_64 - Virtu 45 kB/s | 85 kB 00:01
Metadata cache created.
Install VirtualBox Prerequisites
Before installing Oracle VirtualBox on Linux server, it is necessary to install the prerequisites software packages. Therefore, we have identified the required software packages and installing them by using following dnf command.
dnf install -y kernel-devel kernel-headers glibc-headers glibc-devel binutils libgomp make patch gcc dkms
Install VirtualBox on CentOS 8
Since, you have already added the Oracle VirtualBox yum repository, therefore, you can now easily install your required version of VirtualBox by using dnf command.
Search for available versions of Oracle VirtualBox.
dnf search VirtualBox
Output:
Last metadata expiration check: 0:06:35 ago on Sun 03 May 2020 02:27:51 PM PKT.
====================== Name & Summary Matched: VirtualBox ======================
VirtualBox-5.2.x86_64 : Oracle VM VirtualBox
VirtualBox-6.0.x86_64 : Oracle VM VirtualBox
VirtualBox-6.1.x86_64 : Oracle VM VirtualBox
Install the latest version (VirtualBox 6.1) by using the dnf command.
dnf install -y VirtualBox-6.1
The VirtualBox installer creates a systemd service, named as vboxdrv.service, but you must rebuild the VirtualBox kernel modules to start it properly.
Oracle VirtualBox provides us a script to rebuild relevant kernel modules, therefore rebuild the VirtualBox kernel modules as follows.
/usr/lib/virtualbox/vboxdrv.sh setup
Output:
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
Check the status of vboxdrv.service.
systemctl status vboxdrv.service
Output:
â vboxdrv.service - VirtualBox Linux kernel module
Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled; vendor preset: disabled)
Active: active (exited) since Sun 2020-05-03 14:39:49 PKT; 6min ago
Process: 25841 ExecStart=/usr/lib/virtualbox/vboxdrv.sh start (code=exited, status=0/SUCCESS)
May 03 14:39:49 virtualbox-01.centlinux.com systemd[1]: Starting VirtualBox Linux kernel module...
May 03 14:39:49 virtualbox-01.centlinux.com vboxdrv.sh[25841]: vboxdrv.sh: Starting VirtualBox services.
May 03 14:39:49 virtualbox-01.centlinux.com systemd[1]: Started VirtualBox Linux kernel module.
Oracle VirtualBox 6.1 has been installed on CentOS 8 Linux server.
Logitech G733 Lightspeed Wireless Gaming Headset, Suspension Headband, Lightsync RGB, Blue VO!CE Mic, PRO-G Audio – Black, Gaming Headset Wireless, PC, PS5, PS4, Switch Compatible
$121.59 (as of May 30, 2025 18:18 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Install VirtualBox Extension Pack
VirtualBox extension pack extends the Oracle VirtualBox support for USB 2.0 and USB 3.0 devices, VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards.
You can download VirtualBox 6.1 Extension Pack for your preferred Linux distribution from their official download page.
wget https://download.virtualbox.org/virtualbox/6.1.6/Oracle_VM_VirtualBox_Extension_Pack-6.1.6.vbox-extpack
Now, install VirtualBox extension pack by using following Linux command.
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.6.vbox-extpack
Accept the License agreement to install VirtualBox Extension Pack.
VirtualBox 6.1 Extension Pack has been installed on your CentOS 8 Linux server.
Although, it is quiet convenient to use Oracle VirtualBox in a Graphical environment (GUI). But you can also manage your VirtualBox environment and guests machines from Linux command line (CLI). For this purpose, VirtualBox provides a set of commands prefixed with vbox*.
BASH Guide
$0.99 (as of May 30, 2025 17:35 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Frequently Asked Questions (FAQs)
1. What is Oracle VirtualBox?
VirtualBox is a free, open-source virtualization software that allows you to run multiple operating systems (like Linux, Windows, or macOS) as “virtual machines” (VMs) on a single physical computer.
2. Which operating systems support VirtualBox?
VirtualBox runs on Windows, macOS, Linux, and Solaris hosts. However, macOS guests require additional setup due to Apple’s licensing restrictions.
3. How much RAM and disk space do I need for a VM?
It depends on the guest OS, but generally:
- RAM: Allocate at least 1-2GB (but don’t exceed 50% of your host’s RAM).
- Disk Space: 20-50GB for most OS installations (stored as a dynamic VDI file).
4. What are VirtualBox Guest Additions?
Guest Additions are software packages installed inside a VM to improve performance, enable features like shared folders, clipboard integration, and better screen resolution.
5. Can I run VirtualBox alongside other virtualization tools (like VMware)?
Yes, but avoid running multiple VMs from different tools simultaneously, as this can cause performance issues or conflicts.
Final Thoughts
Thank you for following this guide on how to install VirtualBox on CentOS 8. I hope this tutorial was helpful and made the process straightforward for you. If you have any further questions or need additional assistance, feel free to reach out.
Looking for a Linux server expert? I provide top-tier administration, performance tuning, and security solutions for your Linux systems. Explore my Fiverr profile for details!
Thank you for reading, and happy virtualizing!
Leave a Reply
You must be logged in to post a comment.