
Mastering Virtualization: Installing VirtualBox on Fedora 33
Virtualization is a powerful tool for developers, testers, and anyone who needs to run multiple operating systems on a single machine. It allows you to create virtual environments, isolating software and configurations without affecting your host system. Among the most popular virtualization platforms is VirtualBox, a robust, open-source solution developed by Oracle.
While some Linux distributions include older versions of VirtualBox in their standard repositories, getting the latest version, like VirtualBox 6.1, often requires adding the official repository. This guide walks you through the process of installing VirtualBox 6.1 on your Fedora 33 system, ensuring you have access to the latest features and improvements.
Why Install VirtualBox?
VirtualBox offers a wide array of features, including support for a vast number of guest operating systems, device emulation, and network configurations. It’s an excellent choice for:
- Running different operating systems for testing software compatibility.
- Setting up isolated development environments.
- Exploring new operating systems without dual-booting.
- Running legacy applications that are not compatible with your host OS.
Prerequisites
Before you begin, ensure your Fedora 33 system is up to date and you have sudo privileges. Open your terminal and run:
sudo dnf update
sudo dnf upgrade --refresh
This ensures you have the latest packages and kernel, which is crucial for successful kernel module compilation later. A system reboot after a kernel update is highly recommended.
Step-by-Step Installation of VirtualBox 6.1 on Fedora 33
Since VirtualBox 6.1 might not be available in Fedora’s default repositories, we’ll add the official VirtualBox repository.
1. Add the VirtualBox Repository:
Create a new repository file for VirtualBox. Use a text editor like nano or vim:
sudo nano /etc/yum.repos.d/virtualbox.repo
Paste the following content into the file. This configuration tells your package manager (dnf) where to find the VirtualBox packages for your Fedora version.
[virtualbox]
name=Oracle Linux / RHEL / CentOS / Fedora $releasever kmod needed for akms
baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/$releasever/$basearch/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.virtualbox.org/doctek/checksig.asc
Save the file and exit the editor (Ctrl+X, Y, Enter in nano).
2. Import the GPG Key:
Next, import the Oracle public key. This verifies the integrity of the packages you download from the repository.
sudo rpm --import https://www.virtualbox.org/doctek/checksig.asc
3. Install VirtualBox and Kernel Modules:
Now you can install VirtualBox 6.1. We also need the kernel modules package, which is essential for VirtualBox to interact correctly with your host kernel. The akmod package is recommended on Fedora as it automatically rebuilds kernel modules when your kernel updates.
sudo dnf install VirtualBox-6.1 akmod-VirtualBox kernel-devel
- VirtualBox-6.1: The main VirtualBox application.
- akmod-VirtualBox: Automatic kernel module generator for VirtualBox.
- kernel-devel: Development headers for your specific kernel version, required by
akmod.
During the installation, akmod will compile the necessary kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci). This might take a few moments.
4. Load the Kernel Modules:
After installation, the kernel modules need to be loaded into the kernel. You can manually load them, but it’s often best to reboot your system to ensure everything is initialized correctly and the new modules are active.
sudo reboot
5. Add Your User to the vboxusers Group:
To run virtual machines as a non-root user, you need to add your user account to the vboxusers group. Replace <username> with your actual username.
sudo usermod -aG vboxusers <username>
You will need to log out and log back in (or reboot again) for this group membership change to take effect.
Installing the VirtualBox Extension Pack (Recommended)
The VirtualBox Extension Pack adds support for features like USB 2.0 and 3.0 devices, VirtualBox RDP, disk encryption, and NVMe storage. While VirtualBox itself is open source, the Extension Pack is released under a different license and is downloaded separately.
- Download the Extension Pack from the official VirtualBox website. Look for the file named
Oracle_VM_VirtualBox_Extension_Pack-6.1.<version>.vbox-extpack. - Open VirtualBox Manager.
- Go to File > Preferences > Extensions.
- Click the + icon on the right.
- Navigate to the downloaded
.vbox-extpackfile and select it. - Review the license agreement and click Install.
- You may be prompted for your password to complete the installation.
Starting VirtualBox
Once the installation is complete, the kernel modules are loaded, and your user is in the vboxusers group, you can launch VirtualBox from your application menu or by typing VirtualBox in the terminal.
You are now ready to create and run your first virtual machine on Fedora 33!
Troubleshooting Common Issues
- Kernel Module Errors: If you encounter errors related to kernel modules (
vboxdrv, etc.), ensure you havekernel-develinstalled for your currently running kernel version and that you have rebooted after installation and any subsequent kernel updates.akmodshould handle rebuilds automatically, but manual steps might be needed sometimes. - Permission Errors: If you can’t run VMs or access devices, double-check that your user is in the
vboxusersgroup and that you have logged out/in.
By following these steps, you should have VirtualBox 6.1 up and running smoothly on your Fedora 33 workstation, opening up a world of virtualization possibilities.
Source: https://kifarunix.com/install-virtualbox-6-1-on-fedora/


