How to Install Oracle VirtualBox in Fedora Linux

2 min

A simple and easy-to-follow guide on how you can install Oracle VirtualBox in Fedora Linux.

VirtualBox is an Oracle application that helps you create virtual machines for any operations system. It’s a little more advanced and brings several features, such as networking, USB, NVMe support, etc., between guest and host systems.

Although, there are other free and open-source virtual machines available, such as virt-manager or GNOME Boxes. And they are simple to install and use. But in this guide, I will talk about how to install Oracle’s VirtualBox, which many want to try out.

Let’s begin.

Install Oracle VirtualBox in Fedora

This guide was tested on Fedora 36 and Fedora 37. However, it should apply to all Fedora releases.

  • In your Fedora system, open a terminal and install kernel-headers and dkms, which are needed for VirtualBox setup.
sudo dnf install glibc-headers glibc-devel kernel-headers kernel-devel dkms
  • Once installation is finished, set the KERN_DIR variable with the Kernel installed in your system.
export KERN_DIR=/usr/src/kernels/'uname -r'
  • After you run the above command, you should check if the latest Kernel is showing up using the below command:
echo $KERN_DIR
  • Restart your system.
  • After restart, go to the below link for Linux and download the RPM version under Fedora (choose the highest Fedora version; For example, Fedora 36 or 37 – whichever is available).
  • After downloading, go to the download directory and install the RPM package. Make sure to change the file name accordingly to your downloaded file.
cd ~/Downloads
sudo dnf install VirtualBox-6.1-<version>.rpm
  • After the download is complete, run the setup using the following command. This command will start the VirtualBox Systemd service and build the Kernel modules using the packages you installed in the first step above.
sudo /usr/lib/virtualbox/ setup
  • Once done, open VirtualBox from the application menu.
Installing VirtualBox in Fedora
Installing VirtualBox in Fedora
Oracle VirtualBox running in Fedora Linux
Oracle VirtualBox running in Fedora Linux

Wrapping up

Here in this guide, you learned how you could easily install Oracle VirtualBox in Fedora Linux (all versions). Stay tuned for the following articles.


Creator of All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, LinkedIn, or send us an email.
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest Most Voted
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x