Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»General Articles»How To Install VirtualBox 6.1 on Fedora 35/34

    How To Install VirtualBox 6.1 on Fedora 35/34

    RahulBy RahulJanuary 27, 20192 Mins ReadUpdated:February 18, 2022

    Oracle Corporation Team has released its new major version VirtualBox 6.1.32 on Jan 18, 2022. In this release VirtualBox has improves stability and fixes regressions. To read more about this release read changelog.

    This tutorial will help you to install Oracle VirtualBox 6.1 on Fedora 35/34/33/32/31/30 Linux systems using DNF.

    Step 1 – Prerequisites

    First of all, You need to configure the yum repository to install Virtualbox on your Fedora system. You can simply download the repo file from its official site and place it under at /etc/yum.repos.d/virtualbox.repo. Navigate to /etc/yum.repos.d directory and use one of the below commands as per your operating system.

    cd /etc/yum.repos.d/
    sudo wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
    

    Before installing VirtualBox make sure to install all required packages to run VirtualBox like kernel-headers, kernel-devels, etc. Use the following command to install the required packages.

    sudo dnf install binutils gcc make patch libgomp dkms qt5-qtx11extras libxkbcommon
    sudo dnf install glibc-headers glibc-devel kernel-headers kernel-devel compat-libvpx5
    

    After installing the latest kernel and kernel headers, let’s reboot your system and start with the Latest kernel.

    sudo reboot
    

    Step 2 – Configure Environment

    VirtualBox installation required kernel source code to install required modules, So we need to configure environment variable KERN_DIR to which VirtualBox get kernel source code. In my case latest kernel source is available in 4.16.5-300.fc28.x86_64 directory under /usr/src/kernels/ . Make sure you are using correct source path.

    export KERN_DIR=/usr/src/kernels/`uname -r`
    
    echo $KERN_DIR
    
    /usr/src/kernels/4.16.5-300.fc28.x86_64
    

    Step 3 – 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-6.1
    

    After installation, we need to rebuild kernel modules using the following command.

    sudo /usr/lib/virtualbox/vboxdrv.sh setup
    

    Step 4 – Launch VirtualBox

    You can use the application launcher or use the following command to start VirtualBox from X windows. You can switch to GUI mode using init 5 or startx commands from terminal.

    virtualbox
    

    Install VirtualBox on Fedora

    Conclusion

    In this tutorial, you have learned to install VirtualBox on the Fedora system. Now, you can create virtual machines for operating systems of your choice and work on them.

    fedora Oracle VirtualBox
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Install PHP on Debian 10 (Buster)
    Next Article How to Solve an Expired Key (EXPKEYSIG) with Apt

    Related Posts

    How to Find Django Install Location in Linux

    Updated:April 27, 20221 Min Read

    (Resolved) – ReactJS 404 Error on Page Reload

    2 Mins Read

    Adding a New SSH Key in GitHub

    Updated:April 1, 20223 Mins Read

    13 Best Linux Terminal Emulators and Bash Editors

    8 Mins Read

    How To Install Oracle VirtualBox on Debian 11

    2 Mins Read

    10 Best Linux FTP Clients in 2022

    5 Mins Read

    12 Comments

    1. Jordan on December 7, 2020 3:31 pm

      Very straight forward and helpful. Thank you for posting.

      Reply
    2. fero on October 27, 2020 5:54 pm

      thanks rahul..its very helpfully for me

      Reply
    3. Rafael on September 13, 2020 4:18 pm

      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.

      Reply
    4. Matt on September 2, 2020 4:37 am

      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.

      Reply
    5. Matt on September 2, 2020 4:36 am

      no such file as /usr/lib/virtualbox/vboxdrv.sh

      Reply
    6. VeeTee on February 23, 2020 7:21 am

      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 !!

      Reply
    7. Pablo on October 2, 2019 6:19 am

      Thank you.

      Reply
    8. Atheros on August 21, 2019 8:47 am

      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.

      Reply
    9. fart on July 14, 2019 8:49 pm

      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

      Reply
      • RC on August 22, 2019 2:59 am

        Thank you. You are right. compat-libvpx4 wasn’t available in the repo. compat-libvpx5 worked

        Reply
    10. Kelwin on June 10, 2019 3:30 pm

      Thank you very much!

      Reply
    11. Helen on March 27, 2019 6:05 pm

      /usr/lib/virtualbox/vboxdrv.sh setup this command required root privileges.

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.