Vscode-remote-release: Container Extension using 127.0.0.1 instead of localhost has unexpected results with WSL 2.0 & Docker

Created on 20 Sep 2019  路  16Comments  路  Source: microsoft/vscode-remote-release

  • VSCode Version: 1.39.0-insider
  • Local OS Version: Windows Insiders 18985
  • Remote OS Version: Ubuntu 18.04
  • Remote Extension/Connection Type: Containers Extension with WSL

Steps to Reproduce:

  1. Install WSL 2.0 following this procedure
  2. Install Docker Engine inside WSL and start the service
  3. Follow this procedure to expose WSL's docker instance to docker-cli on Windows
  4. Make sure you're able to run Docker from Windows using the WSL's instance
    image
  5. Clone the vscode-remote-try-node repo
  6. Open it with VSCode, press F1, type Reopen in container.
    Get an error
    image
    I know for sure I can access the Docker daemon with localhost:2375, but it seems with the networking quirks of WSL 127.0.0.1 doesn't seems to map correctly to localhost as expected.

EDIT:
When I tried changing my Windows ENV variables with 127.0.0.1, I wasn't able to access the daemon. So this is clearly the issue. Is there a way to change which hostname the extension use to connect so I can point it to localhost instead of 127.0.0.1?
image


Does this issue occur when you try this locally?: Yes

bug containers upstream

All 16 comments

That's connecting into WSL with the Remote - Containers extensions...

Hi @aeschli, thanks for checking my issue.

The thing is that I don't want to connect to the WSL itself, I know I can use the Remote - WSL Extension to access files inside and do my development there, but I want to connect to a docker container that is running inside WSL. That's why I had to install docker-cli on Windows also.

@Drakota No problem, thanks for reporting, we'll look into it!

@Drakota You could try setting the DOCKER_HOST environment variable. Or if you also have the Docker extension installed, try setting the Docker Host setting. /cc @Chuxel

Was this page helpful?
0 / 5 - 0 ratings