Skip to content

Dev container with the wslc runtime hangs when the repo is on the WSL filesystem (works from Windows) #11750

Open

Description

  • VSCode Version: 1.128.1
  • Local OS Version: Windows 11 10.0.26200 (25H2)
  • Remote OS Version: WSL2 distro (kernel 6.18.35.2-microsoft-standard-WSL2); container image mcr.microsoft.com/devcontainers/base:ubuntu
  • Remote Extension/Connection Type: Dev Containers
  • Dev Containers extension: v0.465.0
  • @devcontainers/cli: 0.88.0
  • wslc: 2.9.4.0

Summary

Building/reopening a dev container using the wslc container runtime fails during container setup when the project folder lives on the WSL filesystem and VS Code is attached to or opened from WSL. The same dev container succeeds when the project folder is on the Windows filesystem (e.g. D:\...).

Minimal dev container to reproduce

.devcontainer/devcontainer.json:

{
    "name": "wslc-repro",
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/devcontainers/features/git:1": {}
    },
    "postCreateCommand": "echo 'postCreateCommand ran' && git --version && uname -a && cat /etc/os-release && whoami && pwd",
    "remoteUser": "vscode"
}

(No Dockerfile — a prebuilt image plus a single Feature is enough.)

Steps to Reproduce

Prerequisite: wslc runtime installed and selected as the Dev Containers Docker path.

A. From Windows (works):

  1. Put the folder above on the Windows filesystem, e.g. D:\wslc-repro.
  2. Open it in VS Code → Dev Containers: Reopen in Container.
  3. The image pulls, the Feature installs, the container starts, and postCreateCommand output appears.

B. From WSL (fails):

  1. Put the same folder inside a WSL distro on the Linux filesystem, e.g. /home/<user>/wslc-repro (\\wsl.localhost\<distro>\home\<user>\wslc-repro).
  2. Open it in VS Code → Dev Containers: Reopen in Container.
  3. Container setup does not complete.

What happens (observed in VS Code)

VS Code hangs. The "Setting up container" progress never completes and the container never opens. The Dev Containers setup log in the terminal freezes partway through and no error is shown — the last line printed is the Feature-content image build, after which there is no further output:

[8834 ms] * Fetched feature: git_0_oci version 1.3.8
[8841 ms] Start: Run: wslc.exe build -t dev_container_feature_content_temp -f /tmp/devcontainercli-<user>/container-features/<id>/Dockerfile.buildContent /tmp/devcontainercli-<user>/container-features/<id>

From the UI there is no indication of what failed; it simply appears stuck.

How the underlying error was found

Because VS Code surfaced no error, I re-ran the same Dev Containers CLI up command that VS Code invokes (it is printed earlier in the setup log) manually inside the WSL distro, adding --log-level debug. Run directly, the command does not hang — it errors out at a later step than where the VS Code terminal froze: the remote-user UID/GID build step.

Start: Run: wslc.exe build -f /tmp/devcontainercli-<user>/updateUID.Dockerfile-0.88.0 -t vsc-wslc-repro-<hash>-features-uid --platform linux/amd64 --build-arg BASE_IMAGE=vsc-wslc-repro-<hash>-features --build-arg REMOTE_USER=vscode --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=root /tmp/devcontainercli-<user>/empty-folder
Error: Command failed: wslc.exe build -f /tmp/devcontainercli-<user>/updateUID.Dockerfile-0.88.0 -t vsc-wslc-repro-<hash>-features-uid --platform linux/amd64 ...
{"outcome":"error","message":"Command failed: wslc.exe build ... --platform linux/amd64 ...","description":"An error occurred setting up the container."}

Running just that wslc build invocation on its own reports:

Argument name was not recognized for the current command: '--platform'

Note: this error text does not appear anywhere in the VS Code terminal during the failing "Reopen in Container" — it was only visible by re-running the CLI command manually.

Does this issue occur when you try this locally?: Yes (only when the project is on the WSL filesystem)

Does this issue occur when you try this locally and all extensions are disabled?: Not tested

