-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attach to Podman container in WSL #5550
Comments
With regards to the specific licensing issue, the docker cli itself appears to be under an apache license, and available in a separate repository. Which means, I think, you can install just the CLI on windows, and then be able to connect to WSL as a "normal" remote machine (note that installing docker on WSL has issues due to the fact that systemd isn't usually started). |
... As an additional note, podman itself also has a remote client. The catch is that in order to be able to use it, you're required to enable a systemd service on the linux host. Which would negate a couple of advantages of using podman in the first place, if you tried to connect that way. |
I tried starting the podman server service in WSL2 and installing the podman remote client in Windows. I could run commands from a command line to have the server in WSL2 respond (after some special setup). This means the command 'podman' in WSL2 and 'podman' from a Windows command prompt would show the same thing. VSCode started in Windows still could not see the containers running in WSL2. VSCode started in WSL2 sometimes would by if I tried to use the container, it would fail to some up. VSCode uses some docker commands that do not exist in podman (like docker context) which may prevent it from working. |
@Clockwork-Muse Yeah, this was a copy-paste from the original issue as to what drove interest in the topic. Removed that from the body since it's not directly related as you point out. We should consider that bit "off topic." These issues are not a great place to discuss specifics of licensing in general since the committers here do not work for Docker. Places like this topic in Docker's forums are better. In general though, totally fair request otherwise. |
@Chuxel - It was meant as a "here's a possible workaround, if you need it", rather than a discussion about the licensing in general. |
Hopefully, the "official" WSL distro with the corresponding Podman version inside will be released very, very, very soon. |
Got it running by following https://www.redhat.com/sysadmin/podman-windows-wsl2 to install Podman on Ubuntu in WSL2 (libpod.conf has been renamed to containers.conf since that article was posted). Currently one has to make sure to have a folder open while being connected with Remote-WSL, otherwise Remote-Containers cannot lookup the WSL distro (tracked as #4913). |
Fixed a case where using a |
@chrmarti - Also, podman doesn't create the config file by default when My own case is weirder because I want to move the image location off the os drive for space reasons. |
Added a user setting to always run commands in WSL, also for Windows paths and when there is no local path when attaching to an existing container (#5539). |
Also fixing #4913 which affected empty SSH and empty WSL windows. |
Running with a non-root user inside the container still requires updating the "containerEnv": {
"HOME": "/home/node"
},
"runArgs": [
"--userns=keep-id"
] |
The original issue no longer reproduces in the upcoming 0.196.0 (and maybe before that). Additional fixes are mentioned above. Closing as done. |
I tried installing podman in my WSL2 Ubuntu image. I have podman running my dev container (my-dev-container) in WSL2 also. I have made the change you stated so that 'podman' is my docker path.
From WSL2 command prompt I run 'code .' and VSCode (Windows) comes up. I select 'Remote-Containers: Attach to running container' and it shows the podman container (my-dev-container). I select it.
It starts another VSCode window and pops up the error 'Cannot attach to the container with the id/name my-dev-container, it no longer exists along with the options 'Chose Container', 'More Actions' and 'Close Remote'. I select the 'Chose Container' and it pops up an error 'Docker version 17.12.0 or later required'. Repeat the process and select 'More Actions' and see 'Chose container' and it gives the same error. I believe the error is because there is no 'podman.exe' even though I am running in a WSL2 window.
How can it connect to the running container and develop code in it?
Originally posted by @DougHaigh in #5504 (comment)
The text was updated successfully, but these errors were encountered: