up vote 3 down vote favorite
share [g+] share [fb]

I've browsed the handful of "screen capture" queries here, but I was unable to find anything which addressed my specific need.

I'm looking for a command-line tool that I can run via remote SSH connection (by way of the cygwin sshd daemon). There are several to choose from, but the few I've tried (ImageMagick, nircmd, and MiniCap) all result in a blank screen. I assume that this is due to the remotely logged in user not having a proper graphical console session running.

The goal here is automate screen capture and retrieval of the main system console (what one would see if they were looking at the physical monitor) through the use of ssh script from a Unix host:

ssh user@windowshost "screencap --output /tmp/console.jpg"
scp user@windowshost:/tmp/console.jpg /some/destdir

Note that these must be done on demand, so polling a remote directory that has snapshots dumped periodically will not work.

Bonus points for programs that are open source and have a portable install (so I don't need to RDP/VNC into the machine to run a graphical installer).

link|improve this question
feedback

4 Answers

If you already have VNC on the machine you may try to make screenshots through VNC, e.g. with VNC Snapshot.

link|improve this answer
Looks like the last release was in 2004. It may take some effort to get working. I'll report back in if I manage to do so. – Geoff Fritz Jan 21 '10 at 21:48
VNC protocol is very, very simple and even more, each specification refers to previous as extension. Also current version is 3.8, and 3.7 was released in 2003 IIRC, so it probably would work. – whitequark Jan 21 '10 at 22:03
feedback

Have you tried using SysInternals' PsExec utility instead of SSH? Or even in addition to SSH (ie, ssh user@host "psexec screencap --output /tmp/console.jpg"). I don't know that it would work, but seems worth trying.

link|improve this answer
That resulted in the same blank screen capture. Nice idea, though. – Geoff Fritz Jan 21 '10 at 21:44
You should CreateRemoteThread in some process running on the desktop you want to screenshot. May be psexec can do this, may be not (in this case you need some other tool). – Vi. Jul 13 '10 at 19:48
feedback

if you log into the machine via ssh you are not in the same session as the windows you want to capture. thus your snapshotting efforts are .. useless.

i would setup the windows machine to allow rdesktop-sessions, then connect via rdesktop from the unix machine and make a snapshot of the rdesktop-window.

link|improve this answer
feedback

Try one of the following commands.

$ import -pause 1 -window root screenshot.jpg

$ xwd -out screenshot.xwd -window root
or
$ xwd -out screenshot.xwd -window root -display :0.0  

And this for extracting the xwd-file:

$ xwud -in screenshot.xwd
or
$ convert screenshot.xwd screenshot.jpg

Source: http://ubuntuforums.org/showthread.php?t=107580

link|improve this answer
It's about Windows. There's no "display :0.0". There are desktops and windowstations instead. – Vi. Jul 13 '10 at 19:46
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.