WSL with Podman on Windows

WSL with Podman on Windows

This article explains the activation of WSL2 in Windows and the installation of Podman.

Install WSL on a Recent Windows

In a priviledged PowerShell the following command must be executed:

wsl --install

If wsl is already installed, you’ll see a help text.

Install Podman

Only the Podman CLI is needed to run Containers. Podman Desktop is not needed. You can find the releases of the Podman CLI at https://github.com/containers/podman/releases.

Download the Asset of a latest Release (i.E. podman-installer-windows-amd64.exe) and start the installation process.

Once you reach this screen:

image-20250604-061421.png

You select the Windows Linux Subsystem (WSLv2) Option and continue the installation process.

Since Podman does not run naively on Windows, the WSL-Environment for it needs to initialized first. Open a Terminal and run the following commands to initialize and start the Podman Environment:

> podman machine init Looking up Podman Machine image at quay.io/podman/machine-os-wsl:5.5 to create VM Getting image source signatures Copying blob 4fdeac6595b9 done | Copying config 44136fa355 done | Writing manifest to image destination 4fdeac6595b9a1382f2b97088f1c6d6e4c503d1558d5472269294a3a2c0398b1 Extracting compressed file: podman-machine-default-amd64 [=====================================>--] 181.4MiB / 1Extracting compressed file: podman-machine-default-amd64: done Importing operating system into WSL (this may take a few minutes on a new WSL install)... Import wird ausgeführt. Dieser Vorgang kann einige Minuten dauern. Der Vorgang wurde erfolgreich beendet. Configuring system... Machine init complete To start your machine run: podman machine start PS C:\Users\j.saalfeld> podman machine stasrt Error: unrecognized command `podman machine stasrt` Try 'podman machine --help' for more information > podman machine start Starting machine "podman-machine-default" This machine is currently configured in rootless mode. If your containers require root permissions (e.g. ports < 1024), or if you run into compatibility issues with non-podman clients, you can switch using the following command: podman machine set --rootful API forwarding listening on: npipe:////./pipe/docker_engine Docker API clients default to this address. You do not need to set DOCKER_HOST. Machine "podman-machine-default" started successfully

To verify, that the locally installed CLI is properly connected to the now running environment, you can check the connection between the programs:

> podman system connection list Name URI Identity Default ReadWrite podman-machine-default ssh://user@127.0.0.1:51578/run/user/1000/podman/podman.sock C:\Users\user\.local\share\containers\podman\machine\machine true true podman-machine-default-root ssh://root@127.0.0.1:51578/run/podman/podman.sock C:\Users\user\.local\share\containers\podman\machine\machine false true

Autostart the podman-machine-default WSL Environment

  1. Open Task Scheduler (or Aufgabenplaner in German) via the Start-Bar

  2. On the right side you can find the Create Task… Entry

  3. Enter “Start Podman Machine” as Name

  4. Enter the Configuration for “Windows 10”

  5. Select the “Triggers” Tab

  6. Choose At startup from the Begin the task menu

  7. Click the OK button

  8. Go to the Actions tab and click the New button.

  9. Enter the podman as command and machine start as arguments

  10. Accept every upcoming prompt - you may need to re-enter your password

  11. Verify podman-default-machine is running podman machine ls

  12. Reboot

  13. Verify again, that the podman-default-machine is runing by running podman machine ls

> podman machine ls NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE podman-machine-default* wsl 11 minutes ago Currently running 6 2GiB 100GiB