-
I am using the following setup:
What I want is to be able to utilize the "WSLg" feature that is present on the "docker-desktop" distribution that is running the container engine. I am using the attached simplistic Qt application to prototype it. When I open this project in VS Code I can build the devcontainer, run it, and then use the CMake extension to build the application successfully. When I try to run the application from VS Code it will fail, stating that no Qt Platform Abstraction (QPA) plugins could be utilized. If I open a terminal on the devcontainer and issue either As evident in the devcontainer.json file I have tried mapping these folders & variables into the devcontainer but if the sections are taken into use the build/run process will error out, stating that the folder I came across the VS Code setting "Dev > Containers: Execute in WSL" and I tried enabling it. This did not yield any help; instead the entire devcontainers feature of VS Code ceased operating correctly. I had to disable this option in order to be able to even open the folder in the container. I am not sure what to try next, and could use some advice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After looking into this issue a bit longer it seems that this is actually a bug in the If I install e.g. "Debian" distribution onto WSL2, set it as my default distribution, and then repeat this exercise then I do not have to do anything, and the Qt application "just works", like magic. The key setting in VS Code is "Dev > Containers: Forward WSLServices". This setting already mounts the folders and sets the environment variables. But when you only have I will probably file a bug report about this but I'll just need to figure out whose responsibility it is. Is it a bug in Docker Desktop's "system distro", or a bug in how the VS Code setting works... |
Beta Was this translation helpful? Give feedback.
After looking into this issue a bit longer it seems that this is actually a bug in the
docker-desktop
distribution.If I install e.g. "Debian" distribution onto WSL2, set it as my default distribution, and then repeat this exercise then I do not have to do anything, and the Qt application "just works", like magic.
The key setting in VS Code is "Dev > Containers: Forward WSLServices". This setting already mounts the folders and sets the environment variables. But when you only have
docker-desktop
distribution then it does not work correctly because for some reason this distribution uses/mnt/host/wslg/
folder to hold the files instead of/mnt/wslg
like stated in the WSLg documentation.I w…