How to install VirtualBox on CentOS 8
VirtualBox is an open source virtualization platform. It supports a number of guest operating systems, including Linux and Windows, and allows you to run multiple virtual machines at the same time. Join us in this tutorial to introduce you to how to install VirtualBox on CentOS 8.
Installing VirtualBox on CentOS 8:
1. Update your system:
It’s recommended to keep your system up-to-date before installing new software. Use the following command:
sudo dnf update
2. Add the repository URL:
Create a new file named virtualbox.repo
using your preferred text editor (e.g., nano
) and add the following lines:
[VirtualBox]
name = Oracle VirtualBox Repository
baseurl = https://download.virtualbox.org/virtualbox/rpm/el/8
enabled = 1
gpgkey = https://www.virtualbox.org/download/pubkey/0E6C-43CF-874D-BF85-1ED6-06BD-6C46D277DFBA.asc
Save and close the file.
3. Install VirtualBox:
sudo dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
Step 2: At the time of writing this article, the latest stable version of VirtualBox is version 6.0.x. To install the VirtualBox-6.0 package, run the following command:
sudo yum install VirtualBox-6.0
During installation, you will be prompted to import the GPG repository. Type y and press Enter. At this point,
4. Start and enable VirtualBox service:
While VirtualBox doesn’t require a service to run manually, it’s helpful to set it to start automatically at boot:
sudo systemctl start virtualbox
sudo systemctl enable virtualbox
5. Verify the installation:
You can verify the installation by running:
vboxmanage -v
This should display the installed VirtualBox version.
Installing the VirtualBox add-on package:
The VirtualBox add-on package provides several useful features for guest devices such as virtual USB 2.0 and 3.0 devices, RDP support, image encryption, and more. Use wget to download the add-on package from the VirtualBox download page:
wget https://download.virtualbox.org/virtualbox/6.0.14/Oracle_VM_VirtualBox_Extension_Pack-6.0.14.vbox-extpack
After downloading the file, import it using the following command:
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.14.vbox-extpack
You will be presented with an Oracle license and asked to accept the terms and conditions.
Do you agree to these license terms and conditions (y/n)?
Type y and press Enter. Once the installation is complete, you will see the following output:
۰%...۱۰%...۲۰%...۳۰%...۴۰%...۵۰%...۶۰%...۷۰%...۸۰%...۹۰%...۱۰۰% Successfully installed "Oracle VM Virtu
Replace <username>
with your actual username.
Start VirtualBox:
Now that VirtualBox is installed on your CentOS machine, you can start it from the command line by typing VirtualBox or by clicking on the VirtualBox icon (Activities -> Oracle VM VirtualBox). When VirtualBox starts up for the first time, a window like the one below should appear:
Conclusion :
Installing VirtualBox on CentOS 8 is a simple task. All you have to do is enable the Oracle repository and install the VirtualBox package with dnf.