VirtualBox 7.2 brought a redesigned toolbar, NVMe in the open-source base package, and extended Linux kernel support up to 6.19. If you’re running Fedora 42 or 41 as your daily driver, getting VirtualBox installed from Oracle’s official repo takes about five minutes.
This guide walks through installing VirtualBox 7.2 on Fedora using Oracle’s RPM repository with DKMS kernel module building. We’ll cover dependency setup, repo configuration, the install itself, and verifying everything works. If you prefer KVM on Fedora, that’s also an option, but VirtualBox remains the simpler choice for desktop virtualization, especially if you also run it on Windows or macOS.
Tested March 2026 on Fedora 42 Workstation (kernel 6.14) with VirtualBox 7.2.6
Prerequisites
Before you start:
- Fedora 42 or 41 Workstation with a desktop environment
- A user account with
sudoprivileges - Secure Boot disabled in BIOS/UEFI (VirtualBox kernel modules are unsigned and won’t load with Secure Boot on)
- Tested on: Fedora 42 (kernel 6.14.2), VirtualBox 7.2.6
Start with a full system update and reboot so you’re running the latest kernel. The DKMS modules build against the running kernel, so a mismatch between installed kernel headers and your booted kernel causes build failures.
sudo dnf -y upgrade
sudo reboot
Install Build Dependencies
VirtualBox compiles kernel modules at install time using DKMS. These packages provide the compiler toolchain and kernel headers it needs:
sudo dnf -y install @development-tools
sudo dnf -y install kernel-headers kernel-devel dkms elfutils-libelf-devel qt5-qtx11extras
Confirm that the kernel headers match your running kernel:
uname -r
rpm -q kernel-devel
Both should show the same version (e.g., 6.14.2-300.fc42.x86_64). If the headers are newer than your running kernel, reboot first.
Add the VirtualBox Repository
Oracle maintains an RPM repository with packages for every supported Fedora release. The repo file uses $releasever so it automatically picks the right URL for your Fedora version:
sudo dnf -y install wget
sudo wget https://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo
Verify the repo was added:
sudo dnf repolist | grep virtualbox
The output confirms the repository is enabled:
virtualbox Fedora 42 - x86_64 - VirtualBox
Install VirtualBox 7.2
Install the latest VirtualBox 7.2 package:
sudo dnf -y install VirtualBox-7.2
During installation, dnf imports Oracle’s GPG signing key and builds the vboxdrv kernel module via DKMS. Check that the kernel module loaded successfully:
sudo systemctl status vboxdrv
You should see active (exited) confirming the driver loaded cleanly:
● vboxdrv.service - VirtualBox Linux kernel module
Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled; preset: disabled)
Active: active (exited)
Verify the installed version:
VBoxManage --version
Expected output:
7.2.6r172322
Add Your User to the vboxusers Group
VirtualBox creates a vboxusers system group during installation. Your user account needs to be in this group to access USB passthrough and host-only networking without sudo:
sudo usermod -aG vboxusers $USER
newgrp vboxusers
Confirm your membership:
id $USER
The output should list vboxusers in the groups:
uid=1000(admin) gid=1000(admin) groups=1000(admin),10(wheel),976(vboxusers)
Install the VirtualBox Extension Pack
The Extension Pack adds USB 2.0/3.0 support, VirtualBox Remote Desktop Protocol (VRDP), disk encryption, and PXE boot for Intel NICs. It’s free for personal and educational use. Download and install it from the command line:
VER=$(VBoxManage --version | cut -dr -f1)
wget "https://download.virtualbox.org/virtualbox/${VER}/Oracle_VirtualBox_Extension_Pack-${VER}.vbox-extpack"
sudo VBoxManage extpack install --replace Oracle_VirtualBox_Extension_Pack-${VER}.vbox-extpack
Accept the license when prompted. Verify the Extension Pack is installed:
VBoxManage list extpacks
The output shows the installed Extension Pack version:
Extension Packs: 1
Pack no. 0: Oracle VirtualBox Extension Pack
Version: 7.2.6
Revision: 172322
Edition:
Description: Oracle Cloud Infrastructure integration, USB 2.0 and USB 3.0 Host Controller, Host Webcam, VirtualBox RDP, PXE ROM, Disk Encryption, NVMe, full VM encryption.
VRDE Module: VBoxVRDP
Crypto Module: VBoxPuelCrypto
Usable: true
Why unusable:
Launch VirtualBox
Open VirtualBox from your desktop’s application menu or from the terminal:
virtualbox
The VirtualBox Manager opens with the new 7.2 toolbar layout. From here you can create VMs, import appliances, or configure host-only networks.
Create Your First VM
To quickly test the installation, create a VM from the command line:
VBoxManage createvm --name "Fedora-Test" --ostype Fedora_64 --register
VBoxManage modifyvm "Fedora-Test" --memory 2048 --cpus 2 --nic1 nat
VBoxManage createmedium disk --filename ~/VirtualBox\ VMs/Fedora-Test/disk.vdi --size 20480
VBoxManage storagectl "Fedora-Test" --name "SATA" --add sata --controller IntelAhci
VBoxManage storageattach "Fedora-Test" --storagectl "SATA" --port 0 --device 0 --type hdd --medium ~/VirtualBox\ VMs/Fedora-Test/disk.vdi
This creates a VM with 2 GB RAM, 2 CPUs, and a 20 GB disk. Attach an ISO and start it with VBoxManage startvm "Fedora-Test".
Troubleshooting
Kernel module failed to build
If vboxdrv fails to load after installation, the most common cause is a kernel version mismatch. Verify headers match your running kernel:
uname -r
rpm -q kernel-devel
If they differ, install the matching headers and rebuild:
sudo dnf -y install kernel-devel-$(uname -r)
sudo /sbin/vboxconfig
Secure Boot blocks vboxdrv
With Secure Boot enabled, the unsigned vboxdrv module won’t load. You’ll see this in the journal:
modprobe: ERROR: could not insert 'vboxdrv': Key was rejected by service
Either disable Secure Boot in your BIOS/UEFI settings, or sign the VirtualBox kernel modules with a Machine Owner Key (MOK). Disabling Secure Boot is the simpler path for a development workstation.
USB devices not visible in the VM
This happens when your user is not in the vboxusers group, or when the Extension Pack is not installed. Verify both:
groups $USER | grep vboxusers
VBoxManage list extpacks
If vboxusers is missing from your groups, add it and log out/in (or run newgrp vboxusers).
Uninstall VirtualBox
If you need to remove VirtualBox completely:
sudo dnf remove VirtualBox-7.2
sudo rm /etc/yum.repos.d/virtualbox.repo
Your VMs and virtual disks in ~/VirtualBox VMs/ are not deleted by the package removal. Remove them manually if you no longer need them.
Tank you for the time. I think I am in over my head at this moment yet I tried.
Article professionally done!
Welcome!
And how install VirtualBox with secureboot ON?
Did you test it?
I’d like to ask you (as an author) the same. I tested it and got a message telling me to sign the modules:
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use ‘dmesg’ to find out why.
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may 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.
(1) Quote the dollar sign in:
name=Fedora \$releasever – \$basearch – VirtualBox
(2) curl tells me:
Curl error (56): Failure when receiving data from the peer for https://www.virtualbox.org/download/oracle_vbox.asc [OpenSSL SSL_read: Connection reset by peer, errno 104]
I tried installing fedora but couldn’t get to the GUI setting. it displayed ‘failed to display gnome display manager’ etc.what could be the problem?
It is about VirtualBox 6.1. installing of VB6.1 is trivial. It is much harder to install VirtualBox 6.0 on modern Fedora.
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.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-5.15.7-200.fc35.x86_64
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may 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.
worked for me! Thankyou.
Awesome that’s amazing!
I tried installing. It is installed, but when I try to run a virtual machine, it says to run /sbin/vboxconfig.
When I try to do that, I get:
# sh /sbin/vboxconfig
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.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-5.15.13-100.fc34.x86_64
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.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-5.15.13-100.fc34.x86_64
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may 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.
for the Fedora 35 /etc/yum.repos.d/virtualbox.repo file you have an incorrect backslash (right before $basearch). The repo wouldn’t resolve for me until I removed it.
sorry, it is in there as an escape when you input the file the way you did, it didn’t work for me because I c/p that into vim
Sorry
Sure Eugene.
I was trying to install virtualbox on fedora 35 for a long time, but in vain. Since virtualbox has been removed from the official repository of fedora, it became almost impossible for me to install virtualbox. But this tutorial oof yours made installing virtualbox possible. So, thank you very much.
does not work for Fedora 36:
Error:
Problem: conflicting requests
– nothing provides libvpx.so.6()(64bit) needed by VirtualBox-6.1-6.1.20_143896_fedora33-1.x86_64
OS: Fedora 36 Plasma Workstation
All prior commands to the “sudo dnf install VirtualBox-6.1” command
Error:
Problem: conflicting requests
– nothing provides libvpx.so.6()(64bit) needed by VirtualBox-6.1-6.1.34_150636_fedora35-2.x86_64
(try to add ‘–skip-broken’ to skip uninstallable packages)
Check updated guide which uses correct repo for Fedora 36.
Fedora 36 gives me the warning:
ARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (5.18.7-200.fc36.x86_64) or it failed to
load. Please recompile the kernel module and install it by
sudo /sbin/vboxconfig
You will not be able to start VMs until this problem is fixed.
But running it does not compile because a function “netif_rx_ni” does not exist.
I’m having problem:
vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may 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.
Please help.
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them.
canyou help//?
THANKS derick
Thanks a lot!
The article looks very nice, but has 2 very big problems:
– The gpgkey in the repo is incorrect and will not allow you to use the repo.
The correct/working gpgkey is: https://www.virtualbox.org/download/oracle_vbox_2016.asc
– VirtualBox will NOT run this easy, when Secureboot is enabled.
Check with “dmesg | grep -i secure”
You can start the GUI, but it will start to warn you about usb redirection not working, and creating a VM is out of the question.
Perfect.
Thanks.