TL;DR sudo mount --make-rshared /
If you're anything like me and you're trying to use podman inside WSL, you may get the following issue when running any podman command:
$ podman ps
WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
So what can you do? Run every podman command with sudo
?
That's not an option.
Thankfully, there's an easy fix on WSL. First, to diagnose the problem, run findmnt -o PROPAGATION
. You'll probably get an output like this:
$ findmnt -o PROPAGATION
PROPAGATION
private
shared
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
private
So podman is complaining about the /
mount not being shared, for which there is an easy fix: sudo mount --make-rshared /
.
Then, if you run findmnt -o PROPAGATION
again you'll notice the change:
$ findmnt -o PROPAGATION
PROPAGATION
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
shared
Finally, podman ps
now works properly:
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Yay!
Top comments (1)
Nice clear article to solve a common problem. Thank you!