vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Dev Containers invokves wsl commands despite DOCKER_HOST and no Remote - WSL Extension

Open keith-gray-powereng opened this issue 7 months ago • 4 comments

I am trying to run a dev container with podman. No matter what I do, vscode always starts a WSL instance to run podman rather than using podman on Windows (yes, I know podman runs in a WSL instance but vscode starts runs it in a completely different instance). I have tried everything I and my friendly LLM can think of to troubleshoot this.

  • VSCode Version: 1.100.3
  • Local OS Version: Windows 11 Enterprise 10.0.22631 Build 22631
  • Remote OS Version: Podman desktop v1.19.1
  • Remote Extension/Connection Type: Dev Containers 0.413.0
  • Logs:
[71 ms] Dev Containers 0.413.0 in VS Code 1.100.3 (258e40fedc6cb8edf399a463ce3a9d32e7e1f6f3).
[70 ms] Start: Resolving Remote
[120 ms] Setting up container for folder or workspace: c:\Users\kgray\Software\sas-applications
[120 ms] Host: npipe:////./pipe/docker_engine
[179 ms] Start: Run: wsl -l -v
[455 ms] Start: Run: wsl -d AlmaLinux9 -e /bin/sh -c echo ~
[990 ms] Start: Run: wsl -d AlmaLinux9 -e /bin/sh -c cd '/home/keith' && /bin/sh

Steps to Reproduce:

  1. Install podman desktop on Windows 11
  2. Install vscode with the dev containers plugin
  3. Change the Dev > Containers: Docker Path to be podman
  4. Change the Dev > Containers: Docker Socket Path to be npipe:////./pipe/docker_engine
  5. Set the DOCKER_HOST environment variable in windows to be npipe:////./pipe/docker_engine
  6. Install the docker cli with winget install --id Docker.DockerCLI
  7. Dev > Containers: Execute in WSL is unchecked
  8. Dev > Containers: Execute in WSLDistro is blank
  9. terminal.integrated.env.windows = {"DOCKER_HOST": "npipe:////./pipe/docker_engine"}
  10. containers.containerClient = "com.microsoft.visualstudio.containers.podman"
  11. In a powershell prompt inside of vscode, docker context ls produces ``` NAME DESCRIPTION DOCKER ENDPOINT ERROR default * Current DOCKER_HOST based configuration npipe:////./pipe/docker_engine
    Warning: DOCKER_HOST environment variable overrides the active context. To use a context, either set the global --context flag, or unset DOCKER_HOST environment variable.

<!-- Check to see if the problem is general, with a specific extension, or only happens when remote -->
Does this issue occur when you try this locally?: NA
Does this issue occur when you try this locally and all extensions are disabled?: NA

<!-- If your issue only appears in Codespaces, please visit: https://github.com/github/feedback/discussions/categories/codespaces-feedback -->

Please let me know if I can provide any more information.

Thank you in advance.

keith-gray-powereng avatar Jun 12 '25 04:06 keith-gray-powereng

Try disabling:

Image

chrmarti avatar Jun 12 '25 09:06 chrmarti

Try disabling:

Image

Thank you for the suggestion. I just tested it and get the same result, vscode starts working in WSL.

keith-gray-powereng avatar Jun 12 '25 11:06 keith-gray-powereng

Could you try also disabling the WSL service forwarding:

Image

I think both settings need to be disabled to completely prevent the use of WSL.

chrmarti avatar Jun 13 '25 07:06 chrmarti

@chrmarti Thank you sooo much, this finally did it. This issue can be closed. Thank you both.

[53 ms] Dev Containers 0.417.0 in VS Code 1.101.0 (dfaf44141ea9deb3b4096f7cd6d24e00c147a4b1).
[53 ms] Start: Resolving Remote
[92 ms] Setting up container for folder or workspace: c:\Users\kgray\Software\sas-applications
[92 ms] Host: npipe:////./pipe/docker_engine
[138 ms] Start: Check Docker is running
[138 ms] Start: Run: podman version
[822 ms] Client:       Podman Engine
Version:      5.5.0
API Version:  5.5.0
Go Version:   go1.24.2
Git Commit:   0dbcb51477ee7ab8d3b47d30facf71fc38bb0c98
Built:        Wed May 14 10:44:25 2025
OS/Arch:      windows/amd64

Server:       Podman Engine
Version:      5.5.0
API Version:  5.5.0
Go Version:   go1.23.8
Git Commit:   0dbcb51477ee7ab8d3b47d30facf71fc38bb0c98
Built:        Tue May 13 19:00:00 2025
OS/Arch:      linux/amd64

keith-gray-powereng avatar Jun 13 '25 13:06 keith-gray-powereng

Great, thanks!

chrmarti avatar Jun 18 '25 09:06 chrmarti