Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 16.0.2
-
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)
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:
- Install Qt Creator on Windows 11.
- Enable Docker Desktop with WSL2 integration.
- Add a Docker device in Qt Creator using an image with bash and build tools
- Ensure the container is detected and running.
- 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
- is duplicated by
-
QTCREATORBUG-33092 Docker Device Integration Fails to Open Shell – "Could not read container environment"
-
- Closed
-
-
QTCREATORBUG-33094 Docker Device Integration Fails to Open Shell – "Could not read container environment"
-
- Closed
-