VirtualBox is a popular virtualization software package that can be used to run virtual machines on your computer. In this article, you will learn how to install VirtualBox on Fedora, a free and open-source Linux operating system. If you’ll use VirtualBox for personal or educational purposes, installing it on Fedora is simple and easy. VirtualBox is also available in most of the popular Linux distributions such as Red Hat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian, Oracle VM, SUSE, and many others.
In this article, we will see how to install and use VirtualBox 7.0 on Fedora Linux. The VirtualBox 7.0 package is not available for Fedora 34 and older versions but still you can install latest VirtualBox on that system.
Prerequisites
Before you start, make sure that you have the following prerequisites: – A computer running Fedora- A minimum of 4 GB RAM- 10 GB free disk space- A host machine running any of the following operating systems: Windows, Linux, Mac OS X – Install VirtualBox and Extension Pack on Fedora.
First of all, you should install the Development Tools required for building VirtualBox Linux kernel modules on Fedora along with a few additional packages.
sudo dnf -y install @development-tools
sudo dnf -y install kernel-headers kernel-devel dkms elfutils-libelf-devel qt5-qtx11extras
After installing the latest kernel and kernel headers, let’s reboot your system and start with the latest kernel.
sudo reboot
Step 1: Configure RPM Repository
The VirtualBox development team provides an RPM repository for the installation. You simply need to configure this RPM repository on your system depending on your Fedora version.
cat <<EOF | sudo tee /etc/yum.repos.d/virtualbox.repo
[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.asc
EOF
You can verify the repository file by viewing its content.
sudo cat /etc/yum.repos.d/virtualbox.repo
Make sure that the repo file is created correctly.
Step 2: Install VirtualBox on Fedora
Use the following command to install VirtualBox using the DNF command-line tool. It will install the latest version of VirtualBox on your Fedora system.
sudo dnf install VirtualBox-7.0
VirtualBox installation processes creates group vboxusers in your system. You should add your current user to this group, so you can get more permissions to manage Virtualbox from your account.
sudo usermod -a -G vboxusers $USER
newgrp vboxusers
id $USER
Step 3: Launch VirtualBox
You have successfully installed VirtualBox software on your fedora system. Now login to the Ubuntu desktop to start using VirtualBox. Where you can create virtual machines for different operating systems.
Search the term “VirtualBox” under the applications and you will see the launcher icon as shown below:
Click the launcher icon to start VirtualBox on your Ubuntu system.
You can use the New button to start creating a new virtual machine. Under the preferences, you can customize the default options. Import and Export buttons are used to migrate existing virtual machines from one system to another systems.
Step 4: Install VirtualBox Extension Pack
The VirtualBox Extension Pack is an optional component that allows you to enhance the functionality of VirtualBox. It provides you with additional features like improved network performance, USB device support, and many others. To install the VirtualBox Extension Pack, follow the below steps:
- Downlaod the VirtualBox extension pack from the official website. Or Use this direct link to download version 7.0.0.
- Open VirtualBox application on your system
- Select File Menu >> Tools >> Extension Pack Manager
- Click the install button as shown below screenshot. Then select the downloaded extension file from the filesystem and complete the installation.
- After successful installation, the extension will be listed here:
The above command will install the VirtualBox extension pack on Fedora.
Conclusion
VirtualBox is powerful virtualization software that can be used to run virtual machines on a computer. In this article, you learned how to install VirtualBox on Fedora, a free and open-source Linux operating system. Now, you can install and run different operating systems like Windows, Linux, and many more inside VirtualBox. If you encounter any issues during the installation or use of VirtualBox, feel free to comment below. We’ll be happy to help you out.
12 Comments
Very straight forward and helpful. Thank you for posting.
thanks rahul..its very helpfully for me
Hi Rahul,
I really appreciate your article, it helped me a lot. Please, update the end where you said to run “/usr/lib/virtualbox/vboxdrv.sh setup”, befor it, the secure boot must be disabled on BIOS, and this command must run as root (sudo). Thank you very much!
Note: Tested in fedora32 workstation and worked pretty good following those instructions above.
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver (vboxdrv) is probably not loaded.You may not have kernel driver installed for kernel that is runnig, if so you may do as root: dnf install akmod-VirtualBox kernel-devel-$(uname -r)If you installed VirtualBox packages and don’t want reboot the system, you may need load the kernel driver, doing as root: akmods; systemctl restart vboxdrv.service
If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system’s documentation for more information.
where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) – The support driver is not installed. On linux, open returned ENOENT.
no such file as /usr/lib/virtualbox/vboxdrv.sh
Hi, it doesn’t work at Fedora 31 . after this sudo /usr/lib/virtualbox/vboxdrv.sh setup it display — vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel “header” files matching the current kernel
for adding new hardware support to the system.
If i type uname -r it shows 5.4.13-201.fc31.x86_64
but it created the folders /usr/src/kernels/ 5.5.5-200.fc31.x86_64 . how to handle the isue ? . Thanks a lot !!
Thank you.
Just wanted to update this a bit for Fedora 30 users.
1. The libvpx4 prerequisite is no longer available for Fedora 30 in the repositories this guide uses. Instead switch it to compat-libvpx5.
2. In order to run ‘ /usr/lib/virtualbox/vboxdrv.sh setup ‘, you need to have root privileges and have Secure Boot disabled in your BIOS. Try running ‘ /usr/lib/virtualbox/vboxdrv.sh setup ‘ again and they will tell you which addition kernels to install based on your kernel in order for VirtualBox to run. Just copy paste and run them, there are 2.
If I’m not wrong then the libvpx prerequisite is no longer available for fedora 30 in the repositories this guide uses
compat-libvpx5 is the correct one
Thank you. You are right. compat-libvpx4 wasn’t available in the repo. compat-libvpx5 worked
Thank you very much!
/usr/lib/virtualbox/vboxdrv.sh setup this command required root privileges.