FLATPAK-SPAWN(1)
π FLATPAK SPAWN π
okay bestie, so this is the flatpak spawn manual page, and it is genuinely iconic. it's giving "escape the sandbox" energy and we're gonna get into every single bit of it. no skimming, no skipping, we're doing the whole thing. π«Ά
β¨ NAME β¨
flatpak-spawn β Run commands in a sandbox
πΈ SYNOPSIS πΈ
flatpak-spawn [OPTION...] COMMAND [ARGUMENT...]
π¦ DESCRIPTION π¦
so here's the tea: unlike every other flatpak command out there, flatpak-spawn is actually available to applications inside the sandbox. like, it's the one that got let in. π
and what does it do with that access? it runs COMMAND outside the sandbox β either in another sandbox, or straight up on the host. main character behavior, honestly.
when you call it without --host, flatpak-spawn uses the Flatpak portal to create a copy of the sandbox it was called from. and like, optionally it can use tighter permissions, and optionally the latest version of the app and runtime (peep --latest-version for that one π).
π OPTIONS π
the following options are understood. and yes, we're doing all of them:
-h,--helpβ show help options and exit. classic.-v,--verboseβ print debug information. it's giving "tell me everything" π--forward-fd=FDβ forward a file descriptor--clear-envβ run with a clean environment. fresh start, no baggage, we love that π§Ό--watch-busβ make the spawned command exit whenflatpak-spawnitself exits; notably, this happens when its connection to the session bus is closed. so like, when the bus dips, everything dips. π--env=VAR=VALUEβ set an environment variable--latest-versionβ use the latest version of the refs that are used to set up the sandbox. glow up the whole setup β¨--no-networkβ run without network access--sandboxβ run fully sandboxed. see the documentation for the--sandboxoption inflatpak-run(1)
see the --sandbox-expose and --sandbox-expose-ro options for selective file access.
--sandbox-expose=NAMEβ expose read-write access to a file in the sandbox.
note that absolute paths or subdirectories are not allowed. the files must be in the sandbox subdirectory of the instance directory (i.e. ~/.var/app/$APP_ID/sandbox).
this option is useful in combination with --sandbox (otherwise the instance directory is accessible anyway).
--sandbox-expose-ro=NAMEβ expose readonly access to a file in the sandbox.
note that absolute paths or subdirectories are not allowed. the files must be in the sandbox subdirectory of the instance directory (i.e. ~/.var/app/$APP_ID/sandbox).
this option is useful in combination with --sandbox (otherwise the instance directory is accessible anyway).
--hostβ run the command unsandboxed on the host. this one requires access to theorg.freedesktop.FlatpakD-Bus interface. no interface, no vibes. πͺ--directory=DIRβ the working directory in which to run the command.
note that the given directory must exist in the sandbox or, when used in conjunction with --host, on the host. so make sure it's actually there, bestie, fr fr.
π EXAMPLES π
$ flatpak-spawn ls /var/run
look at her go. β
π SEE ALSO π
and that's the whole page, bestie π this was flatpak (the manual), version FLATPAK SPAWN(1) β no date drama, just vibes. now go forth and spawn responsibly. mwah πβ¨
π¦ where this page comes from
- debian trixie: flatpak 1.16.6-1~deb13u3
- fedora 44: flatpak 1.18.4-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: flatpak 1.18.4-1.fc44 Β· LGPL-2.1-or-later
- nixpkgs unstable: flatpak 1.18.4
- ubuntu stonking: flatpak 1.18.4-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms