-
Notifications
You must be signed in to change notification settings - Fork 308
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
Allow vscode to attach to containers (specifically Podman) running inside a WSL2 instance #5504
Comments
Due to the recent change in the Docker license/fees, I installed 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? |
@DougHaigh I have created #5550 to track your issue which seems to be different to the one reported here. Thanks. |
Sorry for taking a while... BTW, since 2021-09-07_20h28_09.mp4 |
@OmanF Make sure you have a folder open in WSL when trying to attach. (Tracked as microsoft/vscode#111371.) |
I'm not really sure what having a folder open in WSL is? At any rate, I tried the following:
Looks like the issue is that, although I changed the settings as you described in a previous screenshot, so my Edited: Adding a screencast. 2021-09-09_06h49_12.mp4 |
Got it, the case using a |
Great! Thank you very much! Using Looking forward to it. |
Unlike Docker, there are 2 options to communicate with Podman:
|
This might also help: I have 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). |
I'm running a WSL2 Ubuntu instance, itself running a Podman container. I would like to edit the code inside the container.
Using the remote development extensions I can only get the
Attach to WSL
option, but, as mentioned, the code resides in the container running inside the instance.I know that once connected to WSL I have the option to
Reopen folder in a dev container
, but that:Trying to directly choose
Remote - connect to a container
simply doesn't recognize the container (logically so, since it's on a logically different machine, the WSL instance).I would like that when I remote connect to a WSL instance, I can click the green, double-arrowed, "Connect to remotes" button and have the possibility to connect to containers running within that WSL instance (allowing me to use my own, Podman managed, containers, not pre-built, Docker-managed, dev containers).
Thank you.
The text was updated successfully, but these errors were encountered: