Install virtualbox guest additions into CentOS 6 (also CentOS 5)

This also works for CentOS 5, and resolves annoyances with display resizing (assuming you allowed enough video memory in the first place).

Yes, it really fixes the problem with CentOS 5 display sizing automatically to the window (which is broken without a full guest additions installation).

First you need to add rpmforge to yum so you can install dkms (see previous).

yum update -y
... if the above updates anything to do with the kernel you need to reboot here ...
yum install dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel -y
cd /media/VBOXADDITIONS ... hit tab ...
export MAKE='/usr/bin/gmake -i'

Then reboot and guest additions should all be working fine.