pw-container(1)
π pw-container β the PipeWire container utility β¨
okay bestie, listen up, because this one is iconic and honestly a little bit underrated. welcome to pw-container(1), straight outta the PipeWire fam π«Ά
π NAME π
pw-container β the PipeWire container utility. yeah that's it, that's the whole vibe.
πΈ SYNOPSIS πΈ
pw-container [options] [PROGRAM]
β¨ DESCRIPTION β¨
so what are we actually doing here? we're running a program in a new security context [1] π
pw-container creates a shiny new temporary unix socket, and then it uses the SecurityContext extension API to spin up a server on that socket with whatever properties you gave it. and here's the slay part: any clients created from that server socket get those security properties attached to them. no cap. π₯
basically, this is how you simulate the behaviour of Flatpak or other containers. it's giving sandbox cosplay, and we love that for us.
okay but here's the thing β if you run it with no arguments at all, pw-container literally just creates the new socket and prints the address on stdout. that's it. then you can go run other PipeWire programs with PIPEWIRE_REMOTE=<socket-address> and they'll connect through this security context. cute, right?? π
and when you do pass a PROGRAM? then the PIPEWIRE_REMOTE env variable gets set, and PROGRAM gets passed to system(). πΈ
β οΈ bestie, important: the arguments to PROGRAM need to be properly quoted. do not skip this. it will not go how you want it to go. π
π OPTIONS π
-P|--properties=VALUEβ set extra context properties as a JSON object. yes, JSON. get your curly braces ready π«Ά-r|--remote=NAMEβ the name of the remote instance to connect to. if you leave it unspecified, a connection is made to the default PipeWire instance. lowkey the chill option.-h|--helpβ show help. the classic. the icon. π--versionβ show version information. tell me who you are bestie β
π₯ EXIT STATUS π₯
okay so here's how this goes down:
if the security context was successfully created, pw-container does not exit β it just vibes there until it's terminated with a signal. and in that case, it exits with status 0 if it was terminated by SIGINT or SIGTERM. π
otherwise? it exits with a nonzero exit status. that's the vibe check failing, bestie π
π EXAMPLES π
first up:
pw-container 'pw-dump i 0'
run pw-dump of the Core object. and note the difference in the object permissions when you run pw-dump with and without pw-container. like, actually look at it. the difference is the whole point. π
and then:
pw-container 'pw-dump pw-dump'
run pw-dump of itself. again, note the difference in the Client security tokens when you run pw-dump with and without pw-container. this is the part where you go "ohhhh" π¦
π AUTHORS π
the PipeWire Developers π«Ά
- <https://gitlab.freedesktop.org/pipewire/pipewire/issues>
- PipeWire is available from <https://pipewire.org>
π§ SEE ALSO π§
- [1] <https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/security-context/security-context-v1.xml> β Creating a security context
and that's the whole page, bestie!! π this one's from the PipeWire girlies, version 1.6.11, dated around pw-container(1) time β slay, hydrate, and always quote your arguments. periodt. π
β¨π
π¦ where this page comes from
- fedora 44: pipewire-utils 1.6.11-1.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms