microsoft / microsoft/vscode-remote-release

"shutdownAction": "stopContainer" does not respect setting "Execute in WSL"

Open
#11,216 1 comment 2 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Sep 22, 2025.

bug containers
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I only have the docker engine installed in my WSL distribution and not on my host machine, so all docker commands must be issued in WSL. Which is why I have "Dev Containers: Execute in WSL" selected in settings. When I set "shutdownAction": "stopContainer" in my devcontainer.json, it is attempting to run the docker commands on the host machine instead of in WSL.

  • VSCode Version: 1.104.0
  • Local OS Version: 10.0.26100
  • Remote OS Version: Ubuntu 22.04.5 LTS
  • Logs:
[2025-09-22T17:28:06.980Z] Unexpected error: Error: Exectuable 'docker' not found on PATH '{omitted}'.
    at So (c:\Users\{myUser}\.vscode\extensions\ms-vscode-remote.remote-containers-0.427.0\dist\shutdown\shutdownMonitorProcess.js:36:1381)
    at async c:\Users\{myUser}\.vscode\extensions\ms-vscode-remote.remote-containers-0.427.0\dist\shutdown\shutdownMonitorProcess.js:37:619
    at async Gt (c:\Users\{myUser}\.vscode\extensions\ms-vscode-remote.remote-containers-0.427.0\dist\shutdown\shutdownMonitorProcess.js:30:2108)
    at async PS (c:\Users\{myUser}\.vscode\extensions\ms-vscode-remote.remote-containers-0.427.0\dist\shutdown\shutdownMonitorProcess.js:37:5682)
    at async DS (c:\Users\{myUser}\.vscode\extensions\ms-vscode-remote.remote-containers-0.427.0\dist\shutdown\shutdownMonitorProcess.js:37:7368)
    at async c:\Users\{myUser}\.vscode\extensions\ms-vscode-remote.remote-containers-0.427.0\dist\shutdown\shutdownMonitorProcess.js:37:6553

Steps to Reproduce:

  1. Install the Docker engine in WSL only (not on the host machine)
  2. Install VS Code
  3. Configure VS Code to execute commands in WSL
  4. Configure workspace with "shutdownAction": "stopContainer" in devcontainer.json
  5. Reopen workspace in Dev Container
  6. Exit VS Code

Observe that the container is still running

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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.