joelspadin / vscode-remote-x11

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

IPv6 problem? #13

Closed LazyRichard closed 4 years ago

LazyRichard commented 4 years ago

Thank you for great extensions.

but i had some problem with IPv6.

when i using mDNS. then SSH connection is using IPv6.

but when IPv6, extension error occured.

Remote Server ip addr show

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:a4:b2:02 brd ff:ff:ff:ff:ff:ff
    inet 172.21.232.76/20 brd 172.21.239.255 scope global dynamic noprefixroute eth0
       valid_lft 81159sec preferred_lft 81159sec
    inet6 fe80::eefa:b07d:7ae7:aa6d/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Remote Server - $SSH_CONNECTION

ubuntu@ubuntu-Virtual-Machine:~/$ echo $SSH_CONNECTION
fe80::fcd3:1281:d208:aa3d%eth0 51647 fe80::eefa:b07d:7ae7:aa6d%eth0 22

VsCode Output - Remote X11 (SSH)

Connecting to ubuntu@fe80::eefa:b07d:7ae7:aa6d%eth0 port 22
DEBUG: Local ident: 'SSH-2.0-ssh2js0.4.10'
DEBUG: Client: Trying fe80::eefa:b07d:7ae7:aa6d%eth0 on port 22 ...
Error: Timed out while waiting for handshake
joelspadin commented 4 years ago

Connecting with IPv6 works for my setup (two computers connected to the same local network).

Is your remote server on the same local network as the computer running vscode? Your IPv6 address looks like a link-local address since it starts with fe80. If you're not on the same local network, it won't be able to use that address to connect. Try setting the remoteX11.SSH.host setting to match whatever address or hostname you used to create the remote connection in VS Code.

LazyRichard commented 4 years ago

The reason to IP address start with fe80 is remote computer is VM inside hyper-v in host computer.

the address in SSH_CONNECTION has interface name

fe80::eefa:b07d:7ae7:aa6d**%eth0**

I think the problem caused by the interface name.

because when i delete interface name in address. then works fine

joelspadin commented 4 years ago

That's odd. I can connect regardless of whether there's a scope ID at the end.

I'm not completely familiar with how IPv6 works, but it seems like I can probably always strip the scope ID off any address from SSH_CONNECTION.