vscode-remote-x11 icon indicating copy to clipboard operation
vscode-remote-x11 copied to clipboard

Error: Timed out while waiting for handshake

Open KenYN opened this issue 5 years ago • 7 comments

My terminal window and stand-alone Putty both connect fine, but I cannot get the connection made. My Output is as follows:

Remote X11:

Setting up display for remote "ssh-remote".
Connecting to SSH. See Remote X11 (SSH) logs for more details.
Error: Timed out while waiting for handshake

Remote X11 (SSH)

Connecting to [email protected] port 22
Error: Timed out while waiting for handshake

Also:

$ echo $SSH_CONNECTION
10.77.8.68 26826 10.208.6.84 22

I'm not sure what the next step is. I'm running Xming with its default settings on Windows 10.

KenYN avatar May 22 '20 03:05 KenYN

Are you able to connect with standalone PuTTY using the second IP address in SSH_CONNECTION? If not, set the remoteX11.SSH.host setting to whatever hostname or IP address you use when connecting to the server normally.

joelspadin avatar May 22 '20 04:05 joelspadin

Yes, both stand-alone Putty and Remote-SSH connect just fine. I'm at home, logging into the work VPN (which is the 10.77.8.68) then logging into a computer within the office intranet.

KenYN avatar May 22 '20 04:05 KenYN

Error: Timed out while waiting for handshake usually means it isn't able to find the SSH server. Either the address and port are incorrect, or a firewall is blocking it.

Have you tried setting remoteX11.SSH.host to the hostname or IP address you use to connect to it normally? Also, do you use port 22 to connect? If not, you need to change the removeX11.SSH.port setting.

joelspadin avatar May 22 '20 23:05 joelspadin

I had the same problem but I have solved it.

I was trying to connect a computer in the local network of my company and I was outside the network. I can use the public IP address to connect the computer instead of local IP address. However, remote-X11 use the local IP address of local network.

Setting remoteX11.SSH.host to the public IP address is the right solution. At least it works for me.

mapengfei-nwpu avatar Jul 08 '20 12:07 mapengfei-nwpu

I had the same problem but I have solved it.

I was trying to connect a computer in the local network of my company and I was outside the network. I can use the public IP address to connect the computer instead of local IP address. However, remote-X11 use the local IP address of local network.

Setting remoteX11.SSH.host to the public IP address is the right solution. At least it works for me.

I use the remote X11 in the same case. But it can only work in the local network. I have set the remoteX11.SSH.host and remoteX11.SSH.port, but it the ouput shows that didn't work. Output-----Remote X11(SSH)

Connecting to [email protected] port 22
Error: Timed out while waiting for handshake

Output-----Remote X11

Setting up display for remote "ssh-remote".
Connecting with SSH. See Remote X11 (SSH) logs for more details.
Error: Timed out while waiting for handshake

My remote X11 settings:

"remote.SSH.remotePlatform": {
        "Work": "linux",
    },
    "terminal.integrated.env.linux": {
    },
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    "remoteX11.display": 10,
    "remoteX11.SSH.host": "222.1**.***.***",
    "remoteX11.SSH.privateKey": "~/.ssh/id_rsa_workX",
    "remoteX11.SSH.port": 2222,

Here I map port 22 of the computer(linux) to port 2222 of the router through UPNP. I reloaded the window by Developer: Reload the window and even rerun the vscode and reinstall the remote X11. But the output of Remote X11(SSH) didn't change. I think the key may be the port forwarding. But I can't solve this problem.

WXZhao7 avatar Aug 18 '20 03:08 WXZhao7

@WX-Zhao does that IP address and port match what you use to connect to your "Work" remote? Do you need to set any other options (command line flags, a different username, etc.) to connect?

joelspadin avatar Aug 19 '20 23:08 joelspadin

@ChaosinaCan The IP address and port are consistent with the SSH setting. I explained my problem in https://github.com/ChaosinaCan/vscode-remote-x11/issues/27#issue-680954886.

WXZhao7 avatar Aug 20 '20 01:08 WXZhao7