virtualbox-logo-small

Oracle VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. VirtualBox is a general-purpose full virtualizer for x86 hardware. Targeted at server, desktop and embedded use, it is now the only professional-quality virtualization solution that is also Open Source Software.

Check video guide (older, VirtualBox 7.0.x on Fedora) using Oracle’s own dnf repo:

Check video guide (older, VirtualBox 7.0.x on Fedora) using .run installer:

Support inttf:

Buy Me a Coffee:

VirtualBox supports a large number of guest operating systems:

  • Windows 3.x
  • Windows NT 4.0
  • Windows 2000
  • Windows XP
  • Windows Server 2003
  • Windows Server 2008
  • Windows Vista
  • Windows 7
  • Windows 8
  • Windows 8.1
  • Windows 10
  • Windows 11
  • DOS
  • Linux
  • Solaris
  • OpenSolaris
  • OpenBSD

This guide shows howto install VirtualBox 7.2 (currently 7.2.6) on Fedora 43/42 using Oracle’s own dnf repo.

1. Install Oracle’s VirtualBox 7.2.6 on Fedora 43/42 (Oracle repo)

This guide works with UEFI Secure Boot disabled or enabled. If you keep Secure Boot enabled, follow this step-by-step module signing guide:

Fedora Secure Boot: Howto sign VirtualBox kernel modules (DKMS + .run installer)

1.1. Change to root User

su -
## OR ##
sudo -i

1.2. Install Oracle VirtualBox Repo File

cd /etc/yum.repos.d/

## Fedora 43/42 users
wget https://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo

## Import Oracle VirtualBox repo signing key
rpm --import https://www.virtualbox.org/download/oracle_vbox_2016.asc

1.3. Update latest packages and check your kernel version

Update packages

## Fedora 43/42 ##
dnf upgrade --refresh

Check that that you are running latest installed kernel version

Output of following commands version numbers should match:

rpm -qa kernel |sort -V |tail -n 1

uname -r

Note: If you got kernel update or run older kernel than newest installed then reboot:

reboot

1.4. Install following dependency packages

## Fedora 43/42 ##
dnf install @development-tools kernel-headers \
    kernel-devel dkms elfutils-libelf-devel \
    qt5-qtx11extras libxkbcommon

1.4.1 Disable UEFI Secure Boot or Check Howto Sign VirtualBox Kernel Modules

Check is UEFI Secure Boot Enabled or Disabled

mokutil --sb-state

This guide works with UEFI Secure Boot disabled or enabled.

  • If you prefer the simple path, disable Secure Boot.
  • If you want to keep Secure Boot enabled, you must sign the VirtualBox kernel modules. Follow this step-by-step module signing guide:

Fedora Secure Boot: Howto sign VirtualBox kernel modules (DKMS + .run installer)

1.5. Install VirtualBox Latest Version 7.2 (currently 7.2.6)

## Fedora 43/42 ##
dnf install VirtualBox-7.2

Note:
This command create automatically vboxusers group and VirtualBox user must be member of that group.
This command also builds needed kernel modules.
Package is VirtualBox-7.2 not VirtualBox.

Rebuild kernel modules with following command:

Secure Boot disabled

## Fedora 43/42 ##
/usr/lib/virtualbox/vboxdrv.sh setup

## Alternative (same thing on many installs) ##
/sbin/vboxconfig

Secure Boot enabled

If you have UEFI Secure Boot enabled with custom module signing keys (from Page 2):

## First, rebuild modules without signing ##
/usr/lib/virtualbox/vboxdrv.sh setup
## OR ##
/sbin/vboxconfig

## Then manually sign the rebuilt modules ##
KERNELVER=$(uname -r)
SIGNFILE=/usr/src/kernels/${KERNELVER}/scripts/sign-file

for m in vboxdrv vboxnetflt vboxnetadp vboxpci; do
    modpath=$(modinfo -F filename "$m" 2>/dev/null || echo "")
    if [ -n "$modpath" ]; then
        echo "Signing $m -> $modpath"
        ${SIGNFILE} sha256 /root/module-signing/MOK-vbox.priv /root/module-signing/MOK-vbox.der "$modpath"
    fi
