6

I have Pi at work which is always on and does some stuff. I want to see the progress of the work at home, for that I need to see a screenshot from Pi like every one hour. Is it possible to capture and download a screenshot from Pi when I am connected to it using SSH?

Dumbo
  • 163
  • 1
  • 5
  • 2
    scrot is a command line tool to take screenshots. See for example my answer here: http://raspberrypi.stackexchange.com/questions/7423/how-to-printscreen-on-raspberry-pi/7426#7426 You can then send them with scp, or by email, or you can ssh -X and use eg qiv to see them on your screen – M Noit Jan 09 '14 at 11:48
  • @MNoit : It would be great if you posted that as an actual answer; see here for information about why this is important, particularly since we are a beta site and are evaluated on how often questions actually get answers. – goldilocks Jan 09 '14 at 16:27
  • @goldilocks : I would have thought that the question would be closed as duplicate? – M Noit Jan 12 '14 at 16:30
  • @MNoit : The only way for that to happen is if 5 people w/ > 500 rep vote to close it as a duplicate. I've added one (although this question is perhaps better because it is more to the point), but I doubt we'll get 4 more any time soon as the question is already a little stale. – goldilocks Jan 12 '14 at 18:50
  • @goldilocksMy quesion is abouit how to make screen shot, when you are in SSH from another computer...that other question is not helping me. – Dumbo Jan 12 '14 at 23:04
  • Look into XForwarding, also. – earthmeLon Jan 17 '14 at 17:38
  • raspi2png is the only tool that worked for me even to capture OpenGL renderings, using no X server. – Bergi Sep 08 '22 at 22:55

1 Answers1

9

If you're running something that needs interaction you may want to consider using VNC.

sudo apt-get install tightvncserver
vncserver -geometry 1024x768 :1
DISPLAY=:1 lxsession &

And then from your remote system use a VNC client (what one you needs depends on your other system) to access and monitor the application. You can use SSH forwarding of port 5901 to access it over SSH without adjusting the firewall or router further, e.g.:

ssh -C -L 5901:localhost:5901 remotehost

To take a screenshot remotely with scrot as suggested in comments over SSH you'll need to specify the display:

sudo apt-get install scrot
DISPLAY=:0 scrot file.png

You can use scp to copy the file to the local computer for viewing, e.g.:

scp user@remotehost:file.png .

Under Windows use the PSCP tool from Putty.

Fred
  • 4,552
  • 18
  • 29
  • You should make this two answers. I'd upvote them both, but I particularly found the DISPLAY=:0 tip helpful (I almost tl:dr'd over it after I reading about VNC on the first line) – mwfearnley Mar 30 '16 at 09:57