VirtualBox 5.1 on Fedora 24/23, CentOS/RHEL 7.2/6.8/5.11

virtualbox-logo-smallOracle 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.

VirtualBox supports a large number of guest operating systems:

  • Windows 3.x
  • Windows NT 4.0
  • Windows 2000
  • Windows XP
  • Windows Server 2003
  • Windows Vista
  • Windows 7
  • Windows 8
  • Windows 8.1
  • DOS
  • Linux (2.4, 2.6, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11)
  • Solaris
  • OpenSolaris
  • OpenBSD

This guide shows howto install VirtualBox 5.1 (currently 5.1.0) on Fedora 24/23/22, CentOS 7.2/6.8/5.11, Red Hat (RHEL) 7.2/6.8/5.11. This guide uses Virtual Box own yum repositories.

Note: Fedora 21/20/19/18 users can install VirtualBox 5.0, Fedora 17 users can install VirtualBox 4.3 and Fedora 16 users can install VirtualBox 4.2.

1. Change to root User

2. Install Fedora or RHEL Repo Files

3. Update latest packages and check your kernel version

Update packages

Check that that you are running latest installed kernel version
Output of following commands version numbers should match:

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

4. Install following dependency packages

CentOS 7/6/5 and Red Hat (RHEL) 7/6/5 needs EPEL repository, install it with following command:

5. Install VirtualBox Latest Version 5.1 (currently 5.1.0)

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-5.1 not VirtualBox.

Rebuild kernel modules with following command:

6. Add VirtualBox User(s) to vboxusers Group

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

7. Start VirtualBox

Use launcher from menu or simply run:


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:

Check also:

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

Share this post


  1. Hi,

    This website is awesome!!! Kudos to the owner. Can you please, post a tutorial on how to install Hadoop, Big Data, Sqoop, Hadoop Single Node Cluster, HBase, Hive, Spark, on Fedora 23, Ubuntu, OpenSuSE, and CentOS ???????

    Please, You are porbably only few of the Linux Guru’s who knows everything. Thanks

  2. Nice, it really helps me. Thanks for putting in all together.

  3. Hello everybody!!

    Point# 4 needs a little update:

    “Not Found

    The requested URL /pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm was not found on this server.

    RPM has updated to “epel-release-7-6.noarch.rpm”… 7-5 is no longer available.

    Cheers and keep up the fine job!!

    • Thanks Ariel,

      Updated this guide and all others!

  4. everything was great until step 5:

    [root@localhost hghrb]# /usr/lib/virtualbox/ setup
    bash: /usr/lib/virtualbox/ No such file or directory

    Any help will be greatly appreciated and awesome work

    • Hi Shark3,

      Could you post output of following commands:

  5. This guide was beautiful but when I finally got Virtualbox going it is running a much older version of my vdi file than what I’d had. Is there a way to get this back? Or do I need to have made a snapshot beforehand? Thank you!

  6. Hi I am using RHEL 6.6 ,even after a reboot the kernel does not update to the latest. What can be done to fix the same?

    [royr016@nckmvdsla11793 ~]$ rpm -qa kernel |sort -V |tail -n 1
    [royr016@nckmvdsla11793 ~]$ uname -r

  7. Hi, thanks much for posting these instructions, which worked beautifully before. However, I just updated my kernel to 4.7.0-0.rc1.git4.2.fc25.x86_64 and now the vbox module compile fails with

    /tmp/vbox.1/linux/VBoxNetAdp-linux.c: In function ‘vboxNetAdpLinuxXmit’:
    /tmp/vbox.1/linux/VBoxNetAdp-linux.c:156:12: error: ‘struct net_device’ has no member named ‘trans_start’
    pNetDev->trans_start = jiffies;

    any ideas? Thanks much in advance!

  8. Hello,

    When using Fedora 23, after installing kernel VirtualBox (dnf install …) you need to restart the modules:

    systemctl restart systemd-modules-load.service

  9. awesome post, helped solve a problem i was having about dependencies.

    Kudos to you

  10. Had same problem as SHARK3 at step 5 : /usr/lib/virtualbox/ No such file or directory

    here are outputs to cammands
    uname -a
    Linux udmsecret01.gestion.local 4.5.6-200.fc23.x86_64 #1 SMP Wed Jun 1 21:28:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    [fpkamga@udmsecret01 ~]$ rpm -qa VirtualBox\*
    [fpkamga@udmsecret01 ~]$ ls /usr/lib/virtualbox/ -la
    ls: cannot access /usr/lib/virtualbox/ No such file or directory

    Please help

    • Hi Francis,

      Looks like that you have VirtualBox installed not VirtualBox-5.0.

      Could you post output of following command:

  11. Muchas gracias amigo por tu ayuda. Me sirvió muchísimo y ya pude instalar virtualbox.

    Ofreces la información muy clara y concisa.

  12. Hi,
    I am having problems, I had a problem loading the modules as per others and just removed “VirtualBox” that removed “VirtualBox.x86_64 5.0.16-3.fc23”.
    If I try “/usr/lib/virtualbox/ setup” I get:
    No package VirtualBox-5.0 available.
    Error: Unable to find a match.
    Updated Fedora23 OK and everything else was OK but no /usr/lib/virtualbox/ so either something has changed or I am doing something silly!
    Which is it please!?

    • Hi Peter H,

      Did you installed VirtualBox-5.0 package from Oracle’s repo, as described on this guide?

  13. Please not that if you are on UEFI or SecureBoot or whatever, you need to sign the modules with a key and enable this key in UEFI.


Submit a Comment

Your email address will not be published. Required fields are marked *