Installing Virtualbox Guest Additions on Fedora 12

I had trouble installing VBoxLinuxAdditions on Fedora12. I installed all the requisites that I could find anywhere on the web:

$ sudo yum install binutils gcc patch make libgomp glibc-headres glibc-devel kernel-devel

And yet my kernel module build failed with a message like

Unable to find sources for your current Linux kernel, try setting KERN_DIR and try recompiling.

A lot of research showed me that my kernel version and kernel-devel versions were different:

yum list installed | grep kernel

So I had to install the correct version of kernel-devel package.

yum install kernel-devel-$(uname -r)

And voila, my Guest Additions compiled and installed the kernel modules successfully.