Why use a "nested process namespace"? (podman on Windows) #17835
Replies: 6 comments
-
@n1hility PTAL |
Beta Was this translation helpful? Give feedback.
-
The stack looks like that because this is how WSL2 was designed by Microsoft. The podman-machine-default is a WSL2 distro managed by Podman on Wndows (podman machine) to have a standardized Linux environment to run Podman in. Now, a consequence of the WSL2 design is that Windows wants an init process to be "pid 0" (pid = process ID) in the distro. Inconvenient for Systemd, because it also wants exactly that, which is not possible: pids are unique. Hence the clever trick with the "nested process namespace:": in this namespace systemd runs as pid 0 as it needs, but this actually is a different pid seen from the WSL2 distro (the real pid is mapped to pid 0 in the nested process namespace).. In the meantime recent WSL2 versions provide a setting to be able to run systemd without needing this nested namespace, but I believe podman machine isn't yet compatible with that. If you run your own distro with Podman, this can be of help though. |
Beta Was this translation helpful? Give feedback.
-
@davdr great answer |
Beta Was this translation helpful? Give feedback.
-
Awesome! Thank you, @davdr! @n1hility, is the new WSL systemd feature being considered? Will it give you the functionality needed for podman? Too soon to say? |
Beta Was this translation helpful? Give feedback.
-
Yes the plan is to move to the new built-in systemd support as the preferred model, provided there are no secondary issues. BTW just a small correction to your sequence: It actually looks like this:
So no matter what you have multiple nested linux namespaces. The only difference is we can get rid of the extra namespace for systemd |
Beta Was this translation helpful? Give feedback.
-
Got it. Makes sense. Good luck in your efforts! Looking forward to seeing what the team comes up with. And again, thanks for the explanations, everyone. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I recently installed Podman for Windows. No issues so far, just silly newbie questions, like "how does this work" and "why?"
The tutorial doesn't really go into this, but when I drop into the installed Fedora distro (Windows Terminal > podman-machine-default), I get a helpful message explaining:
BTW, I'm not questioning the design choice or need for the container Inception or separate namespace. I'm sure there are good reasons the stack looks like this:
"Remix"custom image installed viapodman machine init
)"Remix"custom container (started when youpodman machine start
)...but don't understand WHY.
...or, perhaps, enough to interpret what the message above is plainly telling me...?
Can someone explain the "container with a container" setup and bit about namespaces?
BTW, I'm still learning about containers and namespaces, so please assume I have no idea what I'm talking about. =) And apologies if this has been answered somewhere, but my Google-fu and search of the Github discussion/issues has failed me.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions