When you install CentOS 6.4 in VirtualBox, quite quickly you might be annoyed by a lack of a mouse integration. Usual cure in form of VM guest additions simply fails with
Building the main Guest Additions module [FAILED]
Fortunately this message comes with some additional information which points to lack of compiler and kernel headers. Easiest way to install them is in terminal:
$ su - root
# yum install gcc
# yum install kernel-devel-`uname -r`
After this you can retry guest additions installation and you should see better results.
PS: This method probably works for RedHat also.