Hacker News new | ask | show | jobs
by sarahdellysse 1129 days ago
Anyone have any experience running Windows and WSL2 with Podman Desktop? I'm running W11, with fedora in WSL2. What I've been doing with Docker Desktop is running Docker Desktop on Windows startup, and that gives me access to the docker machine in both powershell and inside my wsl2 environment (for the latter, docker-desktop installs a binary inside fedora-wsl2 at `/usr/local/bin/docker` that communicates to the host)

So far, I uninstalled Docker-Desktop and installed Podman-Desktop, and now I can run `podman` from powershell but not from fedora. I'm about to try `sudo dnf install podman` and hope it connects to the podman-machine? I dunno, it's not exactly clear

2 comments

> now I can run `podman` from powershell but not from fedora. I'm about to try `sudo dnf install podman` and hope it connects to the podman-machine? I dunno, it's not exactly clear

One thing you could do is just symlink or wrap the Windows podman.exe as `podman` on your WSL guests, and rely on WSL interop at the CLI instead of sharing a socket. This is probably what Docker Desktop does, based on your description (I thought it (used to?) share(s) a socket from the dedicated WSL guest it creates to your other WSL guests).

Alternatively, if you install Podman Desktop via Scoop and have WSL interop enabled for your guests (so that your Windows binaries appear on your Linux guests' PATHs), I think you'll get the same `podman` as your Windows PowerShell sessions access onto your WSL guests for free.

Docker Desktop:

1. In the past, created a managed WSL vm to run containers.

2. At some point, it included the option to use a WSL distro instead, but you had to tell it explicitly.

3. Nowadays it detects whether a default WSL distro is present and uses it to run containers automatically. Otherwise it creates a managed WSL distro just to run containers.

As far as I understand, Podman Desktop still is at (1). You can't tell it to use your own WSL distro.

> I'm about to try `sudo dnf install podman` and hope it connects to the podman-machine? I dunno, it's not exactly clear

I think podman-machine is meant to be executed on the host, but worth a try anyway