toolbox-run(1)

πŸ’– toolbox-run(1) πŸ’–

okay bestie, welcome to toolbox-run from the General Commands Manual β€” it's giving "run a thing inside a box" and honestly? iconic. sit down, grab a boba, we're doing this. πŸ§‹βœ¨


🌸 NAME 🌸

toolbox-run β€” run a command in an existing Toolbx container πŸ’…


✨ SYNOPSIS ✨

toolbox run [--container NAME | -c NAME]
            [--distro DISTRO | -d DISTRO]
            [--preserve-fds N]
            [--release RELEASE | -r RELEASE]
            [COMMAND]

no cap, that's the whole vibe. πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

So basically: this runs a command inside an existing Toolbx container. And when we say existing, we mean it β€” that container should have already been made with the toolbox create command. no sneaky improvising, bestie. πŸ™ˆ

On Fedora, the default container is known as fedora-toolbox-N, where N is the release of the host. If you wanna pick a specific one, that's what the --container option is for. πŸ’–

A Toolbx container is an OCI container. So like, toolbox run is analogous to a podman start followed by a podman exec. same energy, different font. πŸ’€


πŸ’… OPTIONS πŸ’…

The following options are understood (and yes, we're listing every single one, because we don't skip):

  • --container NAME, -c NAME β€” run the command inside a Toolbx container with the given NAME. highkey useful when you've got multiple Toolbx containers created from the same image, or fully customized containers created from custom-built images. you contain, girl. πŸ‘‘
  • --distro DISTRO, -d DISTRO β€” run the command inside a Toolbx container for a different operating system DISTRO than the host. it has to be coupled with --release unless the selected DISTRO matches the host system. so like, read that twice. 🫢
  • --preserve-fds N β€” pass down to the command N additional file descriptors (on top of 0, 1, 2, bestie β€” those come free). the total number of file descriptors will be 3+N. math slay. 🌈
  • --release RELEASE, -r RELEASE β€” run the command inside a Toolbx container for a different operating system RELEASE than the host. periodt. ⭐

πŸ”₯ EXIT STATUS πŸ”₯

The exit code gives you the tea about why the command within the container failed to run, or why it exited. listen up:

  • 1 β€” there was an internal error in Toolbx. not her fault, fr fr.
  • 125 β€” there was an internal error in Podman. also not her fault.
  • 126 β€” the run command could not be invoked. 😭
$ toolbox run /etc; echo $?
/bin/sh: line 1: /etc: Is a directory
/bin/sh: line 1: exec: /etc: cannot execute: Is a directory
Error: failed to invoke command /etc in container fedora-toolbox-36
126
  • 127 β€” the run command cannot be found, or the working directory does not exist. it's giving "who?" πŸ™ˆ
$ toolbox run foo; echo $?
/bin/sh: line 1: exec: foo: not found
Error: command foo not found in container fedora-toolbox-36
127
  • Exit code β€” the run command exit code. it just hands you back whatever the command said. no filter. πŸ’€
$ toolbox run false; echo $?
1

πŸ¦‹ EXAMPLES πŸ¦‹

🌸 Run ls inside the default Toolbx container matching the host OS 🌸

$ toolbox run ls -la

πŸ’– Run emacs inside the default Toolbx container for Fedora 36 πŸ’–

$ toolbox run --distro fedora --release f36 emacs

✨ Run uptime inside a Toolbx container with a custom name ✨

$ toolbox run --container foo uptime

πŸ‘‘ SEE ALSO πŸ‘‘

toolbox(1), podman(1), podman-exec(1), podman-start(1) β€” go read your sisters, bestie, they're all icons too. πŸ’œ


and that's the whole page, no notes. πŸ“

anyway, this was toolbox-run(1) from the General Commands Manual β€” mwah, drink water, run your containers, and don't forget to toolbox create first. bye bestie, slay responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from