done

## Rebuild module dependencies ##
depmod -a

1.6. Add VirtualBox User(s) to vboxusers Group

Replace user_name with your own user name or some another real user name.

usermod -a -G vboxusers user_name

1.7. Start VirtualBox

Use launcher from menu or simply run VirtualBox as normal user:

VirtualBox

2. Install Oracle’s VirtualBox 7.2.6 on Fedora 43/42 using .run installer

Here is guide howto download and install VirtualBox using .run installer.

Note: Start this with fully updated system and using latest kernel version. Check step 1.3 Update latest packages and check your kernel version This guide works with UEFI Secure Boot disabled or enabled. If you keep Secure Boot enabled, follow this step-by-step module signing guide:

Fedora Secure Boot: Howto sign VirtualBox kernel modules (DKMS + .run installer)

2.1. Change to root User

su -
## OR ##
sudo -i

2.2. Remove VirtualBox RPM Installations

This should not touch (remove) your virtual machines, but you can of course backup everything.

dnf remove VirtualBox\* virtualbox

2.3. Download VirtualBox 7.2/7.1 Installer

cd ~

## Download VirtualBox 7.2.6-172322 latest stable build ##
wget https://download.virtualbox.org/virtualbox/7.2.6/VirtualBox-7.2.6-172322-Linux_amd64.run

## Download VirtualBox 7.1.x-172119 test build ##
wget https://www.virtualbox.org/download/testcase/VirtualBox-7.1.x-172119-Linux_amd64.run

## Download VirtualBox 7.2.x-172125 test build ##
wget https://www.virtualbox.org/download/testcase/VirtualBox-7.2.x-172125-Linux_amd64.run

## Download VirtualBox development snapshot ##
wget https://www.virtualbox.org/download/testcase/VirtualBox-development-172124-Linux_amd64.run

Check current versions from VirtualBox Linux builds and VirtualBox test builds.

2.4. Make Installer File Executable

chmod +x VirtualBox-7.2.6-172322-Linux_amd64.run

## OR ##

chmod +x VirtualBox-7.1.x-172119-Linux_amd64.run

## OR ##

chmod +x VirtualBox-7.2.x-172125-Linux_amd64.run

## OR ##

chmod +x VirtualBox-development-172124-Linux_amd64.run

2.5. Install Following Dependency Packages

dnf install @development-tools kernel-headers kernel-devel dkms elfutils-libelf-devel \
    qt5-qtx11extras libxkbcommon

2.6. Install VirtualBox (stable or test build)

./VirtualBox-7.2.6-172322-Linux_amd64.run

## OR ##

./VirtualBox-7.1.x-172119-Linux_amd64.run

## OR ##

./VirtualBox-7.2.x-172125-Linux_amd64.run

## OR ##

./VirtualBox-development-172124-Linux_amd64.run

Note:
This command create automatically vboxusers group and VirtualBox user must be member of that group.
This command also build needed kernel modules.

You can rebuild kernel modules with following command if needed:

/opt/VirtualBox/vboxdrv.sh setup

2.7. Add VirtualBox User(s) to vboxusers Group

Replace user_name with your own user name or some another real user name.

usermod -a -G vboxusers user_name

2.8. Start VirtualBox

Use launcher from menu or simply run VirtualBox as normal user:

VirtualBox

DKMS build your kernel modules automatically, but if you want upgrade your VirtualBox installation, then close VirtualBox, download new installer, make it executable and install it.

3. Troubleshooting

3.1 UEFI Secure Boot

If you have Secure Boot enabled, VirtualBox kernel modules may not load unless you sign them or disable Secure Boot.

To keep Secure Boot enabled and use VirtualBox, follow the module signing guide:

Fedora Secure Boot: Howto sign VirtualBox kernel modules (DKMS + .run installer)

3.2 KERN_DIR parameter

If you have problems with KERN_DIR parameter or your kernel directory is not automatically detected then set KERN_DIR environment variable manually, using following method:

## Current running kernel on Fedora ##
export KERN_DIR=/usr/src/kernels/$(uname -r)

Check also:

Install VirtualBox Guest Additions on Fedora, CentOS, Red Hat (RHEL)