I currently have a Fedora VM running on VMWare Fusion. I seem to have a very low success rate in getting VSCode to remotely access my Linux VM.
This is the error I get when VSCode fails to connect: Resolver error: Connecting with SSH timed out. If I connect using Apple’s Terminal application, I am able to connect just fine without any issues.
My Fedora VM set up to use public-key authentication (with password authentication disabled).
Hopefully someone can point me in the right direction.
Here is the configuration file that VSCode uses to connect to my Fedora VM.
Host fedora-vm-localdomain.local
HostName fedora-vm-localdomain.local
User user
IdentityFile ~/.ssh/id_rsa
And the log
[10:35:15.285] Log Level: 2
[10:35:15.287] [email protected]
[10:35:15.287] darwin x64
[10:35:15.288] SSH Resolver called for "ssh-remote+fedora-vm-localdomain.local", attempt 1
[10:35:15.288] SSH Resolver called for host: fedora-vm-localdomain.local
[10:35:15.288] Setting up SSH remote "fedora-vm-localdomain.local"
[10:35:15.291] Acquiring local install lock: /var/folders/br/cc0qz66x4fqdfj887s4f7jfh0000gn/T/vscode-remote-ssh-fedora-vm-localdomain.local-install.lock
[10:35:15.299] Looking for existing server data file at /Volumes/CaseSensitive/Users/userhost/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-fedora-vm-localdomain.local-ff915844119ce9485abfe8aa9076ec76b5300ddd-0.51.0/data.json
[10:35:15.300] Using commit id "ff915844119ce9485abfe8aa9076ec76b5300ddd" and quality "stable" for server
[10:35:15.301] Install and start server if needed
[10:35:15.303] Checking ssh with "ssh -V"
[10:35:15.310] > OpenSSH_8.1p1, LibreSSL 2.7.3
[10:35:15.312] askpass server listening on /var/folders/br/cc0qz66x4fqdfj887s4f7jfh0000gn/T/vscode-ssh-askpass-83c1f3cb27649778e3739b95784b3a4c7c663337.sock
[10:35:15.312] Spawning local server with {"ipcHandlePath":"/var/folders/br/cc0qz66x4fqdfj887s4f7jfh0000gn/T/vscode-ssh-askpass-bfd84e707cf953c3127ea9b6ff365dc1145b4ce7.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","57257","-o","ConnectTimeout=15","fedora-vm-localdomain.local"],"dataFilePath":"/Volumes/CaseSensitive/Users/userhost/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-fedora-vm-localdomain.local-ff915844119ce9485abfe8aa9076ec76b5300ddd-0.51.0/data.json"}
[10:35:15.312] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Volumes/CaseSensitive/Users/userhost/.vscode/extensions/ms-vscode-remote.remote-ssh-0.51.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Volumes/CaseSensitive/Users/userhost/.vscode/extensions/ms-vscode-remote.remote-ssh-0.51.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/br/cc0qz66x4fqdfj887s4f7jfh0000gn/T/vscode-ssh-askpass-83c1f3cb27649778e3739b95784b3a4c7c663337.sock"}
[10:35:15.314] Spawned 66235
[10:35:15.379] > local-server> Spawned ssh: 66236
[10:35:15.382] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[10:35:32.318] Terminating local server
[10:35:32.320] Resolver error: Connecting with SSH timed out
[10:35:32.322] ------
[10:35:32.323] Local server exit: 15
Try setting Host to the IP. I wonder if vscode is having issues with DNS.
I just installed the plugin and “works on my machine” so I’m not sure I’ll be able to help that much. Lemme dig into the plugin to see if we can’t get more debug output at least.
I think you are on to something. Using the IP address, allowed me to quickly connect to the VM without issues.
But I really don’t want to use the IP address if I can help it (since the address might change).
The weird thing is… setting this option seems to fix the connection issue.
Which I find odd since that option should only change the verbosity of the log.
Edit: Spoke too soon
[19:49:57.556] Log Level: 1
[19:49:57.559] [email protected]
[19:49:57.559] darwin x64
[19:49:57.561] SSH Resolver called for "ssh-remote+fedora-vm-localdomain.local", attempt 1
[19:49:57.561] SSH Resolver called for host: fedora-vm-localdomain.local
[19:49:57.561] Setting up SSH remote "fedora-vm-localdomain.local"
[19:49:57.564] Acquiring local install lock: /var/folders/br/cc0qz66x4fqdfj887s4f7jfh0000gn/T/vscode-remote-ssh-fedora-vm-localdomain.local-install.lock
[19:49:57.571] Looking for existing server data file at /Volumes/CaseSensitive/Users/hostuser/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-fedora-vm-localdomain.local-ff915844119ce9485abfe8aa9076ec76b5300ddd-0.51.0/data.json
[19:49:57.572] Using commit id "ff915844119ce9485abfe8aa9076ec76b5300ddd" and quality "stable" for server
[19:49:57.573] Install and start server if needed
[19:49:57.576] Checking ssh with "ssh -V"
[19:49:57.583] > OpenSSH_8.1p1, LibreSSL 2.7.3
[19:49:57.585] askpass server listening on /var/folders/br/cc0qz66x4fqdfj887s4f7jfh0000gn/T/vscode-ssh-askpass-28ba5a7b43de165ac2e256c081b9a59e0cd0647c.sock
[19:49:57.585] Spawning local server with {"ipcHandlePath":"/var/folders/br/cc0qz66x4fqdfj887s4f7jfh0000gn/T/vscode-ssh-askpass-c8bc35aa2836418845ae4a43593973307adfb91c.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","50451","-o","ConnectTimeout=15","fedora-vm-localdomain.local"],"dataFilePath":"/Volumes/CaseSensitive/Users/hostuser/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-fedora-vm-localdomain.local-ff915844119ce9485abfe8aa9076ec76b5300ddd-0.51.0/data.json"}
[19:49:57.585] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Volumes/CaseSensitive/Users/hostuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.51.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Volumes/CaseSensitive/Users/hostuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.51.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/br/cc0qz66x4fqdfj887s4f7jfh0000gn/T/vscode-ssh-askpass-28ba5a7b43de165ac2e256c081b9a59e0cd0647c.sock"}
[19:49:57.587] Spawned 1420
[19:49:57.649] > local-server> Spawned ssh: 1421
[19:49:57.652] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[19:49:57.652] stderr> debug1: Reading configuration data /Volumes/CaseSensitive/Users/hostuser/.ssh/config
[19:49:57.652] stderr> debug1: /Volumes/CaseSensitive/Users/hostuser/.ssh/config line 6: Applying options for fedora-vm-localdomain.local
[19:49:57.652] stderr> debug1: Reading configuration data /etc/ssh/ssh_config
[19:49:57.652] stderr> debug1: /etc/ssh/ssh_config line 47: Applying options for *
[19:49:57.790] stderr> debug1: Connecting to fedora-vm-localdomain.local [fe80::dc14:a05e:52aa:a21c%en0] port 22.
[19:50:12.796] stderr> debug1: connect to address fe80::dc14:a05e:52aa:a21c%en0 port 22: Operation timed out
[19:50:12.796] stderr> debug1: Connecting to fedora-vm-localdomain.local [fe80::dc14:a05e:52aa:a21c%en1] port 22.
[19:50:14.593] Terminating local server
[19:50:14.595] Resolver error: Connecting with SSH timed out
[19:50:14.597] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"Timeout","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","gotUnrecognizedPrompt":"0","remoteInConfigFile":"1"},"measures":{"resolveAttempts":1,"retries":1}}
[19:50:14.597] ------
[19:50:14.598] Local server exit: 15
That IP Address is correct fe80::dc14:a05e:52aa:a21c.
I did some testing on Terminal and it seems like my Mac has issues connecting to my Fedora VM through IPv6. But it works just fine on IPv4 (or through local domain resolution).
IPv6 has been a thorn in the spine of many a sysadmin for the last decade. Most companies don’t use it because of that.
There should have been a hard cut-over, because now we have two competing addressing systems running on the same network and they can’t talk to each other naturally, so you need servers to act as gateways. (they call them a 6to4 or 4to6 gateway)
I don’t really know how this would help you, but you got me going
I suspect you’re having issues with the IPv6 address because your local machine doesn’t have a IPv6 address on it, or it doesn’t have one on the proper interface.