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)

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

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:

Check also:

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

Share this post

616 Comments

  1. I have followed the steps above.
    Virtual Box is installed on CentOS 6.8 but I am not able to start it.
    Error –
    vboxdrv.sh: Starting VirtualBox services.
    vboxdrv.sh: 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

    Reply
    • Uhm, the error message says it all …

      Reply
  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/ld.so.conf.d
    # vi virtualbox-5.1.2.conf
    /usr/lib/virtualbox/
    /usr/lib/virtualbox/plugins/platforms/
    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!

    workaholic

    Reply
  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???

    Reply
  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.

    Reply

Submit a Comment

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