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 🫢


🧚 SEE ALSO 🧚


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