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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 17.0.0
    • 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

    Description

      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

      Qt Creator runs the container but fails to open a shell. Kits auto-detection silently fails and no kits are detected  

      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.

      A side effect is that prevents adding kits when not able to discover those within the container.

      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.

      Attachments

        Issue Links

          There are no Sub-Tasks for this issue.
          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes