How can I run Unity in a virtual machine?
Unity has 3D requirements above and beyond Compiz itself.
On top of the 3D required by compiz, which is supported by Virtualbox's 3D support, Unity also requires the OpenGL Frame buffer object extension, which is not supported by Virtualbox's 3D drivers. Wikipedia has a good article on FBO too.)
Bug report: http://www.virtualbox.org/ticket/7835
However this appears to be fixed in the new release of Virtualbox
In VirtualBox >= 4.0 Unity is supported and runs nice when Guest Additions are installed.
XServer 1.10 from 11.04 is supported in Virtual Box >= 4.0.6 when Guest Additions are installed.
There is also a ppa for Unity in 2d. It's how I set up my own VM:
https://launchpad.net/~unity-2d-team/+archive/unity-2d-daily