SSH Tunnel for VNC


Love Core Tunnel. I am trying to setup an ssh tunnel but running into a bit of an issue. In short from command line this is what I am using and this works just fine. Trying to replicate the same in Core Tunnel

ssh -nNT -L 5901:localhost:5901 user@<remote_ip>

This is the GUI representation of what I have done but the VNC client is not able to connect via


Any help is appreciated.

Hi David, could you please set debug level to DEBUG3, and paste the connection log here?

Please don't forget remove sensitive information from the log before upload it.

Thank you,

Thank you very much for your response. I have scrapped sensitive info from the debug log and uploaded.

core-tunnel-debug.txt (11.7 KB)

After comparing the debug output to the shell I was able to get the connection working. I am attaching a screenshot to help others in case they find themselves in a same situation.

From the log, the tunnel was established properly, but it seemed port 5901 on remote host was not reachable:

09:37:17 channel 2: open failed: connect failed: Connection timed out

Could you please press "Open Shell" button on the top-right, and execute following command to check port:

telnet localhost 5901

With the initial configuration I had which didn't seem to work for me this is the outcome of the telnet command

telnet localhost 5901
Trying ::1...
Connected to localhost.
Escape character is '^]'.

With the latest one that works with the updated screenshot, this is the output of the telnet command

telnet localhost 5901
Trying ::1...
Connected to localhost.
Escape character is '^]'.
RFB 003.008

Seemed you have solved problem :grinning:

If you want to forward to a port on remote host, usually you use localhost, not the internet domain name. Since your remote host may not allow external internet access on that port, and that is the reason why we use local forwarding – put remote insecure services under the protection of SSH.

to avoid this you could simply run
vncviewer -via user@tunnel user@<remote_ip>:NN
vncviewer will setup automatically the correct tunnel and port (the latter depends on the display port number NN).
I prefer this alternative because it avoids the additional creation of the tunnel by hand and correctly setting the port.