How to Install Guest Addition In Ubuntu 12.10 Guest In Virtualbox [Quick Tip]

If you are trying out Ubuntu 12.10 in your Virtualbox and find that you are not able to install the guest additions, then you are not alone. I have installed Ubuntu 12.10 on several instances and on almost every instance, I am not able to install the guest additions. This is the message that I am getting:

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

Looking at the vboxadd-install.log file, you will find that the cause for the installation failure is because of the missing kernel headers. This may sound complicated to you, but don’t worry, here’s the fix:

Open a terminal (in the Ubuntu VM) and type:

sudo apt-get install build-essential kernel-headers-`uname -r` dkms

Once the installation is completed, you can proceed to install the guest additions. It should work this time.

That’s it. Enjoy!