Mount your ubuntu cd/iso from the virtualbox GUI.
Install GNU Compiler and header files
sudo apt-get install build-essential linux-headers-KERNELVERSION
Now mount the VirtualBoxAdditions cd/iso from the virtualbox GUI.
Run the VirtuaBox installer:
sudo sh /media/cdrom/VBoxLinuxAdditions.run all
Restart the virtual machine and you are all done!
12 sudo apt-get update
13 sudo apt-get install build-essential linux-headers-`uname-r`
14 cd /media/
15 ls
16 cd VBOXADDITIONS_3.2.0_61806/
17 ls
18 sudo sh VBoxLinuxAdditions-x86.run
19 reboot
20 sudo reboot

Comments
Guest Additions for Windows, Linux and Solaris in VirtualBox
http://download.virtualbox.org/virtualbox/3.2.0/
Guest Additions for Windows, Linux and Solaris. VirtualBox has special software that can be installed inside Windows, Linux and Solaris virtual machines to improve performance and make integration much more seamless. Among the features provided by these Guest Additions are mouse pointer integration and arbitrary screen solutions (e.g. by resizing the guest window). There are also guest additions for OS/2 with somewhat reduced functionality.