Activity

  1. MikeEvansLarah commented on Jul 16, 2026

    @MikeEvansLarah

    I found this same issue. It does appear to be multiple problems.

    Firstly, enabling any features causes a hang here:

    [2406 ms] Start: Run: wslc build -t dev_container_feature_content_temp -f /tmp/devcontainercli-mike/container-features/0.88.0-1784207715786/Dockerfile.buildContent /tmp/devcontainercli-mike/container-features/0.88.0-1784207715786
    

    Running that same wslc build command in a WSL terminal succeeds for me though.

    Secondly, it seems the dev container CLI was updated in this PR devcontainers/cli#1249 to add WSLC support, but the updateRemoteUserUID function still forces the --platform argument, which wslc doesn't support.

    I did get a bit further by disabling all features, and setting updateRemoteUserUID to false:

    {
        "name": "wslc-repro",
        "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
        // "features": {
        //     "ghcr.io/devcontainers/features/git:1": {}
        // },
        "postCreateCommand": "echo 'postCreateCommand ran' && git --version && uname -a && cat /etc/os-release && whoami && pwd",
        "remoteUser": "vscode",
        "updateRemoteUserUID": false
    }

    But then it gets stuck waiting. I see Windows-style file paths (-l devcontainer.local_folder=\\wsl.localhost\Ubuntu\home\mike\repos\wslc-test) in the wslc run and wslc ps commands which doesn't seem right

    [1603 ms] Start: Starting container
    [1603 ms] Start: Run: wslc run -v /home/mike/repos/wslc-test:/workspaces/wslc-test -v vscode:/vscode -v /run/user/1000/wayland-0:/tmp/vscode-wayland-5df5afaf-28b7-4101-af6c-94d6584485bc.sock -l devcontainer.local_folder=\\wsl.localhost\Ubuntu\home\mike\repos\wslc-test -l devcontainer.config_file=/home/mike/repos/wslc-test/.devcontainer/devcontainer.json --entrypoint /bin/sh -l devcontainer.metadata=[{"id":"ghcr.io/devcontainers/features/common-utils:2"},{"id":"ghcr.io/devcontainers/features/git:1","customizations":{"vscode":{"settings":{"github.copilot.chat.codeGeneration.instructions":[{"text":"This dev container includes an up-to-date version of Git, built from source as needed, pre-installed and available on the `PATH`."}]}}}},{"remoteUser":"vscode"},{"postCreateCommand":"echo 'postCreateCommand ran' && git --version && uname -a && cat /etc/os-release && whoami && pwd","remoteUser":"vscode","updateRemoteUserUID":false}] mcr.microsoft.com/devcontainers/base:ubuntu -c echo Container started
    
    [5838 ms] Start: Run: wslc ps -q --filter label=devcontainer.local_folder=\\wsl.localhost\Ubuntu\home\mike\repos\wslc-test --filter label=devcontainer.config_file=/home/mike/repos/wslc-test/.devcontainer/devcontainer.json
    
  2. craigloewen-msft commented on Jul 17, 2026

    @craigloewen-msft
    Member

    Unfortunately right now wslc.exe is not supported inside of a WSL distro. You can run wslc.exe but bind mounting will be very difficult (This is because they run in separate VMs!)

    I created an issue to track this feature request here at the WSL repo: microsoft/WSL#41105

  3. vs-code-engineering commented on Oct 6, 2026

    @vs-code-engineering

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 10 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  4. rene-deltares commented on Oct 11, 2026

    @rene-deltares

    I would love for wslc to be able to bind-mount a folder from a WSL directory. Or even to checkout a repository in a volume and just mount that into the container instead.
    Installing Docker from within a WSL distribution, or Docker Desktop in Windows is currently the biggest hurdle for my teammates to start developing in dev containers. I would love it if they could just use WSL directly. But bind-mounting a Windows project folder into a linux container has some problems:

    1. File system performance takes a hit. As a result it takes much longer to compile when compared to bind-mounting a WSL folder.
    2. On Windows, git checks out most text files in our repo with windows line endings. For example, the Dockerfile I use for our devcontainer failed to build with wslc because of it (I know this can be worked around, but to illustrate the problem).
    3. People's personal .vscode/ settings (in .gitignore just to respect people's personal preferences) that they likely already have in their folder usually have Windows paths, which may have backslashes, drive letters or rely on case insensitivity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

containersIssue in vscode-remote containersfeature-requestRequest for new features or functionalitywslcDev Container using WSL containers

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions