Software >> Services >> Virtualization >> VirtualBox >> How to ensure successful installation of Virtualbox Guest Additions for Centos 6

Perform the following as root

 

Update virtual machine kernel and reboot


yum update kernel*
reboot


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

## CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
 
## CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

 

Install following packages

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


Add KERN_DIR environment variable

## Current running kernel on Fedora, CentOS 6 and Red Hat (RHEL) 6 ##
KERN_DIR=/usr/src/kernels/`uname -r`
 
## Current running kernel on CentOS 5 and Red Hat (RHEL) 5 ##
KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
 
## Fedora example ##
KERN_DIR=/usr/src/kernels/2.6.33.5-124.fc13.i686
 
## CentOS and Red Hat (RHEL) example ##
KERN_DIR=/usr/src/kernels/2.6.18-194.11.1.el5-x86_64
 
## Export KERN_DIR ##
export KERN_DIR


Install Guest Additions

./VBoxLinuxAdditions.run

 

Reboot

reboot

 

Ignore FAILED status (if any for OpenGL