microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.64k stars 285 forks source link

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

Open KallDrexx opened 2 years ago

KallDrexx commented 2 years ago

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\\)
  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.

chrmarti commented 2 years ago

We could change the existing setting to support 'Never', 'For WSL paths (default)', 'Always'.

image