VirtualBox Guest Additions on CentOS 6.7

This is a guide, how to install OracleVirtualBox Guest Additions on CentOS 6.7. Even though there already are a lot of instruction manuals on Internet guiding us to install it on Linux, I still encounter several problems that you may also meet during the installation, which is caused by the incompatibility between CentOS 6.7’s kernel and VBoxGuestAdditions. Therefore, I feel obligated to give you complete instructions.

1. Change root user

# su root

2. Make sure that you are running the latest kernel

# yum update kernel*

# reboot

3. Mount VirtualBox GuestAdditions

Click Devices > Install Guest Additions … on VirtualBox

Mount VirtualBox Guest Additions device

# mkdir /media/VirtualBoxGuestAdditions

# mount –r /dev/cdrom /media/VirtualBoxGuestAdditions

4. Install required dependencies

On CentOS, a collaboration of Dag and other packagers, such as RPMforge, EPEL and RPM Fusion, is needed. In this essay, I choose RPMforge as a demonstration.

Download the rpmforge-release package that matches your host’s architecture. If you are unsure of it, you can check it out with the command uname –i



Install RPMforge (As my host's architecture is x86_64)

# rpm –i

Install DAG’s GPG key

# rpm –import

install required dependencies

# yum install gcc kernel-devel kernel-headers dkms make bzip2 perl

5. Add KERN_DIR environment variable

# KERN_DIR=/usr/src/kernels/`uname –r`

# export KERN_DIR

6. To avoid the ‘Building the main guest additions module failed’ error, do the following:

# cd/usr/src/kernels/2.6.32-431.3.1.el6.x86_64/include/drm

# ln -s /usr/include/drm/drm.hdrm.h

# ln -s /usr/include/drm/drm_sarea.hdrm_sarea.h

# ln -s /usr/include/drm/drm_mode.hdrm_mode.h

# ln -s /usr/include/drm/drm_fourcc.h drm_fourcc.h

7. To avoid the ‘Building theOpenGL support module failed’ error, try this command:

# export MAKE=’/usr/bin/gmake –i’

8. Install Guest Additions

# cd /media/VirtualBoxGuestAdditions

# ./

At the end of this essay, the VirtualBox Guest Additions should be installed on your host.


[1], (2015).VirtualBoxCentOS安装VBOXADDITIONSBuilding the OpenGL support module FAILED. [online] Available at: [Accessed 13 Oct. 2015].

[2], (2015).VirtualBox Guest Additions on Fedora 22/21, CentOS/RHEL 7.1/6.7/5.11 | If Not True Then False. [online]Available at:[Accessed 13 Oct. 2015].

[3] Khamlichi, M. and Khamlichi, M. (2014).How To Fix “Building the OpenGL support module [FAILED]” Error In VirtualBoxUnixmen. [online] Available at:[Accessed 13 Oct. 2015].

[4], (2015).AdditionalResources/Repositories/RPMForge - CentOS Wiki. [online] Available at: [Accessed 13 Oct. 2015].