VirtualBox 7 is a popular virtualization solution that allows you to run multiple operating systems on a single physical host. This guide will show you how to install it on your Fedora 40, 39, or 38 system, a Red Hat-supported Linux distro known for its cutting-edge software, user-friendliness, and great support.
Simply follow the steps outlined below, which we tested and proven to work, and youโll be up and running in no time with a system ready to meet all your virtualization needs.
Disclaimer: While this guide focuses on installing VirtualBox on Fedora 40, itโs equally applicable to earlier versions, such as 39, 38, etc.
Step 1: Install VirtualBox Dependencies
First, you need to install some dependencies. These are specific software packages that are required for VirtualBox to run properly.
Using the DNF package manager, we will install the “development-tools” meta package and several kernel-related packages required for VirtualBox to function.
Open the terminal and run the following two commands:
sudo dnf install @development-tools
sudo dnf install kernel-headers kernel-devel dkms
Code language: Bash (bash)
Step 2: Add VirtualBox Repository to Fedora
Next, we will add the official VirtualBox repository to our Fedora 40 system. This implies that the update package will be made available with the rest of your systemโs regular updates if a new version is released.
Using your preferred terminal text editor, create the “/etc/yum.repos.d/virtualbox.repo” file:
sudo nano /etc/yum.repos.d/virtualbox.repo
Code language: Bash (bash)
Then, put the content provided below in it, save it, and exit the file.
[virtualbox]
name=Fedora $releasever - $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/$releasever/$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox_2016.asc
Code language: Bash (bash)
Next, refresh the package list. When prompted, type “y” to agree to import the GPG key signing packages from Oracle’s official VirtualBox repository.
sudo dnf update
Code language: Bash (bash)
Step 3: Install VirtualBox on Fedora 40
Finally, we are all set for the actual installation. Now, to install VirtualBox on your Fedora 40 system, run the following commands:
sudo dnf install VirtualBox-7.1
Code language: CSS (css)
During installation, you will be prompted to import the GPG key again. Type “y” and press “Enter.” Wait for the installation to complete.
Now that VirtualBox is installed and ready to roll on your Fedora 40 system, there’s one more step before we seize its opportunities.
Step 4: Install VirtualBox Extension Pack
This is an optional step, but I strongly encourage it because it will make working with VirtualBox on your Fedora system easier and more convenient. VirtualBox Extension Pack unlocks many great features, such as:
- USB 2 and USB 3 support
- VirtualBox Remote Desktop Protocol (VRDP)
- Host webcam passthrough
- Disk image encryption with AES algorithm
- Intel PXE boot ROM
Hereโs an interesting point: Although not obligatory, itโs strongly advised that you ensure the version of the VirtualBox Extension Pack you install matches the version of VirtualBox on your Fedora 40 system.
To verify the exact version of the installed locally VirtualBox, you can use vboxmanage
, a build-in VirtualBoxโs command:
vboxmanage -v | cut -dr -f1
As you can see, Virtualbox’s installed version is โ7.1.0.โ So, weโll use the below wget command to download VirtualBoxโs Extension Pack with the same version.
If your installation is different, replace both places containingย “7.1.0”ย in the command below with the current version. You can also go straight to theย downloads pageย and look at the available versions.
wget https://download.virtualbox.org/virtualbox/7.1.0/Oracle_VirtualBox_Extension_Pack-7.1.0.vbox-extpack
Code language: Bash (bash)
Next, to install the VirtualBox Extension pack, run the vboxmanage
command as follows:
sudo vboxmanage extpack install Oracle_VirtualBox_Extension_Pack-7.1.0.vbox-extpack
Code language: Bash (bash)
You will be prompted to agree to Oracleโs license terms and conditions. To confirm, type โyโ and press โEnter.โ
Additionally, you can verify installed VirtualBoxโs extension pack version by running the following:
vboxmanage list extpacks
Code language: PHP (php)
Step 5: Add User to vboxusers Group
Before using VirtualBox, add your user account to the “vboxusers” group. This is quick and simple to accomplish by running:
sudo usermod -a -G vboxusers $USER
Code language: Bash (bash)
Now, perform a reboot. After login, check that you are in the “vboxusers” group with this command:
groups $USER
Code language: Bash (bash)
Step 6: Running VirtualBox on Fedora 40
Launching it from the desktop environmentโs application menu, you can now start using VirtualBox. Type โvirtualboxโ and click on the icon when it appears.
To start creating a new virtual machine, use the “New” button.
How to Uninstall VirtualBox
If you want to uninstall VirtualBox from your Fedora system for any reason, you can easily do so by running the command below.
sudo dnf remove VirtualBox-7.1
Code language: Bash (bash)
Then you have two choices: disable the VirtualBox repository on your Fedora system:
sudo dnf config-manager --set-disabled virtualbox
Code language: Bash (bash)
Or completely remove it by deleting the repo’s file:
sudo rm /etc/yum.repos.d/virtualbox.repo
Code language: Bash (bash)
Conclusion
Installing VirtualBox 7.1 on Fedora 40 can give users a powerful and versatile virtualization solution for running multiple operating systems on a single machine.
With Fedora 40 as the host operating system, you can now take advantage of its stability, security, and cutting-edge software, making it a reliable platform for virtualization.
The installation process outlined in this guide provides a comprehensive and detailed approach to setting up VirtualBox 7.1 on Fedora 40, ensuring that users can follow along and successfully install the software.
Thanks for using this tutorial! Any feedback is welcomed in the section below.