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 howto install VirtualBox 7.0.8 on Fedora 38/37/36 using Oracle’s own dnf repo:

Check video guide howto install VirtualBox 7.0.8 / 7.0.9 / 7.0.97 on Fedora 38/37/36 using .run installer:

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
  • DOS
  • Linux
  • Solaris
  • OpenSolaris
  • OpenBSD

This guide shows howto install VirtualBox 7.0 (currently 7.0.8) on Fedora 38/37/36, CentOS 9/8.7, Red Hat (RHEL) 9/8.7. This guide uses Oracle’s own Virtual Box .run installer.

1. Install Oracle’s VirtualBox 7.0.8 on Fedora 38/37/36, CentOS 9/8.7, Red Hat (RHEL) 9/8.7

1.1. Change to root User

su -
## OR ##
sudo -i

1.2. Install Fedora or RHEL Repo Files

cd /etc/yum.repos.d/

## Fedora 38/37/36 users
wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo

## CentOS 9/8 and Red Hat (RHEL) 9/8 users
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

1.3. Update latest packages and check your kernel version

Update packages

## Fedora 38/37/36 and CentOS/RHEL 9/8 ##
dnf update

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

CentOS 9/8 and Red Hat (RHEL) 9/8 needs EPEL repository, install it with following command:

## CentOS 9 and RHEL 9 ##
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

## CentOS 8 and RHEL 8 ##
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
## Fedora 38/37/36 ##
dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms qt5-qtx11extras libxkbcommon

## CentOS/RHEL 9/8 ##
dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms

1.5. Install VirtualBox Latest Version 7.0 (currently 7.0.8)

## Fedora 38/37/36 ##
dnf install VirtualBox-7.0

## CentOS/RHEL 9/8 ##
dnf install VirtualBox-7.0

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

Rebuild kernel modules with following command:

## Fedora 38/37/36 and CentOS/RHEL 9/8 ##
/usr/lib/virtualbox/vboxdrv.sh setup

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.0.8 (stable) / 7.0.9 (test build) / 7.0.97 on Fedora 38/37/36 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

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.0 Installer(s)

cd ~

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

## Download VirtualBox 7.0.9-157345 latest test build ##
wget https://www.virtualbox.org/download/testcase/VirtualBox-7.0.9-157345-Linux_amd64.run

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

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

2.4. Make Installer File Executable

chmod +x VirtualBox-7.0.8-156879-Linux_amd64.run

## OR ##

chmod +x VirtualBox-7.0.9-157345-Linux_amd64.run

## OR ##

chmod +x VirtualBox-7.0.97-157070-Linux_amd64.run

2.5. Install Following Dependency Packages

dnf install python2.7 binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms qt5-qtx11extras libxkbcommon

2.6. Install VirtualBox Latest Version 7.0 (currently 7.0.8, 7.0.9 or 7.0.97)

./VirtualBox-7.0.8-156879-Linux_amd64.run

## OR ##

./VirtualBox-7.0.9-157345-Linux_amd64.run

## OR ##

./VirtualBox-7.0.97-157070-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

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, CentOS and Red Hat (RHEL) ##
KERN_DIR=/usr/src/kernels/`uname -r`
 
## Fedora example ##
KERN_DIR=/usr/src/kernels/2.6.33.5-124.fc13.i686
 
## CentOS and Red Hat (RHEL) example ##
KERN_DIR=/usr/src/kernels/2.6.18-194.11.1.el5-x86_64
 
## Export KERN_DIR ##
export KERN_DIR

Check also:

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