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

i686 http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm

x86_64 http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

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

# rpm –i http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

Install DAG’s GPG key

# rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt

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

# ./VBoxLinuxAdditions.run

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


Reference:

[1] 111cn.net, (2015).VirtualBoxCentOS安装VBOXADDITIONSBuilding the OpenGL support module FAILED. [online] Available at: http://www.111cn.net/sys/CentOS/88184.htm [Accessed 13 Oct. 2015].

[2] If-not-true-then-false.com, (2015).VirtualBox Guest Additions on Fedora 22/21, CentOS/RHEL 7.1/6.7/5.11 | If Not True Then False. [online]Available at: http://www.if-not-true-then-false.com/2010/install-virtualbox-guest-additions-on-fedora-centos-red-hat-rhel/[Accessed 13 Oct. 2015].

[3] Khamlichi, M. and Khamlichi, M. (2014).How To Fix “Building the OpenGL support module [FAILED]” Error In VirtualBoxUnixmen. [online] Unixmen.com. Available at: http://www.unixmen.com/fix-building-opengl-support-module-failed-error-virtualbox/[Accessed 13 Oct. 2015].

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

推荐阅读更多精彩内容