Vscode-docker: Remote Containers using SSH doesn't work in Windows

Created on 3 Dec 2019  路  8Comments  路  Source: microsoft/vscode-docker

Related to microsoft/vscode-remote-release#1935

  • I confirmed that I can successfully connect to the remote machine using SSH via command line
  • There is no error in the entire UI, just loading progress bars when opening the Docker viewlet
  • When running Attach to Running Container, nothing happens
  • When I open devtools, this is what I see:

image

P2 fix released

Most helpful comment

Ok, so I figured it out for my purposes -- finally.

My situation was practically identical to what @diablodale describes.

SOLUTION

Even though you have your keys setup and you can do example commands like docker -H ssh://user@ip ps, you can still run into auth issues because this extension is specifically making using of the "ssh-agent" under the hood.

_IMPORTANT: Don't get these steps confused with similar things that can be done in WSL. Things done in WSL do not affect the outcome. This extension does not use WSL under the hood even if you have your terminal configured to use WSL. You must have it setup through the means the Windows OS uses._

  1. Follow directions here to enable the Windows SSH-Agent. This addresses the errors with the \\.\pipe\openssh-ssh-agent in the message.
  2. Ensure that you have your SSH keys inside of <windows user folder>/.ssh/.
  3. Run ssh-add from powershell. This was the last part that I was missing and why I would get All configured authentication methods failed

In the end, would be nice if these errors were caught and the users were notified of the GUI of what actions might be needed.

All 8 comments

This is the Docker extension's viewlet. That should support ssh:// with the current release (https://github.com/microsoft/vscode-docker/issues/646). Moving there.

@joaomoreno Can you provide repro steps and what version of VS Code and vscode-docker you're using?

This was the latest VS Code Insider and latest vscode-docker from 6 days ago. I don't have access to the machine right now. I tested it on a fresh VM: install VS Code, Docker extension, Docker for Windows, Git for Windows, create SSH key, make sure you can ssh from Command Prompt solely using the key. Once all of that is done, simply configure the remote docker setting to the ssh:// format.

I am experiencing the exact same thing as @diablodale.

I was able to eliminate the "openssh-ssh-agent" error messages by starting the "ssh-agent" service in Windows 10: I found this helpful: https://stackoverflow.com/questions/52113738/starting-ssh-agent-on-windows-10-fails-unable-to-start-ssh-agent-service-erro

I am perplexed by this as I am able to run docker -H ssh://user@ip ps from Powershell and WSL just fine.

Additionally, I see theses messages if I open the vscode developer tools from Help:
mainThreadExtensionService.ts:66 Error: All configured authentication methods failed

Ok, so I figured it out for my purposes -- finally.

My situation was practically identical to what @diablodale describes.

SOLUTION

Even though you have your keys setup and you can do example commands like docker -H ssh://user@ip ps, you can still run into auth issues because this extension is specifically making using of the "ssh-agent" under the hood.

_IMPORTANT: Don't get these steps confused with similar things that can be done in WSL. Things done in WSL do not affect the outcome. This extension does not use WSL under the hood even if you have your terminal configured to use WSL. You must have it setup through the means the Windows OS uses._

  1. Follow directions here to enable the Windows SSH-Agent. This addresses the errors with the \\.\pipe\openssh-ssh-agent in the message.
  2. Ensure that you have your SSH keys inside of <windows user folder>/.ssh/.
  3. Run ssh-add from powershell. This was the last part that I was missing and why I would get All configured authentication methods failed

In the end, would be nice if these errors were caught and the users were notified of the GUI of what actions might be needed.

I agree with @zifik. There's nothing we can realistically do about the fact that our dependencies (dockerode, ssh2 Node packages) require an auth agent, at least not in the short term, but we can warn the user if they have an SSH DOCKER_HOST but no agent set up. A Learn More link to the Wiki page on SSH setup would probably also help.

We have improved the warnings for this in Docker extension version 1.0.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tecandrew picture tecandrew  路  6Comments

bpasero picture bpasero  路  5Comments

chrisdias picture chrisdias  路  7Comments

bradygmsft picture bradygmsft  路  7Comments

yusufkaratoprak picture yusufkaratoprak  路  4Comments