1toolbox-run(1) General Commands Manual toolbox-run(1)
2
3
4
6 toolbox-run - Run a command in an existing toolbox container
7
8
10 toolbox run [--container NAME | -c NAME]
11 [--distro DISTRO | -d DISTRO]
12 [--preserve-fds N]
13 [--release RELEASE | -r RELEASE]
14 [COMMAND]
15
16
18 Runs a command inside an existing toolbox container. The container
19 should have been created using the toolbox create command.
20
21
22 On Fedora, the default container is known as fedora-toolbox-N, where N
23 is the release of the host. A specific container can be selected using
24 the --container option.
25
26
27 A toolbox container is an OCI container. Therefore, toolbox run is
28 analogous to a podman start followed by a podman exec.
29
30
32 The following options are understood:
33
34
35 --container NAME, -c NAME
36
37
38 Run command inside a toolbox container with the given NAME. This is
39 useful when there are multiple toolbox containers created from the same
40 image, or entirely customized containers created from custom-built im‐
41 ages.
42
43
44 --distro DISTRO, -d DISTRO
45
46
47 Run command inside a toolbox container for a different operating system
48 DISTRO than the host. Has to be coupled with --release unless the se‐
49 lected DISTRO matches the host system.
50
51
52 --preserve-fds N
53
54
55 Pass down to command N additional file descriptors (in addition to 0,
56 1, 2). The total number of file descriptors will be 3+N.
57
58
59 --release RELEASE, -r RELEASE
60
61
62 Run command inside a toolbox container for a different operating system
63 RELEASE than the host.
64
65
67 The exit code gives information about why the command within the con‐
68 tainer failed to run or why it exited.
69
70
71 1 There was an internal error in Toolbox
72
73
74 125 There was an internal error in Podman
75
76
77 126 The run command could not be invoked
78
79 $ toolbox run /etc; echo $?
80 /bin/sh: line 1: /etc: Is a directory
81 /bin/sh: line 1: exec: /etc: cannot execute: Is a directory
82 Error: failed to invoke command /etc in container fedora-toolbox-36
83 126
84
85
86
87 127 The run command cannot be found or the working directory does not
88 exist
89
90 $ toolbox run foo; echo $?
91 /bin/sh: line 1: exec: foo: not found
92 Error: command foo not found in container fedora-toolbox-36
93 127
94
95
96
97 Exit code The run command exit code
98
99 $ toolbox run false; echo $?
100 1
101
102
103
105 Run ls inside a toolbox container using the default image matching the host
106 OS
107 $ toolbox run ls -la
108
109
110
111 Run emacs inside a toolbox container using the default image for Fedora 36
112 $ toolbox run --distro fedora --release f36 emacs
113
114
115
116 Run uptime inside a custom toolbox container using a custom image
117 $ toolbox run --container foo uptime
118
119
120
122 toolbox(1), podman(1), podman-exec(1), podman-start(1)
123
124
125
126 toolbox-run(1)