VirtualBox Guest Additions on Fedora 23/22, CentOS/RHEL 7.2/6.7/5.11

virtualbox-logo-smallThis is guide, howto install Oracle VirtualBox Guest Additions on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 23/22/21/20/19/18/17/16/15/14/13/12, CentOS 7.2/6.7/5.11, Red Hat (RHEL) 7.2/6.7/5.11.

VirtualBox Guest Additions is special software that can be installed inside Linux virtual machines to improve performance and make integration much more seamless. Among the features provided by these VirtualBox Guest Additions are mouse pointer integration and arbitrary screen solutions (e.g. by resizing the guest window).

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

1. Change root user

2. Make sure that you are running latest kernel

Update virtual machine kernel and reboot

3. Mount VirtualBox Guest Additions

Click Devices > Install Guest Additions… on VirtualBox
VirtualBox Install Guest Additions

Mount VirtualBox Guest Additions device

4. Install following packages

On CentOS/Red Hat (RHEL) 7/6/5, EPEL repo is needed

Install following packages

If you have CentOS/RHEL 6.7 then check this comment. You need older kernel.

5. Add KERN_DIR environment variable

6. Install Guest Additions

Output looks like following:

7. Reboot guest system

Then VirtualBox Guest Additions install is ready.

Check also:

Install VirtualBox (with yum) on Fedora, CentOS, Red Hat (RHEL)

Share this post

189 Comments

  1. Thanks for the great site. I don’t know who you are but you’ve done a great job providing a lot of very useful information. Thanks for all your time and effort.

    Reply
  2. You might want to point out in step 6 that if you’re installing guest additions on Fedora server (and I assume server versions of the other distributions) then the output will be slightly different. I got a message that I didn’t save that the windows and graphics installation would be skipped because no X system was found and the installation would be skipped. It was a bit confusing because the output just terminated at that and I didn’t get the notice to reboot. After rebooting, though, I found that my host shared folder was mounted and I could copy files onto my server.

    Thanks for a great document.

    Reply
  3. Thanks s lot!
    For CentOS 7, at least a GUI-less infrastructure server, this was sufficient:

    yum update kernel*
    yum install gcc kernel-devel bzip2
    KERN_DIR=/usr/src/kernels/uname -r
    export KERN_DIR
    mkdir /media/cdrom
    mount -r /dev/cdrom /media/cdrom
    cd /media/cdrom
    ./VBoxLinuxAdditions.run

    reboot

    So it was a bit easier, I did not need kernel-headers, dkms, perl nor the epel rpm .
    dkms was even unknown in my CentOS7.
    kernel-headers were already included in kernel-devel

    Reply
  4. hi
    how to install virtualbox guest additions 5.0.4 in fedora 23 workstation beta ?
    I try many times but i don’t succeed : i have this message “Warning : unsupported pre-release version of X.Org Server installed. Not installing the X.Org drivers.”

    Any ideas please ?

    Reply
  5. For some reason my fedora did not use kernel 4.2.3 but uses 4.0.4.
    “dnf install kernel-devel” installs headers for 4.2.3
    therefore vboxaddition build fails.
    Command:
    dnf install “kernel-devel-$(uname -r)”
    worked for me as fix.

    However I’m still amazed that very fresh install of fedora uses older kernel and uses newer as backup.

    Reply
    • Ok, I got it. I missed “reboot” command after “dnf update kernel”.

      Thats why I was still running on older kernel than actually installed.

      Reply
  6. Hi, I’m having issues installing guest additions on my Fedora 23 virtual machine. I am able to run ./VBoxLinuxAdditions.run but I get the following error message:

    “Warning: unsupported pre-release version of X.Org Server installed. Not installing the X.Org drivers”

    Everything else seems to work well, but when I reboot nothing has changed. The max resolution I can get is 1024 x 768. My host machine is a Surface Book (3,000 x 2,000 resolution) so the VM is way too small.

    If you could offer any tips, I’d really appreciate it. Thank you.

    Reply
    • Hi Pamela,

      You can downgrade Xorg back to 1.17 using following “command” (copy+paste all rows at once as root):

      I wrote this command for users who want to install nVidia drivers on Fedora 23, but should also work with VirtualBox Guest Additions. Add also exclude=xorg-x11* to /etc/dnf/dnf.conf like:

      Then run ./VBoxLinuxAdditions.run again.

      Reply
    • Or maybe upgrade VirtualBox.
      I have VirtualBox 5.0.10 and the guest additions that belong to that version installed without problems (using the instructions above) on Fedora 23 Workstation (for which I am grateful!). While initially also limited to 1024×768, I now run at 1680×1050, the size of my second monitor.

      Reply
  7. Hi JR, I can’t see the comment that you posted in response to my concerns about the older version of xorg, but I got it in my email and I just want to say – it works! Finally! My VM is usable at last. Thank you for providing continuous support to your readers.

    Reply
    • Hi Pamela,

      You are welcome and nice to hear that you got it working!

      It’s caused by the cache that you couldn’t see my comment. If you have cookie which tells to the web server that you are commented something, then you should see live version otherwise you see cached version.

      Reply
  8. Hi
    Thank you for providing this guide. I have followed all of the steps above but still can’t seem to get GuestAdditions up and running.

    I am running VirtualBox 5.0.12 with CentOS 7

    After completing all above steps, below is what I see during Vbox install, notice there is no “main Guest Additions modules, shared folder or opengl modules. Anything I am missing? Also how to I get X.Org to be available? haven’t been able to find how/where to install?

    [root@localhost VirtualBoxAdditions]# ./VBoxLinuxAdditions.run
    Verifying archive integrity… All good.
    Uncompressing VirtualBox 5.0.12 Guest Additions for Linux…………
    VirtualBox Guest Additions Installer
    Removing Installed version 5.0.12 of VirtualBox Guest Additions…
    Removing existing VirtualBox DKMS kernal modules[ OK ]
    Removing existing VirtualBox non-DKMS kernal modules[ OK ]
    Copying additional installer modules …
    Installing additional modules …
    Removing existing VirtualBox DKMS kernal modules[ OK ]
    Removing existing VirtualBox non-DKMS kernal modules[ OK ]
    Building the VirtualBox Guest Additions kernel modules[ OK ]
    Doing non-kernel setup of the Guest Additions[ OK ]
    You should restart your guest to make sure the new modules are actually used

    Installing the Window System drivers
    Could not find the X.Org or XFree86 Window System, skipping.
    [root@localhost VirtualBoxAdditions]#

    Reply
    • Hi Michael,

      Do you have any graphical environment installed? Looks like, that you don’t have X installed? If you don’t have it, then you don’t need Window system drivers.

      Reply
      • Thanks, that was my problem. Once I installed that, all was working fine. Thank you!!

        Reply
    • Hi Suresh,

      I just tested this on CentOS 7.2 and it’s working normally for me. Some reason your log paste is expired.

      Reply
      • Thanks JR – will try again.

        Reply
  9. This worked !!!!!!!. I struggled and spend more time resolving. After making the changes, i got bad interpreter: Permission denied when executed as below

    ./VBoxLinuxAdditions-x86.run
    bash: ./VBoxLinuxAdditions-x86.run: /bin/sh: bad interpreter: Permission denied

    but by executing sh ./VBoxLinuxAdditions-x86.run

    it worked.

    Reply

Submit a Comment

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