0

I've already gone through X11 Not Forwarding over SSH ($DISPLAY not getting set) and How to forward X over SSH to run graphics applications remotely? and am still getting my problem.

I'm running a pi on my local network and I can ssh into it just fine. When I try to open the remote desktop (x11 forwarding) it fails. I get the error:

19:21:15.111 Added Remote Desktop forwarding rule on 127.0.0.1:51126 to 127.0.0.1:3389.
19:21:15.132 Remote Desktop Connection opened.
19:21:20.124 Failed to open channel for Remote Desktop forwarding from 127.0.0.1:51127 on 127.0.0.1:51126 to 127.0.0.1:3389. Open failure reason: ConnectFailed, description: Connection refused.
19:21:21.650 Remote Desktop Connection closed.

If I try to open a windowed application like Chromium I get this error from the ssh window: Unable to open X display. As well this error from my ssh client:

13:33:18.880 Failed to open channel for X11 forwarding from 127.0.0.1:59484 to 127.0.0.1:6000. Error connecting to X11 server: FlowSocketConnector: Failed to connect to target address. Windows error 10061: No connection could be made because the target machine actively refused it.

2 Answers 2

2

First, make sure X11 is enabled on the server and client side

This should help you make sure it is enabled How to forward X over SSH to run graphics applications remotely?

If using a gui ssh client you can enable X11 forwarding through the settings/preferences.

At this point you should be able to ssh and have the X11 forwarding accepted upon your connection.

However, since you are using windows you need an X11 server

Windows does not have an X11 server installed by default. An X11 server must be installed first.

Here is a guide from bitwise for installing the cygwin x11 server. This should work regardless of the ssh client used.

After installing the server, make sure to run the following command from the guide as your firewall will prevent the connection otherwise. C:\cygwin64\bin\XWin -listen tcp -multiwindow

This will let you open gui applications with X11 forwarding and enable

To enable Remote Desktop, in my case I was using bitwise SSH Client, here is their guide https://www.bitvise.com/remote-desktop

0

With startx you are trying to start a X11 server, which fails since you don't have a screen attached to it.

When connecting via ssh, the X server is on your own computer (from the opoint of view of the programs running at the pi, the X11 server is ssh, which is actually passing the information to the real X11 on your client computer).

Instead of launching startx, you should directly run whatever graphical program you wanted to run.

2
  • Thank for the info, what about the error when I try to remote desktop through the ssh client. It only lets me get into the terminal. Is there a way to open the desktop enviroment? Sep 5, 2020 at 2:55
  • How is the OP supposed to use startx in case he's connected via SSH? Sep 5, 2020 at 3:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .