Open worldofgeese opened 2 years ago
@n1hility PTAL
This is most likely happening because vscode is running commands directly via wsl which is not entering the nested namespace with systemd. I have not yet gotten to exploring a vscode specific solution, but it might require "code" being launched within the wsl instance (as opposed to externally). Alternatively if they provide a hook to wrap their launcher, commands can be prefixed with enterns
which will run them inside the proper namespace.
A friendly reminder that this issue had no activity for 30 days.
@n1hility Any chance to look at this?
Just a thought that WSL's new native support for systemd may be useful here.
@worldofgeese yes it would. Although it’s only Win 11 atm so we can’t rely on it just yet.
This is still on my radar it’s just been lower priority than other work. I’ll try to find some cycles soon
Devcontainers with podman would be awesome. Are there any workarounds for this, facing this same issue.
A friendly reminder that this issue had no activity for 30 days.
This is a very severe issue on windows, please don't let it be swept under the rug as there are no workarounds.
@TheComputerM i should be able to look at this this week.
Any updates or workarounds that work with podman v4.4.1?
Unfortunately the current nested namespace approach we need to run systemd prevents it from working reliably. You can make it work if you edit their launch script, and manually launch it, but launching via the IDE fails, and it does update itself so that solution is temporary. One approach that might be workable, is to bind mount the podman socket from the podman machine distro into /mnt/wsl/podman.sock and then use a different distro for vscode integration, which can access that podman.sock file (although you have to reconfigure DOCKER_HOST in your vscode config) We have a feature request I plan to get to soon which will automate setting up the bind for you, but in the meantime you can just do that manually yourself, (for example by installing a custom systemd service to create the mount). Another option is you can still use the ssh integration instead of the WSL integration with vscode, I did successfully get that working.
In the medium term I think the final resolution to this will be the move to WSL's new systemd integration, which should be compatible with the viscose approach. We were waiting on that becoming more widely available, and that has recently occurred, now all versions of WSL will update to the store version after windows updates are applied, and someone runs wsl --update.
Limited workaround: we have configured SSH server running in the container (as the container is some DEV purpose only) ... and then connect from VsCode via SSH remote
Still getting this kind of error, will be trying the ssh workaround and running code inside distro. Im facing this issue rn at my personal win11 and company's win10.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
VS Code fails opening a project cloned into a rootless or rootful
podman machine
as a dev container withpermission denied
Steps to reproduce the issue:
podman machine init
podman machine start
wsl -d podman-machine-default
git clone https://github.com/microsoft/vscode-remote-try-python
Open folder for Python devcontainer in VS Code and click the pop-up offering to re-open in a Development Container
Describe the results you received:
Describe the results you expected:
VS Code should reopen a project containing a dev container as a dev container successfully.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
This is neither a yes or a no as it appears the Windows binary is 4.2.0 but the podman machine it spawns is 4.1.1
Additional environment details (AWS, VirtualBox, physical, etc.): Windows 11 with podman machine loaded into WSL2.
In VS Code the following are set in its
settings.json
: