I have a Raspberry Pi that shows a clock on its screen. It is over an hours drive away
How do I display a remote X screen locally on my computer?

- VPN to the remote site
- SSH to the Pi
1 | ssh -l username ip_of_pi -L 5973:localhost:5900 |
1 2 3 4 5 6 | # in ~/.ssh/config Host p0 mahclock0 pi0 HostName 10.66.77.88 User username LocalForward 5973 localhost:5900 # 5973 can be the default 5900 or 5901,2,3 etc (anything that isn't in use |
- Install x11vnc
1 | sudo apt-get install x11vnc |
- Run x11vnc server
1 2 3 4 5 6 7 8 9 10 | x11vnc -display :0 -nopw -forever # or create and save a password in ~/.vnc/passwd x11vnc -display :0 -forever -usepw # -display :0 by default will run on port 5900 (see netstat -apn below) # if you want to set a custom port use -rfbport x11vnc -display :0 -rfbport 5905 -forever -usepw # when finished to kill x11vnc just CTRL + C in your terminal |
- Connect RealVNC or TightVNC client to localhost:5973 or localhost:73

- The remote screen displayed locally via VNC Viewer:

To check which port the vnc server is running on use netstat
1 | sudo netstat -apn |

0 Comments