Everything required to use Podman error-free with Dev Containers on WSL2 #25607
worldofgeese
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This guide is intended to spark a discussion about the many papercuts Windows developers will face when configuring Podman with Dev Containers on WSL2. All steps detailed here were necessary for achieving a successful, error-free, setup.
Is there any appetite from Podman devs to do a virtual "empathy session" where we all sit down and attempt to run the example Dev Container on WSL2, starting from zero? I think it could be fun! 😄 🪿 🌎
cc @n1hility @rhatdan who I've had fruitful discussions with in the past when I first created #15338.
Step 1: Initialize a Podman machine
Step 2: Resolve broken
podman stats
Follow these steps:
Open your WSL2 configuration file at
%UserProfile%\.wslconfig
.Add or update the following configuration:
Save the file.
This configuration disables cgroups v1, enabling cgroups v2, and resolves microsoft/WSL#10050.
Step 3: Resolve shared mount warning
If you receive this warning:
Run these commands:
This resolves microsoft/vscode-remote-release#9303.
Step 4: Resolve rootless Podman issues
To work around issues with rootless Podman (such as permissions issues creating and manipulating directories and files), set the following in
devcontainer.json
:Step 5: Allow locally built images to be pulled
For error,
Pinging container registry localhost connection refused
, create a custom Podman configuration file:This resolves #19856
Step 6: Enable VS Code to connect to Podman socket
For error,
RemoteSocket: path: /mnt/wslg/runtime-dir/podman/podman.sock is not available.
modify or create /etc/wsl.conf within your Podman Machine to add:This resolves #16861
For context, see #15190 (comment):
Step 7: Restart WSL2
Example configuration files
Utilize these configuration examples for your Dev Container setup:
docker-compose.yml
Dockerfile
devcontainer.json
Beta Was this translation helpful? Give feedback.
All reactions