microsoft / microsoft/vscode-remote-release

Docker not being executed in windows when a \\wsl$\ folder is opened

Open
#7,080 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

  • VSCode Version: 1.70.1
  • Local OS Version: Windows 11 21H2 22000.856
  • Remote OS Version: N/A
  • Remote Extension/Connection Type: SSH/Containers/WSL/Server: Container
  • Logs:
    container logs.txt

Steps to Reproduce:

  1. Open docker desktop -> settings -> Resources -> WSL Integration
  2. Deselect Enable integration with my default WSL distro
  3. Deselect all "additional" distros and save (make sure it persists)
  4. In WSL verify the docker command doesn't work
  5. In VScode go into the settings json and set remote.containers.executeInWSL to false
  6. Open a folder in a WSL path (e.g. \wsl$\Ubuntu\home<user><code-dir>)
  7. Reopen in container
    ---> Observe error that docker is not installed

If you open a folder in a native windows path (e.g. C:\Users\user\code-dir) this does not occur and it opens in the container successfully.

Does this issue occur when you try this locally?: N/A
Does this issue occur when you try this locally and all extensions are disabled?: N/A


It appears that if you open a folder in a WSL path, the remote extensions forces the docker commands to run from within the default WSL2 installation and not on the windows host.

Our team tends to have code hosted within the WSL file system as we've noticed significant improved build and intellisense times than when on the windows partition.

Running docker from windows instead of from WSL is important because our project requires host networking, and host networking does not work if Windows docker desktop is executed via a docker run execution inside of WSL, but does work when executed from within windows powershell. By "does not work" I mean zero networked services created by the container are reachable from windows or WSL.

I cannot find any way to force this plugin to use windows docker command instead of WSL's docker command.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using a folder under \wsl$ and the remote.containers.executeInWSL setting, comparing it with a native Windows path. Review the attached container logs and the code path that invokes docker; done means reopening the WSL-hosted folder uses the Windows Docker command successfully when WSL execution is disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
devops, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.