I have configured my Raspberry OS with VNC and SSH. If I want to ssh -x, I can access the LXDE desktop from Debian . enter image description here However if I use VNC through SSH, I can access the default output of HDMI, the Raspberry GUI. enter image description here

I was wondering if it is possible to have the Raspberry GUI using SSH only.

  • Welcome. I sense English is not your first language, so to clarify a point: "it says no desktop installed" -> That is not what set means. I know this does not solve your problem (I cannot as I never use the GUI over SSH), but it is an important point because it implies this is a configuration problem, and not a problem with what software is installed.
    – goldilocks
    Dec 28, 2022 at 14:46
  • SSH as terminal works very good and LXDE gives LXDE but I cannot get the Raspberry desktop I have when I plug HDMI from the device and I wanna know if I can get this GUI on SSH. Or if it is a Mobaxterm issue. Raspberry gui is therefore installed.
    – JoelCrypto
    Dec 28, 2022 at 15:04

1 Answer 1


Either can run X applications via ssh X tunneling (using ssh -X or, better, ssh -Y), and then your local X server will be used to render them, which means they won't appear on the remote desktop, or run them rendered on the Pi's X server which is running on the Pi and is displaying over its HDMI, and attach to the same X server using VNC protocol (under the hood the XTest extension is used to retrieve the picture and to inject keystrokes and mouse events into physical X screen). You can't have both.

However, you can tunnel VNC traffic through SSH and there is wonderful ssvnc suite (x11vnc is the part of this suite). This approach could make it appear similar to Microsoft's RDP: you have a dedicated GUI to connect, it SSH'ses into the remote, starts x11rdp, then tunnels VNC over the same connection and starts VNC client locally to connect to that tunneled connection.

Or, you can just have vncviewer locally and x11vnc remotely, and do the same thing manually:

# (locally)
ssh pi@remote-rapsberry-pi -L 5900:localhost:5900
# (in this remote shell)

Then, locally, in another terminal

vncviewer localhost

You can use other port on the local machine if you want to; try -L 5906:localhost:5900 and vncviewer localhost:6. Notice that in VNC terms the thing after the colon is not the port, but screen ID, and the port where server is listening is expected to be 5900 + screen ID.

  • I have vncserver that I run manually from SSH but this way it is working. Well, I guess I will stay on my command line and my SSH XServer. Thanks.
    – JoelCrypto
    Dec 29, 2022 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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