How to take screenshot on Ubuntu-guest (Virtualbox)

Ok guys! I have found out the problem and the solution. :P

The problem is Compiz and the solution is to disable it using the command:

metacity --replace &

Now, I can take screenshot of any window inside the VirtualBox.


VirtualBox provides a menu option to take screenshots of the guest, View --> Take Screenshot (Host+E). Alternatively, just Host + E (that's usually Right Ctrl + E).


In Ubuntu guest go to System -> Preferences -> Keyboard Shortcuts. On the following window define a new shortcut to take a screenshot (e.g. in this example ShiftAltP):

enter image description here

Thenafter a screenshot will be taken whenever you press your keyboard shortcut. The default setting using Print is not available in the guest (host only).

Taking screenhots will not work with desktop effects activated, i.e. when Compiz is running (see here for reference).