Get WSL Version ^0.67.6

Just this week systemd support was announced in WSL2! For me, I didn’t automagically get the update in Windows Store and had to manually install it from WSL Releases (version 0.67.6 or greater).

I don’t think you actually need systemd for podman support 🤣, but the release just made me feel like trying it again.

Enable Systemd

Update /etc/wsl.conf to contain:

[boot]
systemd=true

Fix User Runtime Directory

Arkane Systems - Bottle Imp helps fix this and provide additional tooling for keeping WSL alive. Right now, I only use the systemd user-runtime-dir override and the scripts it relies on.

Reinstall shadow-utils on Fedora

Found this out from Using podman on windows subsystem for linux to reinstall shadow-utils:

sudo dnf reinstall shadow-utils

Install toolbox and configure podman

Install toolbox and runc:

sudo dnf install -y toolbox runc

This will also install podman (at least on Fedora).

By default, if you try to enter a toolbox you’ll run into some issues, digging into the messages, I found this issue. Where it mentioned trying runc, which worked for me.

Copy the default config and update ot to use runc:

cp /usr/share/containers/containers.conf ~/.config/containers/containers.conf

Open the config file with your favorite text editor and update the runtime to runc (uncomment the line if it commented out by default):

runtime = "runc"

Restart WSL

Restart WSL (from Windows):

wsl --shutdown

Try entering a toolbox

toolbox enter

This should hopefully work now!

Why toolbox?

The fedora docs explain why nicely here. Even if you don’t use Fedora Silverblue, it’s just nice to be able to spin up a temporary environment with dependencies you don’t plan to keep around (and might forget to remove later).