If you have installed Oracle Linux 5 in a VirtualBox and you receive errors when you want to install the Guest Additions, then this article might give you a solution:

Here is what I did.

Oracle Linux 5.10, Guest Additions 4.2.10.

I installed Oracle Linux 5.10. When trying to install the Guest Additions I received the error:

Building the main Guest Additions module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)


I first declared the KERN_DIR variable. Open a terminal and type:

export KERN_DIR

second, I installed gcc, kernel-devel and kernel-headers by entering:

yum install gcc kernel-devel kernel-headers

and then finally I could install the Guest Additions:


That's it and it worked for me. Good luck!