DEV Community

Discussion on: Using podman instead of docker on Windows Subsystem for Linux (WSL 2)

Collapse
 
galsi profile image
galsi • Edited

Thanks , great article
now just struggling to get the rootless mode

ERROR on rootless mode
$ podman ps
WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
Error: cannot setup namespace using newuidmap: exit status 1

resolve the rootless mode problem i added

sudo chmod 4755 /usr/bin/newgidmap
sudo chmod 4755 /usr/bin/newuidmap

github.com/containers/podman/issue...

$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Collapse
 
marzelin profile image
Marc Ziel

That's not an error but just a warning.
It only matters if you want to mount bind a directory that has another mount bind. With "/" set as private that "sub-mount" won't be visible inside the container.
You can fix this by running sudo mount --make-rshared / as @bowmanjd suggests. But it needs to be run before you run any podman command after system boots (because podman sets up its own mnt namespace from where it creates all container-related mounts and it's set to follow mount propagation from host namespace but if a mount is set as private it can't).

You can find more about different mount sharing options at man7.org/linux/man-pages/man7/moun...

Collapse
 
shevchuk profile image
shevchuk • Edited

But it needs to be run before you run any podman command

You can do podman system migrate after sudo mount --make-rshared / for podman to pick up the change

P.S. sorry for necro, but this post is one of the top search results for podman shared mounts problem : ) this is for future lurkers

Collapse
 
bowmanjd profile image
Jonathan Bowman

Thanks for noting these issues. I think reinstalling shadow-utils should fix the guid/uid map issues; did that not work for you?

And, apparently, sudo mount --make-rshared / should solve the shared mount warning, or you can just ignore the warning.

Thoughts?