View a remote Raspberry Pi Screen locally

by Jul 7, 2025IT Tips0 comments

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?

  1. VPN to the remote site
  2. 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
  1. Install x11vnc
1
sudo apt-get install x11vnc
  1. 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
  1. Connect RealVNC or TightVNC client to localhost:5973 or localhost:73
  1. 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

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.