DISTROBOX-HOST-EXEC(1)

πŸ“¦
version 1.8.2.5 Β· 6 versions
, in alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu stonking

✨ DISTROBOX-HOST-EXEC ✨

okay so bestie, welcome to the distrobox-host-exec manual page πŸ’– (that's the DISTROBOX-HOST-EXEC(1) one, from the User Manual, in case you were wondering which page you just opened πŸŽ€)


🌸 NAME 🌸

distrobox-host-exec β€” the little icon that lets you run stuff on the host while you're vibing inside a container πŸ‘‘


πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea: distrobox-host-exec lets one execute command on the host, while inside of a container. literally the whole point. you're in the container, but the command happens back on the host. it's giving teleportation ✨

under the hood, distrobox-host-exec uses host-spawn, a project that lets us execute commands back on the host. no cap. and if that tool is not found, the user will be prompted to install it 🫢 (we gotchu, we'll ask nicely).


πŸ¦‹ SYNOPSIS πŸ¦‹

just pass to distrobox-host-exec any command and all its arguments, if any. that's it. that's the whole vibe. πŸ’…

--help/-h:      show this message
--verbose/-v:       show more verbosity
--version/-V:       show version
--yes/-Y:       Automatically answer yes to prompt:
                            host-spawn will be installed on the guest system
                            if host-spawn is not detected.
                            This behaviour is default when running in a non-interactive shell.

quick rundown of those, bestie:

  • --help, -h β€” show this message πŸ“–
  • --verbose, -v β€” show more verbosity, i.e. the plot thickens πŸ—£οΈ
  • --version, -V β€” show version 🏷️
  • --yes, -Y β€” Automatically answer yes to prompt: host-spawn will be installed on the guest system if host-spawn is not detected. This behaviour is default when running in a non-interactive shell. (so if you're in a script, it just goes ahead and does it, no questions asked πŸ™ˆ)

if no command is provided, it will execute $SHELL. periodt. 🐚

alternatively, you can symlink a command name to distrobox-host-exec and then call that command by its name on the host, while inside of a container. yes, that's real. yes, it's iconic. πŸ”₯


🌈 EXAMPLES 🌈

Run individual commands πŸƒβ™€οΈ

distrobox-host-exec ls
distrobox-host-exec bash -l
distrobox-host-exec flatpak run org.mozilla.firefox
distrobox-host-exec podman ps -a

look at her go ✨

Drop into host shell 🐚

~$: distrobox-host-exec # No command, executes "$SHELL" on the host
~$: distrobox-host-exec # This command now runs on the host
You must run  distrobox-host-exec inside a container!
bestie. read that last line again. πŸ‘€ you must run distrobox-host-exec inside a container! it's not gonna work from the host, that's not the vibe at all 😭

Symlinking host commands πŸ”—

Use the host command name to create a symlink to distrobox-host-exec. You can then call the host command from within the container. it's giving main character energy fr fr πŸ’…

~$: git # We do not have git in the container
bash: git: command not found
~$: sudo ln -s /usr/bin/distrobox-host-exec /usr/local/bin/git
~$: git version
git version 2.51.1

not the container having no git and then suddenly having git 😭 the glow-up is real 🧚

you can control podman on the host from within the container as follows:

~$: ln -s /usr/bin/distrobox-host-exec /usr/local/bin/podman
~$: ls -l /usr/local/bin/podman
lrwxrwxrwx. 1 root root 51 Jul 11 19:26 /usr/local/bin/podman -> /usr/bin/distrobox-host-exec
~$: podman version
...this is executed on host...

see that last line? ...this is executed on host... πŸ‘‘ you're in the container, podman is on the host, and yet. and yet. obsessed. πŸŽ€


okay that's the whole page bestie, you ate it πŸ’– this one came from Distrobox, version dated Mar 2026 β€” so if anyone asks where you learned all this, tell 'em it's a Distrobox thing and it's lowkey iconic πŸŒΈπŸ¦‹βœ¨