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.4) 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.4)

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. I have followed the steps above.
    Virtual Box is installed on CentOS 6.8 but I am not able to start it.
    Error – Starting VirtualBox services. failed: Running VirtualBox in a Xen environment is not supported.

    [root@sandbox install]# yum list installed |grep -i virtualbox
    VirtualBox-5.1.x86_64 5.1.2_108956_el6-1 @/VirtualBox-5.1-5.1.2_108956_el6-1.x86_64

    • Uhm, the error message says it all …

    • Hi S,

      Yes, you have Xen environment and it’s not supported.

  2. First of all, many thanks for this very useful guide!

    However, in my case (CentOS 5.11) with the current VirtualBox Version 5.1.2, I ran into a problem which blocked virtualbox when started, so I could not use it at all:
    $ virtualbox
    Qt FATAL: This application failed to start because it could not find or load the Qt platform plugin “xcb”.

    Available platform plugins are: xcb.

    Reinstalling the application may fix this problem.

    After some research, I discovered, that the required “xcb” libraries are installed in /usr/lib/virtualbox and /usr/lib/virtualbox/plugins.

    So the solution is quite simple. As “root” (or using sudo) user do the following two steps:
    1. create a new file containing the two paths mentioned above
    # cd /etc/
    # vi virtualbox-5.1.2.conf
    2. Update system wide configuration of “ldd”
    # /sbin/ldconfig

    Hope this helps some people to overcome this missing peace in the installation procedure of the VirtualBox package.
    Have fun!


  3. I have a serious issue and I am unable to resolve it.
    Host: Fedora 24, fresh install on a new Intel i5 machine. I’ve installed VirtualBox 8.1.
    When I install a Win 8.1 virtual machine, and install guest additions on it, no full screen, and no auto resize guest display at all. My virtual machine’s screen is fixed, 1024×768… And this is very bad news… I need full screen, 1920×1080 resolution.
    On my previous machine everything was fine.
    What is the problem???

  4. I have a serious problem, and I am unable to resolve it.
    Host: Fedora 24, fresh install on a new i5 machine.
    I’ve installed Virtualbox, and then I’ve added a virtual machine with Win 8.1 OS.
    Then I’ve installed Guest Additions.
    And the problem is at this point. When I install guest additions, I should have full screen, and auto resize guest display. But it doesn’t work, there is no full screen, and auto resize guest display is greyed out (disabled) in the View menu item. My guest display is 1024×768, fixed.
    I need full screen, 1920×1080 resolution to my work.
    On my previous hardware with Fedora 23 everything was fine.
    What is the problem, and how to resolve it? Can somebody help me? It is very important for me.

    • Hi VChris,

      Did you tested latest VirtualBox version 5.1.4? Do you still have resolution problem with it?

      • Yes, I’ve updated to 5.1.4 as it had been released, but the issue is still present… :(
        I’ve googled a lot, but there is no solution to my problem.
        I’ve opened a thread in the Virtualbox forums, but no solution yet…
        There’s no other person with the same problem, and I don’t know what to do, but I need Virtualbox and full resolution.

    • Thanks! Updated epel-link.

  5. thankyou so much for this post

  6. Thank you for such a detailed explanation. VB loaded on my 64bit machine, but will only allow me to run at 32bits. Any suggestions would be appreciated. I am new to Linux and very new to Fedora 24.

    Thanks again.


  7. Thank you for such a detailed explanation. VB loaded on my 64bit machine, but will only allow me to run at 32bits. Any suggestions would be appreciated. I am new to Linux and very new to Fedora 24.

    Thanks again.


  8. Thank you. you are awesome!!

  9. Hi,
    Thanks for the guide.
    I have a problem after installing at first start it says:
    “WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (4.7.3-200.fc24.x86_64) or it failed to load. Please recompile the kernel module and install it by
    sudo /sbin/vboxconfig
    You will not be able to start VMs until this problem is fixed”

    When i do that or when i use your way of installing them it gives me an error saying:
    “ failed: modprobe vboxdrv failed. Please use ‘dmesg’ to find out why.”

    what can I do? or is there simply no module for my kernel?

  10. THANK YOU!!!!!


Submit a Comment

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