Ok, before I completely forget about this again.
To capture a screenshot of a running X server instance in the background,
On a linux terminal type ...
DISPLAY=:X import -window root xvfb.png
where X is the display number where the X server is running at and xvfb.png is the output, the file with the screenshot.