The problem is that enabling 3D Acceleration Support in my VirtualBox seems to break OpenGL programs. I must point out that my hardware layout might be uncommon: I have 4 displays powered by two nVidia Quadro NVS 295 cards. Without 3D acceleration enabled, everything is okay but visualization programs are slow.
When I start an OpenGL program, the system freezes up and I will get an error report pointing to some *.so files under VirtualBox Guest Addition directory: it seems to me that some OpenGL library provided by VirtualBox is causing this. On the Unity desktop, I can see incorrect color patches update sluggishly. (But at least, that won't freeze the machine.)
I have tried (but none of these fix the problem):
using only 1 display on Guest and that seems to improve the situation on Unity but OpenGL programs still crash the system.
disabling 1 of the 2 graphic cards on my Win7 host.
I wonder if VirtualBox dev fully supports for multiple graphic cards + multiple displays.