Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-33094

Docker Device Integration Fails to Open Shell – "Could not read container environment"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 16.0.2
    • Docker
    • None
    • Qt Creator version: 16.0.2
      OS: Windows 11
      Docker Desktop with WSL2 backend
      Shell: Git Bash / MSYS2 (issue), PowerShell (works with slight command modifications)
    • Windows

      When configuring a Docker device in Qt Creator on Windows 11 (with Docker Desktop and WSL2 integration), attempting to open a shell in the container results in the following error:

      Could not read container environment: The system cannot find the path specified

      Steps to Reproduce:

      1. Install Qt Creator on Windows 11.
      2. Enable Docker Desktop with WSL2 integration.
      3. Add a Docker device in Qt Creator using an image with bash and build tools
      4. Ensure the container is detected and running.
      5. Click "Open Shell in Container".

      Expected Result: A shell should open inside the container.

      Actual Result: An error banner appears:
      Could not read container environment: The system cannot find the path specified

      And logs show:

      {{docker.exe exec ... /bin/sh -c 'type /tmp/qtc_cmdbridge >/dev/null && echo __qtc$$qtc_ && exec /tmp/_qtc_cmdbridge'
      stderr: "The system cannot find the path specified."}}

      Additional Information.

      Possible root cause, Qt Creator generates a Docker --mount command using MSYS2-style paths like:

      --mount type=bind,source=/C/Qt/Tools/QtCreator/bin/cmdbridge-linux-amd64,destination=/tmp/_qtc_cmdbridge

      These paths are not valid for Docker on Windows unless explicitly mapped. Even when a junction is created (e.g., C:\C\Qt\...), Qt Creator still fails to resolve the path internally, although manual Docker runs succeed.

      Suggestion:

      • Qt Creator should normalize or validate mount paths for Docker on Windows.
      • Ideally, allow users to manually override the generated Docker command or mount paths in the Docker device configuration.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            madwinter Marcus Tillmanns
            lalvarez Luis Alvarez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes