joelspadin / vscode-remote-x11

Visual Studio Code extension that sets the DISPLAY environment variable in remote workspaces
39 stars 9 forks source link

Error: Timed out while waiting for handshake #15

Open KenYN opened 4 years ago

KenYN commented 4 years ago

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 account_name@10.208.6.84 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.

joelspadin commented 4 years ago

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.

KenYN commented 4 years ago

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.

joelspadin commented 4 years ago

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.

mapengfei-nwpu commented 4 years ago

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.

WXZhao7 commented 4 years ago

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 zhao@192.168.123.123 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.

joelspadin commented 4 years ago

@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?

WXZhao7 commented 4 years ago

@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.