For CentOS 5.4.
First install the dev tools and kernel files:
yum groupinstall "development tools" yum install kernel-devel
Setup KERN_DIR variable and run the addition setup:
export KERN_DIR=/usr/src/kernels/2.6.18-164.11.1.el5-i686/ sh VBoxLinuxAdditions-x86.run
Screen dump:
[root@centos5 cdrom]# KERN_DIR=/usr/src/kernels/2.6.18-164.11.1.el5-i686/ ; export KERN_DIR [root@centos5 cdrom]# sh VBoxLinuxAdditions-x86.run Verifying archive integrity... All good. Uncompressing VirtualBox 3.1.4 Guest Additions for Linux........ VirtualBox Guest Additions installer Removing installed version of VirtualBox Guest Additions... Building the VirtualBox Guest Additions kernel modules Your guest system does not seem to have sufficient OpenGL support to enable accelerated 3D effects (this requires Linux 2.6.27 or later in the guest system). This Guest Additions feature will be disabled. Building the main Guest Additions module [ OK ] Building the shared folder support module [ OK ] Doing non-kernel setup of the Guest Additions [ OK ] Starting the VirtualBox Guest Additions [ OK ] Installing the Window System drivers Installing X.Org 7.1 modules [ OK ] You appear to be running an older version of the X Window system in your guest. Seamless mode and dynamic resizing will not work! Setting up the Window System to use the Guest Additions [ OK ] You may need to restart the hal service and the Window System (or just restart the guest system) to enable the Guest Additions. Installing graphics libraries and desktop services componen[ OK ]
Reboot to take effect.