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?
Asked
Active
Viewed 9,497 times
1 Answers
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
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 canssh -X
and use egqiv
to see them on your screen – M Noit Jan 09 '14 at 11:48raspi2png
is the only tool that worked for me even to capture OpenGL renderings, using no X server. – Bergi Sep 08 '22 at 22:55