Debian Codegraph @

upstream/debian-unstable/man1/systemd-nspawn.1

raw
1 '\" t
2 .TH "SYSTEMD\-NSPAWN" "1" "" "systemd 261~rc3" "systemd-nspawn"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-nspawn \- Spawn a command or OS in a lightweight container
24 .SH "SYNOPSIS"
25 .HP \w'\fBsystemd\-nspawn\fR\ 'u
26 \fBsystemd\-nspawn\fR [OPTIONS...] [\fICOMMAND\fR\ [ARGS...]]
27 .HP \w'\fBsystemd\-nspawn\fR\ 'u
28 \fBsystemd\-nspawn\fR \-\-boot [OPTIONS...] [ARGS...]
29 .SH "DESCRIPTION"
30 .PP
31 \fBsystemd\-nspawn\fR
32 may be used to run a command or OS in a lightweight namespace container\&. In many ways it is similar to
33 \fBchroot\fR(1), but more powerful since it virtualizes the file system hierarchy, as well as the process tree, the various IPC subsystems, and the host and domain names\&.
34 .PP
35 \fBsystemd\-nspawn\fR
36 may be invoked on any directory tree containing an operating system tree, using the
37 \fB\-\-directory=\fR
38 command line option\&. By using the
39 \fB\-\-machine=\fR
40 option an OS tree is automatically searched for in a couple of locations, most importantly in
41 /var/lib/machines/, the suggested directory to place OS container images installed on the system\&.
42 .PP
43 In contrast to
44 \fBchroot\fR(1)\ \&\fBsystemd\-nspawn\fR
45 may be used to boot full Linux\-based operating systems in a container\&.
46 .PP
47 \fBsystemd\-nspawn\fR
48 limits access to various kernel interfaces in the container to read\-only, such as
49 /sys/,
50 /proc/sys/, or
51 /sys/fs/selinux/\&. The host\*(Aqs network interfaces and the system clock may not be changed from within the container\&. Device nodes may not be created\&. The host system cannot be rebooted and kernel modules may not be loaded from within the container\&.
52 \fIThis sandbox can easily be circumvented from within the container if user namespaces are not used\fR\&. This means that untrusted code must always be run in a user namespace, see the discussion of the
53 \fB\-\-private\-users=\fR
54 option below\&.
55 .PP
56 Use a tool like
57 \fBdnf\fR(8),
58 \fBdebootstrap\fR(8), or
59 \fBpacman\fR(8)
60 to set up an OS directory tree suitable as file system hierarchy for
61 \fBsystemd\-nspawn\fR
62 containers\&. See the Examples section below for details on suitable invocation of these commands\&.
63 .PP
64 As a safety check
65 \fBsystemd\-nspawn\fR
66 will verify the existence of
67 /usr/lib/os\-release
68 or
69 /etc/os\-release
70 in the container tree before booting a container (see
71 \fBos-release\fR(5))\&. It might be necessary to add this file to the container tree manually if the OS of the container is too old to contain this file out\-of\-the\-box\&.
72 .PP
73 \fBsystemd\-nspawn\fR
74 may be invoked directly from the interactive command line or run as system service in the background\&. In this mode each container instance runs as its own service instance; a default template unit file
75 systemd\-nspawn@\&.service
76 is provided to make this easy, taking the container name as instance identifier\&. Note that different default options apply when
77 \fBsystemd\-nspawn\fR
78 is invoked by the template unit file than interactively on the command line\&. Most importantly the template unit file makes use of the
79 \fB\-\-boot\fR
80 option which is not the default in case
81 \fBsystemd\-nspawn\fR
82 is invoked from the interactive command line\&. Further differences with the defaults are documented along with the various supported options below\&.
83 .PP
84 The
85 \fBmachinectl\fR(1)
86 tool may be used to execute a number of operations on containers\&. In particular it provides easy\-to\-use commands to run containers as system services using the
87 systemd\-nspawn@\&.service
88 template unit file\&.
89 .PP
90 Along with each container a settings file with the
91 \&.nspawn
92 suffix may exist, containing additional settings to apply when running the container\&. See
93 \fBsystemd.nspawn\fR(5)
94 for details\&. Settings files override the default options used by the
95 systemd\-nspawn@\&.service
96 template unit file, making it usually unnecessary to alter this template file directly\&.
97 .PP
98 Note that
99 \fBsystemd\-nspawn\fR
100 will mount file systems private to the container to
101 /dev/,
102 /run/, and similar\&. These will not be visible outside of the container, and their contents will be lost when the container exits\&.
103 .PP
104 Note that running two
105 \fBsystemd\-nspawn\fR
106 containers from the same directory tree will not make processes in them see each other\&. The PID namespace separation of the two containers is complete and the containers will share very few runtime objects except for the underlying file system\&. Rather use
107 \fBmachinectl\fR(1)\*(Aqs
108 \fBlogin\fR
109 or
110 \fBshell\fR
111 commands to request an additional login session in a running container\&.
112 .PP
113 \fBsystemd\-nspawn\fR
114 implements the
115 \m[blue]\fBContainer Interface\fR\m[]\&\s-2\u[1]\d\s+2
116 specification\&.
117 .PP
118 While running, containers invoked with
119 \fBsystemd\-nspawn\fR
120 are registered with the
121 \fBsystemd-machined\fR(8)
122 service that keeps track of running containers, and provides programming interfaces to interact with them\&.
123 .SH "UNPRIVILEGED OPERATION"
124 .PP
125 \fBsystemd\-nspawn\fR
126 may be invoked with or without privileges\&. The full functionality is currently only available when invoked with privileges\&. When invoked without privileges, various limitations apply, including, but not limited to:
127 .sp
128 .RS 4
129 .ie n \{\
130 \h'-04'\(bu\h'+03'\c
131 .\}
132 .el \{\
133 .sp -1
134 .IP \(bu 2.3
135 .\}
136 Only disk image based containers are supported (i\&.e\&.
137 \fB\-\-image=\fR)\&. Directory based ones (i\&.e\&.
138 \fB\-\-directory=\fR) are only supported if owned by the "foreign" UID range\&.
139 .RE
140 .sp
141 .RS 4
142 .ie n \{\
143 \h'-04'\(bu\h'+03'\c
144 .\}
145 .el \{\
146 .sp -1
147 .IP \(bu 2.3
148 .\}
149 Only
150 \fB\-\-private\-network\fR
151 and
152 \fB\-\-network\-veth\fR
153 networking modes are supported\&.
154 .RE
155 .PP
156 When running in unprivileged mode, some needed functionality is provided via
157 \fBsystemd-mountfsd.service\fR(8)
158 and
159 \fBsystemd-nsresourced.service\fR(8)\&.
160 .SH "OPTIONS"
161 .PP
162 If option
163 \fB\-\-boot\fR
164 is specified, the arguments are used as arguments for the init program\&. Otherwise,
165 \fICOMMAND\fR
166 specifies the program to launch in the container, and the remaining arguments are used as arguments for this program\&. If
167 \fB\-\-boot\fR
168 is not used and no arguments are specified, a shell is launched in the container\&.
169 .PP
170 The following options are understood:
171 .PP
172 \fB\-q\fR, \fB\-\-quiet\fR
173 .RS 4
174 Turns off any status output by the tool itself\&. When this switch is used, the only output from nspawn will be the console output of the container OS itself\&.
175 .sp
176 Added in version 209\&.
177 .RE
178 .PP
179 \fB\-\-settings=\fR\fB\fIMODE\fR\fR
180 .RS 4
181 Controls whether
182 \fBsystemd\-nspawn\fR
183 shall search for and use additional per\-container settings from
184 \&.nspawn
185 files\&. Takes a boolean or the special values
186 \fBoverride\fR
187 or
188 \fBtrusted\fR\&.
189 .sp
190 If enabled (the default), a settings file named after the machine (as specified with the
191 \fB\-\-machine=\fR
192 setting, or derived from the directory or image file name) with the suffix
193 \&.nspawn
194 is searched in
195 /etc/systemd/nspawn/
196 and
197 /run/systemd/nspawn/\&. If it is found there, its settings are read and used\&. If it is not found there, it is subsequently searched in the same directory as the image file or in the immediate parent of the root directory of the container\&. In this case, if the file is found, its settings will be also read and used, but potentially unsafe settings are ignored\&. Note that in both these cases, settings on the command line take precedence over the corresponding settings from loaded
198 \&.nspawn
199 files, if both are specified\&. Unsafe settings are considered all settings that elevate the container\*(Aqs privileges or grant access to additional resources such as files or directories of the host\&. For details about the format and contents of
200 \&.nspawn
201 files, consult
202 \fBsystemd.nspawn\fR(5)\&.
203 .sp
204 If this option is set to
205 \fBoverride\fR, the file is searched, read and used the same way, however, the order of precedence is reversed: settings read from the
206 \&.nspawn
207 file will take precedence over the corresponding command line options, if both are specified\&.
208 .sp
209 If this option is set to
210 \fBtrusted\fR, the file is searched, read and used the same way, but regardless of being found in
211 /etc/systemd/nspawn/,
212 /run/systemd/nspawn/
213 or next to the image file or container root directory, all settings will take effect, however, command line arguments still take precedence over corresponding settings\&.
214 .sp
215 If disabled, no
216 \&.nspawn
217 file is read and no settings except the ones on the command line are in effect\&.
218 .sp
219 Added in version 226\&.
220 .RE
221 .PP
222 \fB\-\-cleanup\fR
223 .RS 4
224 Clean up left\-over mounts and underlying mount points used by the container, and exit without invoking any containers\&. This may be useful when the previous invocation of
225 \fBsystemd\-nspawn\fR
226 was unexpectedly terminated\&. This requires at least one of
227 \fB\-M/\-\-machine=\fR,
228 \fB\-D/\-\-directory=\fR, or
229 \fB\-i/\-\-image=\fR
230 to determine the mounts to be cleaned up\&.
231 .sp
232 Added in version 257\&.
233 .RE
234 .SS "Image Options"
235 .PP
236 \fB\-D\fR, \fB\-\-directory=\fR
237 .RS 4
238 Directory to use as file system root for the container\&.
239 .sp
240 If neither
241 \fB\-\-directory=\fR, nor
242 \fB\-\-image=\fR
243 is specified the directory is determined by searching for a directory named the same as the machine name specified with
244 \fB\-\-machine=\fR\&. See
245 \fBmachinectl\fR(1)
246 section "Files and Directories" for the precise search path\&.
247 .sp
248 In place of the directory path a
249 "\&.v/"
250 versioned directory may be specified, see
251 \fBsystemd.v\fR(7)
252 for details\&.
253 .sp
254 If neither
255 \fB\-\-directory=\fR,
256 \fB\-\-image=\fR, nor
257 \fB\-\-machine=\fR
258 are specified, the current directory will be used\&. May not be specified together with
259 \fB\-\-image=\fR\&.
260 .RE
261 .PP
262 \fB\-\-template=\fR
263 .RS 4
264 Directory or
265 "btrfs"
266 subvolume to use as template for the container\*(Aqs root directory\&. If this is specified and the container\*(Aqs root directory (as configured by
267 \fB\-\-directory=\fR) does not yet exist it is created as
268 "btrfs"
269 snapshot (if supported) or plain directory (otherwise) and populated from this template tree\&. Ideally, the specified template path refers to the root of a
270 "btrfs"
271 subvolume, in which case a simple copy\-on\-write snapshot is taken, and populating the root directory is instant\&. If the specified template path does not refer to the root of a
272 "btrfs"
273 subvolume (or not even to a
274 "btrfs"
275 file system at all), the tree is copied (though possibly in a \*(Aqreflink\*(Aq copy\-on\-write scheme \(em if the file system supports that), which can be substantially more time\-consuming\&. Note that the snapshot taken is of the specified directory or subvolume, including all subdirectories and subvolumes below it, but excluding any sub\-mounts\&. May not be specified together with
276 \fB\-\-image=\fR
277 or
278 \fB\-\-ephemeral\fR\&.
279 .sp
280 Note that this switch leaves hostname, machine ID and all other settings that could identify the instance unmodified\&.
281 .sp
282 Added in version 219\&.
283 .RE
284 .PP
285 \fB\-x\fR, \fB\-\-ephemeral\fR
286 .RS 4
287 If specified, the container is run with a temporary snapshot of its file system that is removed immediately when the container terminates\&. May not be specified together with
288 \fB\-\-template=\fR\&.
289 .sp
290 Note that this switch leaves hostname, machine ID and all other settings that could identify the instance unmodified\&. Please note that \(em as with
291 \fB\-\-template=\fR
292 \(em taking the temporary snapshot is more efficient on file systems that support subvolume snapshots or \*(Aqreflinks\*(Aq natively ("btrfs"
293 or new
294 "xfs") than on more traditional file systems that do not ("ext4")\&. Note that the snapshot taken is of the specified directory or subvolume, including all subdirectories and subvolumes below it, but excluding any sub\-mounts\&.
295 .sp
296 With this option no modifications of the container image are retained\&. Use
297 \fB\-\-volatile=\fR
298 (described below) for other mechanisms to restrict persistency of container images during runtime\&.
299 .sp
300 Added in version 219\&.
301 .RE
302 .PP
303 \fB\-i\fR, \fB\-\-image=\fR
304 .RS 4
305 Disk image to mount the root directory for the container from\&. Takes a path to a regular file or to a block device node\&. The file or block device must contain either:
306 .sp
307 .RS 4
308 .ie n \{\
309 \h'-04'\(bu\h'+03'\c
310 .\}
311 .el \{\
312 .sp -1
313 .IP \(bu 2.3
314 .\}
315 An MBR partition table with a single partition of type 0x83 that is marked bootable\&.
316 .RE
317 .sp
318 .RS 4
319 .ie n \{\
320 \h'-04'\(bu\h'+03'\c
321 .\}
322 .el \{\
323 .sp -1
324 .IP \(bu 2.3
325 .\}
326 A GUID partition table (GPT) with a single partition of type 0fc63daf\-8483\-4772\-8e79\-3d69d8477de4\&.
327 .RE
328 .sp
329 .RS 4
330 .ie n \{\
331 \h'-04'\(bu\h'+03'\c
332 .\}
333 .el \{\
334 .sp -1
335 .IP \(bu 2.3
336 .\}
337 A GUID partition table (GPT) with a marked root partition which is mounted as the root directory of the container\&. Optionally, GPT images may contain a home and/or a server data partition which are mounted to the appropriate places in the container\&. All these partitions must be identified by the partition types defined by the
338 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[2]\d\s+2\&.
339 .RE
340 .sp
341 .RS 4
342 .ie n \{\
343 \h'-04'\(bu\h'+03'\c
344 .\}
345 .el \{\
346 .sp -1
347 .IP \(bu 2.3
348 .\}
349 No partition table, and a single file system spanning the whole image\&.
350 .RE
351 .sp
352 On GPT images, if an EFI System Partition (ESP) is discovered, it is automatically mounted to
353 /efi
354 (or
355 /boot
356 as fallback) in case a directory by this name exists and is empty\&.
357 .sp
358 Partitions encrypted with LUKS are automatically decrypted\&. Also, on GPT images dm\-verity data integrity hash partitions are set up if the root hash for them is specified using the
359 \fB\-\-root\-hash=\fR
360 option\&.
361 .sp
362 Single file system images (i\&.e\&. file systems without a surrounding partition table) can be opened using dm\-verity if the integrity data is passed using the
363 \fB\-\-root\-hash=\fR
364 and
365 \fB\-\-verity\-data=\fR
366 (and optionally
367 \fB\-\-root\-hash\-sig=\fR) options\&.
368 .sp
369 Any other partitions, such as foreign partitions or swap partitions are not mounted\&. May not be specified together with
370 \fB\-\-directory=\fR,
371 \fB\-\-template=\fR\&.
372 .sp
373 In place of the image path a
374 "\&.v/"
375 versioned directory may be specified, see
376 \fBsystemd.v\fR(7)
377 for details\&.
378 .sp
379 Added in version 211\&.
380 .RE
381 .PP
382 \fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
383 .RS 4
384 Takes an image policy string as argument, as per
385 \fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
386 \fB\-\-image=\fR, see above\&. If not specified, defaults to
387 "root=verity+signed+encrypted+unprotected+absent:usr=verity+signed+encrypted+unprotected+absent:home=encrypted+unprotected+absent:srv=encrypted+unprotected+absent:esp=unprotected+absent:xbootldr=unprotected+absent:tmp=encrypted+unprotected+absent:var=encrypted+unprotected+absent", i\&.e\&. all recognized file systems in the image are used, but not the swap partition\&.
388 .sp
389 Added in version 254\&.
390 .RE
391 .PP
392 \fB\-\-mstack=\fR
393 .RS 4
394 Mount stack to mount the root directory for the container from\&. Takes a path to a directory implementing
395 \fBsystemd.mstack\fR(7)\&. This may be used to run a container of an
396 "overlayfs"
397 assembled from a number of layers, possibly writable and augmented with additional bind mounts\&.
398 .sp
399 Added in version 260\&.
400 .RE
401 .PP
402 \fB\-\-oci\-bundle=\fR
403 .RS 4
404 Takes the path to an OCI runtime bundle to invoke, as specified in the
405 \m[blue]\fBOCI Runtime Specification\fR\m[]\&\s-2\u[3]\d\s+2\&. In this case, no
406 \&.nspawn
407 file is loaded, and the root directory and various settings are read from the OCI runtime JSON data (but data passed on the command line takes precedence)\&.
408 .sp
409 Added in version 242\&.
410 .RE
411 .PP
412 \fB\-\-read\-only\fR
413 .RS 4
414 Mount the container\*(Aqs root file system (and any other file systems contained in the container image) read\-only\&. This has no effect on additional mounts made with
415 \fB\-\-bind=\fR,
416 \fB\-\-tmpfs=\fR
417 and similar options\&. This mode is implied if the container image file or directory is marked read\-only itself\&. It is also implied if
418 \fB\-\-volatile=\fR
419 is used\&. In this case, the container image on disk is strictly read\-only, while changes are permitted but kept non\-persistently in memory only\&. For further details, see below\&.
420 .RE
421 .PP
422 \fB\-\-volatile\fR, \fB\-\-volatile=\fR\fB\fIMODE\fR\fR
423 .RS 4
424 Boots the container in volatile mode\&. When no mode parameter is passed or when mode is specified as
425 \fByes\fR, full volatile mode is enabled\&. This means the root directory is mounted as a mostly unpopulated
426 "tmpfs"
427 instance, and
428 /usr/
429 from the OS tree is mounted into it in read\-only mode (the system thus starts up with read\-only OS image, but pristine state and configuration, any changes are lost on shutdown)\&. When the mode parameter is specified as
430 \fBstate\fR, the OS tree is mounted read\-only, but
431 /var/
432 is mounted as a writable
433 "tmpfs"
434 instance into it (the system thus starts up with read\-only OS resources and configuration, but pristine state, and any changes to the latter are lost on shutdown)\&. When the mode parameter is specified as
435 \fBoverlay\fR
436 the read\-only root file system is combined with a writable
437 tmpfs
438 instance through
439 "overlayfs", so that it appears at it normally would, but any changes are applied to the temporary file system only and lost when the container is terminated\&. When the mode parameter is specified as
440 \fBno\fR
441 (the default), the whole OS tree is made available writable (unless
442 \fB\-\-read\-only\fR
443 is specified, see above)\&.
444 .sp
445 Note that if one of the volatile modes is chosen, its effect is limited to the root file system (or
446 /var/
447 in case of
448 \fBstate\fR), and any other mounts placed in the hierarchy are unaffected \(em regardless of whether they are established automatically (e\&.g\&. the EFI system partition that might be mounted to
449 /efi/
450 or
451 /boot/) or explicitly (e\&.g\&. through an additional command line option such as
452 \fB\-\-bind=\fR, see below)\&. This means, even if
453 \fB\-\-volatile=overlay\fR
454 is used changes to
455 /efi/
456 or
457 /boot/
458 are prohibited in case such a partition exists in the container image operated on, and even if
459 \fB\-\-volatile=state\fR
460 is used the hypothetical file
461 /etc/foobar
462 is potentially writable if
463 \fB\-\-bind=/etc/foobar\fR
464 is used to mount it from outside the read\-only container
465 /etc/
466 directory\&.
467 .sp
468 The
469 \fB\-\-ephemeral\fR
470 option is closely related to this setting, and provides similar behaviour by making a temporary, ephemeral copy of the whole OS image and executing that\&. For further details, see above\&.
471 .sp
472 The
473 \fB\-\-tmpfs=\fR
474 and
475 \fB\-\-overlay=\fR
476 options provide similar functionality, but for specific sub\-directories of the OS image only\&. For details, see below\&.
477 .sp
478 This option provides similar functionality for containers as the
479 "systemd\&.volatile="
480 kernel command line switch provides for host systems\&. See
481 \fBkernel-command-line\fR(7)
482 for details\&.
483 .sp
484 Note that setting this option to
485 \fByes\fR
486 or
487 \fBstate\fR
488 will only work correctly with operating systems in the container that can boot up with only
489 /usr/
490 mounted, and are able to automatically populate
491 /var/
492 (and
493 /etc/
494 in case of
495 "\-\-volatile=yes")\&. Specifically, this means that operating systems that follow the historic split of
496 /bin/
497 and
498 /lib/
499 (and related directories) from
500 /usr/
501 (i\&.e\&. where the former are not symlinks into the latter) are not supported by
502 "\-\-volatile=yes"
503 as container payload\&. The
504 \fBoverlay\fR
505 option does not require any particular preparations in the OS, but do note that
506 "overlayfs"
507 behaviour differs from regular file systems in a number of ways, and hence compatibility is limited\&.
508 .sp
509 Added in version 216\&.
510 .RE
511 .PP
512 \fB\-\-root\-hash=\fR
513 .RS 4
514 Takes a data integrity (dm\-verity) root hash specified in hexadecimal\&. This option enables data integrity checks using dm\-verity, if the used image contains the appropriate integrity data (see above)\&. The specified hash must match the root hash of integrity data, and is usually at least 256 bits (and hence 64 formatted hexadecimal characters) long (in case of SHA256 for example)\&. If this option is not specified, but the image file carries the
515 "user\&.verity\&.roothash"
516 extended file attribute (see
517 \fBxattr\fR(7)), then the root hash is read from it, also as formatted hexadecimal characters\&. If the extended file attribute is not found (or is not supported by the underlying file system), but a file with the
518 \&.roothash
519 suffix is found next to the image file, bearing otherwise the same name (except if the image has the
520 \&.raw
521 suffix, in which case the root hash file must not have it in its name), the root hash is read from it and automatically used, also as formatted hexadecimal characters\&.
522 .sp
523 Note that this configures the root hash for the root file system\&. Disk images may also contain separate file systems for the
524 /usr/
525 hierarchy, which may be Verity protected as well\&. The root hash for this protection may be configured via the
526 "user\&.verity\&.usrhash"
527 extended file attribute or via a
528 \&.usrhash
529 file adjacent to the disk image, following the same format and logic as for the root hash for the root file system described here\&. Note that there\*(Aqs currently no switch to configure the root hash for the
530 /usr/
531 from the command line\&.
532 .sp
533 Also see the
534 \fIRootHash=\fR
535 option in
536 \fBsystemd.exec\fR(5)\&.
537 .sp
538 Added in version 233\&.
539 .RE
540 .PP
541 \fB\-\-root\-hash\-sig=\fR
542 .RS 4
543 Takes a PKCS7 signature of the
544 \fB\-\-root\-hash=\fR
545 option\&. The semantics are the same as for the
546 \fIRootHashSignature=\fR
547 option, see
548 \fBsystemd.exec\fR(5)\&.
549 .sp
550 Added in version 246\&.
551 .RE
552 .PP
553 \fB\-\-verity\-data=\fR
554 .RS 4
555 Takes the path to a data integrity (dm\-verity) file\&. This option enables data integrity checks using dm\-verity, if a root\-hash is passed and if the used image itself does not contain the integrity data\&. The integrity data must be matched by the root hash\&. If this option is not specified, but a file with the
556 \&.verity
557 suffix is found next to the image file, bearing otherwise the same name (except if the image has the
558 \&.raw
559 suffix, in which case the verity data file must not have it in its name), the verity data is read from it and automatically used\&.
560 .sp
561 Added in version 246\&.
562 .RE
563 .PP
564 \fB\-\-pivot\-root=\fR
565 .RS 4
566 Pivot the specified directory to
567 /
568 inside the container, and either unmount the container\*(Aqs old root, or pivot it to another specified directory\&. Takes one of: a path argument \(em in which case the specified path will be pivoted to
569 /
570 and the old root will be unmounted; or a colon\-separated pair of new root path and pivot destination for the old root\&. The new root path will be pivoted to
571 /, and the old
572 /
573 will be pivoted to the other directory\&. Both paths must be absolute, and are resolved in the container\*(Aqs file system namespace\&.
574 .sp
575 This is for containers which have several bootable directories in them; for example, several
576 \fBostree\fR(1)
577 deployments\&. It emulates the behavior of the boot loader and the initrd which normally select which directory to mount as the root and start the container\*(Aqs PID 1 in\&.
578 .sp
579 Added in version 233\&.
580 .RE
581 .SS "Execution Options"
582 .PP
583 \fB\-a\fR, \fB\-\-as\-pid2\fR
584 .RS 4
585 Invoke the shell or specified program as process ID (PID) 2 instead of PID 1 (init)\&. By default, if neither this option nor
586 \fB\-\-boot\fR
587 is used, the selected program is run as the process with PID 1, a mode only suitable for programs that are aware of the special semantics that the process with PID 1 has on UNIX\&. For example, it needs to reap all processes reparented to it, and should implement
588 \fBsysvinit\fR
589 compatible signal handling (specifically: it needs to reboot on SIGINT, reexecute on SIGTERM, reload configuration on SIGHUP, and so on)\&. With
590 \fB\-\-as\-pid2\fR
591 a minimal stub init process is run as PID 1 and the selected program is executed as PID 2 (and hence does not need to implement any special semantics)\&. The stub init process will reap processes as necessary and react appropriately to signals\&. It is recommended to use this mode to invoke arbitrary commands in containers, unless they have been modified to run correctly as PID 1\&. Or in other words: this switch should be used for pretty much all commands, except when the command refers to an init or shell implementation, as these are generally capable of running correctly as PID 1\&. This option may not be combined with
592 \fB\-\-boot\fR\&.
593 .sp
594 Added in version 229\&.
595 .RE
596 .PP
597 \fB\-b\fR, \fB\-\-boot\fR
598 .RS 4
599 Automatically search for an init program and invoke it as PID 1, instead of a shell or a user supplied program\&. If this option is used, arguments specified on the command line are used as arguments for the init program\&. This option may not be combined with
600 \fB\-\-as\-pid2\fR\&.
601 .sp
602 The following table explains the different modes of invocation and relationship to
603 \fB\-\-as\-pid2\fR
604 (see above):
605 .sp
606 .it 1 an-trap
607 .nr an-no-space-flag 1
608 .nr an-break-flag 1
609 .br
610 .B Table\ \&1.\ \&Invocation Mode
611 .TS
612 allbox tab(:);
613 lB lB.
614 T{
615 Switch
616 T}:T{
617 Explanation
618 T}
619 .T&
620 l l
621 l l
622 l l.
623 T{
624 Neither \fB\-\-as\-pid2\fR nor \fB\-\-boot\fR specified
625 T}:T{
626 The passed parameters are interpreted as the command line, which is executed as PID 1 in the container\&.
627 T}
628 T{
629 \fB\-\-as\-pid2\fR specified
630 T}:T{
631 The passed parameters are interpreted as the command line, which is executed as PID 2 in the container\&. A stub init process is run as PID 1\&.
632 T}
633 T{
634 \fB\-\-boot\fR specified
635 T}:T{
636 An init program is automatically searched for and run as PID 1 in the container\&. The passed parameters are used as invocation parameters for this process\&.
637 T}
638 .TE
639 .sp 1
640 Note that
641 \fB\-\-boot\fR
642 is the default mode of operation if the
643 systemd\-nspawn@\&.service
644 template unit file is used\&.
645 .sp
646 When
647 \fB\-\-boot\fR
648 is used, the passed parameters are processed the same way the kernel processes its command line before handing it to PID 1: any
649 "KEY=VALUE"
650 assignment whose
651 "KEY"
652 does not contain a
653 "\&."
654 is exported as an environment variable for PID 1 (with
655 "\-"
656 in the key replaced by
657 "_", as if specified via
658 \fB\-\-setenv=\fR), while all other parameters (including
659 "systemd\&.*="
660 assignments) are passed as arguments to the init program\&.
661 .RE
662 .PP
663 \fB\-\-chdir=\fR
664 .RS 4
665 Change to the specified working directory before invoking the process in the container\&. Expects an absolute path in the container\*(Aqs file system namespace\&.
666 .sp
667 Added in version 229\&.
668 .RE
669 .PP
670 \fB\-E \fR\fB\fINAME\fR\fR\fB[=\fR\fB\fIVALUE\fR\fR\fB]\fR, \fB\-\-setenv=\fR\fB\fINAME\fR\fR\fB[=\fR\fB\fIVALUE\fR\fR\fB]\fR
671 .RS 4
672 Specifies an environment variable to pass to the init process in the container\&. This may be used to override the default variables or to set additional variables\&. It may be used more than once to set multiple variables\&. When
673 "="
674 and
675 \fIVALUE\fR
676 are omitted, the value of the variable with the same name in the program environment will be used\&.
677 .sp
678 Added in version 209\&.
679 .RE
680 .PP
681 \fB\-u\fR, \fB\-\-uid=\fR
682 .RS 4
683 After transitioning into the container, change to the specified user defined in the container\*(Aqs user database\&. Like all other systemd\-nspawn features, this is not a security feature and provides protection against accidental destructive operations only\&. This option was previously named
684 \fB\-\-user=\fR\&. The old name is still accepted but deprecated\&. The short option
685 \fB\-u\fR
686 is compatible with both old and new versions of
687 \fBsystemd\-nspawn\fR\&.
688 .sp
689 Note that if credentials are used in combination with a non\-root
690 \fB\-\-uid=\fR
691 (e\&.g\&.:
692 \fB\-\-set\-credential=\fR
693 or
694 \fB\-\-load\-credential=\fR), then
695 \fB\-\-no\-new\-privileges=yes\fR
696 must be used, and
697 \fB\-\-boot\fR
698 or
699 \fB\-\-as\-pid2\fR
700 must not be used, as the credentials would otherwise be unreadable by the container due to missing privileges after switching to the specified user\&.
701 .RE
702 .PP
703 \fB\-\-kill\-signal=\fR
704 .RS 4
705 Specify the process signal to send to the container\*(Aqs PID 1 when nspawn itself receives
706 \fBSIGTERM\fR, in order to trigger an orderly shutdown of the container\&. Defaults to
707 \fBSIGRTMIN+3\fR
708 if
709 \fB\-\-boot\fR
710 is used (on systemd\-compatible init systems
711 \fBSIGRTMIN+3\fR
712 triggers an orderly shutdown)\&. If
713 \fB\-\-boot\fR
714 is not used and this option is not specified, the container\*(Aqs processes are terminated abruptly via
715 \fBSIGKILL\fR\&. For a list of valid signals, see
716 \fBsignal\fR(7)\&.
717 .sp
718 Added in version 220\&.
719 .RE
720 .PP
721 \fB\-\-notify\-ready=\fR
722 .RS 4
723 Configures support for notifications from the container\*(Aqs init process\&.
724 \fB\-\-notify\-ready=\fR
725 takes a boolean\&. If false
726 \fBsystemd\-nspawn\fR
727 notifies the calling service manager with a
728 "READY=1"
729 message when the init process is created\&. If true it waits for a
730 "READY=1"
731 message from the init process in the VM before sending its own to the service manager\&. For more details about notifications see
732 \fBsd_notify\fR(3)\&.
733 .sp
734 Defaults to false\&. (Note that this is unlike the option of the same name to
735 \fBsystemd-vmspawn\fR(1)
736 that defaults to true\&.)
737 .sp
738 If
739 \fBsystemd\-nspawn\fR
740 itself is invoked with a
741 \fI$NOTIFY_SOCKET\fR
742 set in its environment (i\&.e\&. it is itself supervised by a service manager that uses the
743 \fBsd_notify\fR(3)
744 protocol),
745 "FDSTORE=1"
746 and
747 "FDSTOREREMOVE=1"
748 messages received from the container payload (along with any accompanying file descriptors and
749 "FDNAME="
750 tag) are forwarded one level up to the enveloping service manager\&. This allows the file descriptor store of services running inside the container to be preserved across container restarts (and, transitively, across restarts, re\-execs, soft\-reboots and LUO\-based kexecs of any outer service manager), provided
751 \fIFileDescriptorStoreMax=\fR/\fIFileDescriptorStorePreserve=yes\fR
752 are configured on the unit running
753 \fBsystemd\-nspawn\fR\&. See the
754 \m[blue]\fBFile Descriptor Store\fR\m[]\&\s-2\u[4]\d\s+2
755 documentation for details\&.
756 .sp
757 Added in version 231\&.
758 .RE
759 .PP
760 \fB\-\-suppress\-sync=\fR
761 .RS 4
762 Expects a boolean argument\&. If true, turns off any form of on\-disk file system synchronization for the container payload\&. This means all system calls such as
763 \fBsync\fR(2),
764 \fBfsync()\fR,
765 \fBsyncfs()\fR, \&... will execute no operation, and the
766 \fBO_SYNC\fR/\fBO_DSYNC\fR
767 flags to
768 \fBopen\fR(2)
769 and related calls will be made unavailable\&. This is potentially dangerous, as assumed data integrity guarantees to the container payload are not actually enforced (i\&.e\&. data assumed to have been written to disk might be lost if the system is shut down abnormally)\&. However, this can dramatically improve container runtime performance \(en as long as these guarantees are not required or desirable, for example because any data written by the container is of temporary, redundant nature, or just an intermediary artifact that will be further processed and finalized by a later step in a pipeline\&. Defaults to false\&.
770 .sp
771 Added in version 250\&.
772 .RE
773 .SS "System Identity Options"
774 .PP
775 \fB\-M\fR, \fB\-\-machine=\fR
776 .RS 4
777 Sets the machine name for this container\&. This name may be used to identify this container during its runtime (for example in tools like
778 \fBmachinectl\fR(1)
779 and similar), and is used to initialize the container\*(Aqs hostname (which the container can choose to override, however)\&. If not specified, the last component of the root directory path of the container is used, possibly suffixed with a random identifier in case
780 \fB\-\-ephemeral\fR
781 mode is selected\&. If the root directory selected is the host\*(Aqs root directory the host\*(Aqs hostname is used as default instead\&.
782 .sp
783 Added in version 202\&.
784 .RE
785 .PP
786 \fB\-\-hostname=\fR
787 .RS 4
788 Controls the hostname to set within the container, if different from the machine name\&. Expects a valid hostname as argument\&. If this option is used, the kernel hostname of the container will be set to this value, otherwise it will be initialized to the machine name as controlled by the
789 \fB\-\-machine=\fR
790 option described above\&. The machine name is used for various aspect of identification of the container from the outside, the kernel hostname configurable with this option is useful for the container to identify itself from the inside\&. It is usually a good idea to keep both forms of identification synchronized, in order to avoid confusion\&. It is hence recommended to avoid usage of this option, and use
791 \fB\-\-machine=\fR
792 exclusively\&. Note that regardless whether the container\*(Aqs hostname is initialized from the name set with
793 \fB\-\-hostname=\fR
794 or the one set with
795 \fB\-\-machine=\fR, the container can later override its kernel hostname freely on its own as well\&.
796 .sp
797 Added in version 239\&.
798 .RE
799 .PP
800 \fB\-\-uuid=\fR
801 .RS 4
802 Set the specified UUID for the container\&. The init system will initialize
803 /etc/machine\-id
804 from this if this file is not set yet\&. Note that this option takes effect only if
805 /etc/machine\-id
806 in the container is unpopulated\&.
807 .RE
808 .SS "Property Options"
809 .PP
810 \fB\-S\fR, \fB\-\-slice=\fR
811 .RS 4
812 Make the container part of the specified slice, instead of the default
813 machine\&.slice\&. This applies only if the machine is run in its own scope unit, i\&.e\&. if
814 \fB\-\-keep\-unit\fR
815 is not used\&.
816 .sp
817 Added in version 206\&.
818 .RE
819 .PP
820 \fB\-\-property=\fR
821 .RS 4
822 Set a unit property on the scope unit to register for the machine\&. This applies only if the machine is run in its own scope unit, i\&.e\&. if
823 \fB\-\-keep\-unit\fR
824 is not used\&. Takes unit property assignments in the same format as
825 \fBsystemctl set\-property\fR\&. This is useful to set memory limits and similar for the container\&.
826 .sp
827 Added in version 220\&.
828 .RE
829 .PP
830 \fB\-\-register=\fR
831 .RS 4
832 Controls whether the container is registered with
833 \fBsystemd-machined\fR(8)\&. Takes a boolean argument or
834 "auto", and defaults to
835 "auto"\&. This option should be enabled when the container runs a full Operating System (more specifically: a system and service manager as PID 1), and is useful to ensure that the container is accessible via
836 \fBmachinectl\fR(1)
837 and shown by tools such as
838 \fBps\fR(1)\&. If the container does not run a service manager, it is recommended to set this option to
839 "no"\&. When set to
840 "auto", registration is attempted but failures are ignored\&.
841 .sp
842 Added in version 209\&.
843 .RE
844 .PP
845 \fB\-\-keep\-unit\fR
846 .RS 4
847 Instead of creating a transient scope unit to run the container in, simply use the service or scope unit
848 \fBsystemd\-nspawn\fR
849 has been invoked in\&. If
850 \fB\-\-register=yes\fR
851 is set this unit is registered with
852 \fBsystemd-machined\fR(8)\&. This switch should be used if
853 \fBsystemd\-nspawn\fR
854 is invoked from within a service unit, and the service unit\*(Aqs sole purpose is to run a single
855 \fBsystemd\-nspawn\fR
856 container\&. This option is not available if run from a user session\&.
857 .sp
858 Note that passing
859 \fB\-\-keep\-unit\fR
860 disables the effect of
861 \fB\-\-slice=\fR
862 and
863 \fB\-\-property=\fR\&. Use
864 \fB\-\-keep\-unit\fR
865 and
866 \fB\-\-register=no\fR
867 in combination to disable any kind of unit allocation or registration with
868 \fBsystemd\-machined\fR\&.
869 .sp
870 Added in version 209\&.
871 .RE
872 .SS "User Namespacing Options"
873 .PP
874 \fB\-\-private\-users=\fR
875 .RS 4
876 Controls user namespacing\&. If enabled, the container will run with its own private set of UNIX user and group ids (UIDs and GIDs)\&. This involves mapping the private UIDs/GIDs used in the container (starting with the container\*(Aqs root user 0 and up) to a range of UIDs/GIDs on the host that are not used for other purposes (usually in the range beyond the host\*(Aqs UID/GID 65536)\&. The parameter may be specified as follows:
877 .sp
878 .RS 4
879 .ie n \{\
880 \h'-04' 1.\h'+01'\c
881 .\}
882 .el \{\
883 .sp -1
884 .IP " 1." 4.2
885 .\}
886 If one or two colon\-separated numbers are specified, user namespacing is turned on\&. The first parameter specifies the first host UID/GID to assign to the container, the second parameter specifies the number of host UIDs/GIDs to assign to the container\&. If the second parameter is omitted, 65536 UIDs/GIDs are assigned\&.
887 .RE
888 .sp
889 .RS 4
890 .ie n \{\
891 \h'-04' 2.\h'+01'\c
892 .\}
893 .el \{\
894 .sp -1
895 .IP " 2." 4.2
896 .\}
897 If the parameter is
898 "yes", user namespacing is turned on\&. The UID/GID range to use is determined automatically from the file ownership of the root directory of the container\*(Aqs directory tree\&. To use this option, make sure to prepare the directory tree in advance, and ensure that all files and directories in it are owned by UIDs/GIDs in the range you\*(Aqd like to use\&. Also, make sure that used file ACLs exclusively reference UIDs/GIDs in the appropriate range\&. In this mode, the number of UIDs/GIDs assigned to the container is 65536, and the owner UID/GID of the root directory must be a multiple of 65536\&.
899 .RE
900 .sp
901 .RS 4
902 .ie n \{\
903 \h'-04' 3.\h'+01'\c
904 .\}
905 .el \{\
906 .sp -1
907 .IP " 3." 4.2
908 .\}
909 The special value
910 "pick"
911 turns on user namespacing\&. In this case the UID/GID range is automatically chosen\&. As first step, the file owner UID/GID of the root directory of the container\*(Aqs directory tree is read, and it is checked that no other container is currently using it\&. If this check is successful, the UID/GID range determined this way is used, similarly to the behavior if
912 "yes"
913 is specified\&. If the check is not successful (and thus the UID/GID range indicated in the root directory\*(Aqs file owner is already used elsewhere) a new \(en currently unused \(en UID/GID range of 65536 UIDs/GIDs is randomly chosen between the host UID/GIDs of 524288 and 1878982656, always starting at a multiple of 65536, and, if possible, consistently hashed from the machine name\&. This setting implies
914 \fB\-\-private\-users\-ownership=auto\fR
915 (see below), which possibly has the effect that the files and directories in the container\*(Aqs directory tree will be owned by the appropriate users of the range picked\&. Using this option makes user namespace behavior fully automatic\&. Note that the first invocation of a previously unused container image might result in picking a new UID/GID range for it, and thus in the (possibly expensive) file ownership adjustment operation\&. However, subsequent invocations of the container will be cheap (unless of course the picked UID/GID range is assigned to a different use by then)\&.
916 .RE
917 .sp
918 .RS 4
919 .ie n \{\
920 \h'-04' 4.\h'+01'\c
921 .\}
922 .el \{\
923 .sp -1
924 .IP " 4." 4.2
925 .\}
926 If the parameter is
927 "no", user namespacing is turned off\&. This is the default when
928 \fBsystemd\-nspawn\fR
929 is invoked directly\&. (Note that the
930 systemd\-nspawn@\&.service
931 unit enables private users\&.) This option is not secure and must not be used to run untrusted code\&.
932 .RE
933 .sp
934 .RS 4
935 .ie n \{\
936 \h'-04' 5.\h'+01'\c
937 .\}
938 .el \{\
939 .sp -1
940 .IP " 5." 4.2
941 .\}
942 If the parameter is
943 "identity", user namespacing is employed with an identity mapping for the first 65536 UIDs/GIDs\&. This is mostly equivalent to
944 \fB\-\-private\-users=0:65536\fR\&. While it does not provide UID/GID isolation, since all host and container UIDs/GIDs are chosen identically it does provide process capability isolation, but may be useful if proper user namespacing with distinct UID maps is not possible\&. This option is not secure and must not be used to run untrusted code\&.
945 .RE
946 .sp
947 .RS 4
948 .ie n \{\
949 \h'-04' 6.\h'+01'\c
950 .\}
951 .el \{\
952 .sp -1
953 .IP " 6." 4.2
954 .\}
955 If the parameter is
956 "managed", user namespacing is employed with in
957 \fImanaged\fR
958 mode, i\&.e\&. allocation of a UID range is delegated to
959 \fBsystemd-nsresourced.service\fR(8)\&. This mode is selected by default if invoked unprivileged, but can also be requested explicitly when privileged\&. In this mode a 64K UID range is automatically picked\&.
960 .RE
961 .sp
962 It is recommended to assign at least 65536 UIDs/GIDs to each container, so that the usable UID/GID range in the container covers 16 bits\&. For best security, do not assign overlapping UID/GID ranges to multiple containers\&. It is hence a good idea to use the upper 16 bit of the host 32\-bit UIDs/GIDs as container identifier, while the lower 16 bits encode the container UID/GID used\&. This is in fact the behavior enforced by the
963 \fB\-\-private\-users=pick\fR
964 option\&.
965 .sp
966 When user namespaces are used, the GID range assigned to each container is always chosen identical to the UID range\&.
967 .sp
968 In most cases,
969 \fB\-\-private\-users=managed\fR
970 (or when privileged
971 \fB\-\-private\-users=pick\fR, too) is the recommended option as user namespacing is advised for security, and this option massively enhances container security while operating fully automatically in most cases\&.
972 .sp
973 Note that the picked UID/GID range is not written to
974 /etc/passwd
975 or
976 /etc/group\&. In fact, the allocation of the range is not stored persistently, except possibly in the file ownership of the files and directories of the container, see
977 \fB\-\-private\-users\-ownership=\fR\&.
978 .sp
979 Note that when user namespacing is used without UID mapping (see below) file ownership on disk reflects this, and all of the container\*(Aqs files and directories are owned by the container\*(Aqs effective user and group IDs\&. This means that copying files from and to the container image requires correction of the numeric UID/GID values, according to the UID/GID shift applied\&.
980 .sp
981 Note that for fully unprivileged operation in
982 "managed"
983 mode, any directory image should be owned by the foreign UID range\&.
984 .sp
985 Added in version 220\&.
986 .RE
987 .PP
988 \fB\-\-private\-users\-ownership=\fR
989 .RS 4
990 Controls how to adjust the container image\*(Aqs UIDs and GIDs to match the UID/GID range chosen with
991 \fB\-\-private\-users=\fR, see above\&. Takes one of
992 "off"
993 (to leave the image as is),
994 "chown"
995 (to recursively
996 \fBchown()\fR
997 the container\*(Aqs directory tree as needed),
998 "map"
999 (in order to use transparent ID mapping mounts from UID 0 to the target UID range),
1000 "foreign"
1001 (the same, but from the foreign UID range base) or
1002 "auto"
1003 for automatically using
1004 "map"
1005 or
1006 "foreign", where available and applicable and
1007 "chown"
1008 where not\&.
1009 .sp
1010 If
1011 "chown"
1012 is selected, all files and directories in the container\*(Aqs directory tree will be adjusted so that they are owned by the appropriate UIDs/GIDs selected for the container (see above)\&. This operation is potentially expensive, as it involves iterating through the full directory tree of the container\&. Besides actual file ownership, file ACLs are adjusted as well\&.
1013 .sp
1014 Typically
1015 "foreign"
1016 or
1017 "map"
1018 is the best choice, since it transparently maps UIDs/GIDs in memory as needed without modifying the image, and without requiring an expensive recursive adjustment operation\&. However, it is not available for all file systems, currently\&.
1019 .sp
1020 The
1021 \fB\-\-private\-users\-ownership=auto\fR
1022 option is implied if
1023 \fB\-\-private\-users=pick\fR
1024 is used\&. This option has no effect if user namespacing is not used\&.
1025 .sp
1026 \fBsystemd-dissect\fR(1)\*(Aqs
1027 \fB\-\-shift\fR
1028 switch may be used to shift UID/GID ownership from or to the 0, foreign or specific container UID/GID base outside of any
1029 \fBsystemd\-nspawn\fR
1030 invocation\&.
1031 .sp
1032 Added in version 230\&.
1033 .RE
1034 .PP
1035 \fB\-\-private\-users\-delegate=\fR
1036 .RS 4
1037 Takes a non\-negative integer\&. Requests that the specified number of additional 64K UID/GID ranges are delegated into the container\*(Aqs user namespace\&. These delegated ranges are mapped 1:1 (i\&.e\&. the same UID/GID values are used inside and outside the user namespace) and can be used by nested containers to allocate their own transient UID/GID ranges via
1038 \fBsystemd-nsresourced.service\fR(8)\&.
1039 .sp
1040 This option requires
1041 \fB\-\-private\-users=managed\fR, as the delegation is performed by
1042 \fBsystemd-nsresourced.service\fR(8)
1043 as part of the user namespace allocation\&. The maximum number of delegated ranges is 16\&. Defaults to 0, i\&.e\&. no delegation\&.
1044 .sp
1045 When this option is used with a non\-zero value, the
1046 \fBsystemd-nsresourced.service\fR(8)
1047 Varlink socket (/run/systemd/io\&.systemd\&.NamespaceResource) is automatically bind\-mounted into the container along with the necessary discovery symlinks in
1048 /run/systemd/userdb/
1049 and
1050 /run/varlink/registry/\&. This allows processes inside the container to contact
1051 \fBsystemd\-nsresourced\fR
1052 on the host in order to allocate nested user namespaces from the delegated ranges\&.
1053 .sp
1054 Added in version 260\&.
1055 .RE
1056 .PP
1057 \fB\-U\fR
1058 .RS 4
1059 If the kernel supports the user namespaces feature, equivalent to
1060 \fB\-\-private\-users=pick \-\-private\-users\-ownership=auto\fR, otherwise equivalent to
1061 \fB\-\-private\-users=no\fR\&.
1062 .sp
1063 Note that
1064 \fB\-U\fR
1065 is the default if the
1066 systemd\-nspawn@\&.service
1067 template unit file is used\&.
1068 .sp
1069 Note: it is possible to undo the effect of
1070 \fB\-\-private\-users\-ownership=chown\fR
1071 (or
1072 \fB\-U\fR) on the file system by redoing the operation with the first UID of 0:
1073 .sp
1074 .if n \{\
1075 .RS 4
1076 .\}
1077 .nf
1078 systemd\-nspawn \&... \-\-private\-users=0 \-\-private\-users\-ownership=chown
1079 .fi
1080 .if n \{\
1081 .RE
1082 .\}
1083 .sp
1084 Added in version 230\&.
1085 .RE
1086 .SS "Networking Options"
1087 .PP
1088 \fB\-\-private\-network\fR
1089 .RS 4
1090 Disconnect networking of the container from the host\&. This makes all network interfaces unavailable in the container, with the exception of the loopback device and those specified with
1091 \fB\-\-network\-interface=\fR
1092 and configured with
1093 \fB\-\-network\-veth\fR\&. If this option is specified, the
1094 \fBCAP_NET_ADMIN\fR
1095 capability will be added to the set of capabilities the container retains\&. The latter may be disabled by using
1096 \fB\-\-drop\-capability=\fR\&. If this option is not specified (or implied by one of the options listed below), the container will have full access to the host network\&.
1097 .RE
1098 .PP
1099 \fB\-\-network\-interface=\fR
1100 .RS 4
1101 Assign the specified network interface to the container\&. Either takes a single interface name, referencing the name on the host, or a colon\-separated pair of interfaces, in which case the first one references the name on the host, and the second one the name in the container\&. When the container terminates, the interface is moved back to the calling namespace and renamed to its original name\&. Note that
1102 \fB\-\-network\-interface=\fR
1103 implies
1104 \fB\-\-private\-network\fR\&. This option may be used more than once to add multiple network interfaces to the container\&.
1105 .sp
1106 Note that any network interface specified this way must already exist at the time the container is started\&. If the container shall be started automatically at boot via a
1107 systemd\-nspawn@\&.service
1108 unit file instance, it might hence make sense to add a unit file drop\-in to the service instance (e\&.g\&.
1109 /etc/systemd/system/systemd\-nspawn@foobar\&.service\&.d/50\-network\&.conf) with contents like the following:
1110 .sp
1111 .if n \{\
1112 .RS 4
1113 .\}
1114 .nf
1115 [Unit]
1116 Wants=sys\-subsystem\-net\-devices\-ens1\&.device
1117 After=sys\-subsystem\-net\-devices\-ens1\&.device
1118 .fi
1119 .if n \{\
1120 .RE
1121 .\}
1122 .sp
1123 This will make sure that activation of the container service will be delayed until the
1124 "ens1"
1125 network interface has shown up\&. This is required since hardware probing is fully asynchronous, and network interfaces might be discovered only later during the boot process, after the container would normally be started without these explicit dependencies\&.
1126 .sp
1127 Added in version 209\&.
1128 .RE
1129 .PP
1130 \fB\-\-network\-macvlan=\fR
1131 .RS 4
1132 Create a
1133 "macvlan"
1134 interface of the specified Ethernet network interface and add it to the container\&. Either takes a single interface name, referencing the name on the host, or a colon\-separated pair of interfaces, in which case the first one references the name on the host, and the second one the name in the container\&. A
1135 "macvlan"
1136 interface is a virtual interface that adds a second MAC address to an existing physical Ethernet link\&. If the container interface name is not defined, the interface in the container will be named after the interface on the host, prefixed with
1137 "mv\-"\&. Note that
1138 \fB\-\-network\-macvlan=\fR
1139 implies
1140 \fB\-\-private\-network\fR\&. This option may be used more than once to add multiple network interfaces to the container\&.
1141 .sp
1142 As with
1143 \fB\-\-network\-interface=\fR, the underlying Ethernet network interface must already exist at the time the container is started, and thus similar unit file drop\-ins as described above might be useful\&.
1144 .sp
1145 Added in version 211\&.
1146 .RE
1147 .PP
1148 \fB\-\-network\-ipvlan=\fR
1149 .RS 4
1150 Create an
1151 "ipvlan"
1152 interface of the specified Ethernet network interface and add it to the container\&. Either takes a single interface name, referencing the name on the host, or a colon\-separated pair of interfaces, in which case the first one references the name on the host, and the second one the name in the container\&. An
1153 "ipvlan"
1154 interface is a virtual interface, similar to a
1155 "macvlan"
1156 interface, which uses the same MAC address as the underlying interface\&. If the container interface name is not defined, the interface in the container will be named after the interface on the host, prefixed with
1157 "iv\-"\&. Note that
1158 \fB\-\-network\-ipvlan=\fR
1159 implies
1160 \fB\-\-private\-network\fR\&. This option may be used more than once to add multiple network interfaces to the container\&.
1161 .sp
1162 As with
1163 \fB\-\-network\-interface=\fR, the underlying Ethernet network interface must already exist at the time the container is started, and thus similar unit file drop\-ins as described above might be useful\&.
1164 .sp
1165 Added in version 219\&.
1166 .RE
1167 .PP
1168 \fB\-n\fR, \fB\-\-network\-veth\fR
1169 .RS 4
1170 Create a virtual Ethernet link ("veth") between host and container\&. The host side of the Ethernet link will be available as a network interface named after the container\*(Aqs name (as specified with
1171 \fB\-\-machine=\fR), prefixed with
1172 "ve\-"\&. The container side of the Ethernet link will be named
1173 "host0"\&. The
1174 \fB\-\-network\-veth\fR
1175 option implies
1176 \fB\-\-private\-network\fR\&.
1177 .sp
1178 Note that
1179 \fBsystemd-networkd.service\fR(8)
1180 includes by default a network file
1181 /usr/lib/systemd/network/80\-container\-ve\&.network
1182 matching the host\-side interfaces created this way, which contains settings to enable automatic address provisioning on the created virtual link via DHCP, as well as automatic IP routing onto the host\*(Aqs external network interfaces\&. It also contains
1183 /usr/lib/systemd/network/80\-container\-host0\&.network
1184 matching the container\-side interface created this way, containing settings to enable client side address assignment via DHCP\&. In case
1185 systemd\-networkd
1186 is running on both the host and inside the container, automatic IP communication from the container to the host is thus available, with further connectivity to the external network\&.
1187 .sp
1188 Note that
1189 \fB\-\-network\-veth\fR
1190 is the default if the
1191 systemd\-nspawn@\&.service
1192 template unit file is used\&.
1193 .sp
1194 Note that on Linux network interface names may have a length of 15 characters at maximum, while container names may have a length up to 64 characters\&. As this option derives the host\-side interface name from the container name the name is possibly truncated\&. Thus, care needs to be taken to ensure that interface names remain unique in this case, or even better container names are generally not chosen longer than 12 characters, to avoid the truncation\&. If the name is truncated,
1195 \fBsystemd\-nspawn\fR
1196 will automatically append a 4\-digit hash value to the name to reduce the chance of collisions\&. However, the hash algorithm is not collision\-free\&. (See
1197 \fBsystemd.net-naming-scheme\fR(7)
1198 for details on older naming algorithms for this interface)\&. Alternatively, the
1199 \fB\-\-network\-veth\-extra=\fR
1200 option may be used, which allows free configuration of the host\-side interface name independently of the container name \(em but might require a bit more additional configuration in case bridging in a fashion similar to
1201 \fB\-\-network\-bridge=\fR
1202 is desired\&.
1203 .sp
1204 Added in version 209\&.
1205 .RE
1206 .PP
1207 \fB\-\-network\-veth\-extra=\fR
1208 .RS 4
1209 Adds an additional virtual Ethernet link between host and container\&. Takes a colon\-separated pair of host interface name and container interface name\&. The latter may be omitted in which case the container and host sides will be assigned the same name\&. This switch is independent of
1210 \fB\-\-network\-veth\fR, and \(em in contrast \(em may be used multiple times, and allows configuration of the network interface names\&. Note that
1211 \fB\-\-network\-bridge=\fR
1212 has no effect on interfaces created with
1213 \fB\-\-network\-veth\-extra=\fR\&.
1214 .sp
1215 Added in version 228\&.
1216 .RE
1217 .PP
1218 \fB\-\-network\-bridge=\fR
1219 .RS 4
1220 Adds the host side of the Ethernet link created with
1221 \fB\-\-network\-veth\fR
1222 to the specified Ethernet bridge interface\&. Expects a valid network interface name of a bridge device as argument\&. Note that
1223 \fB\-\-network\-bridge=\fR
1224 implies
1225 \fB\-\-network\-veth\fR\&. If this option is used, the host side of the Ethernet link will use the
1226 "vb\-"
1227 prefix instead of
1228 "ve\-"\&. Regardless of the used naming prefix the same network interface name length limits imposed by Linux apply, along with the complications this creates (for details see above)\&.
1229 .sp
1230 As with
1231 \fB\-\-network\-interface=\fR, the underlying bridge network interface must already exist at the time the container is started, and thus similar unit file drop\-ins as described above might be useful\&.
1232 .sp
1233 Added in version 209\&.
1234 .RE
1235 .PP
1236 \fB\-\-network\-zone=\fR
1237 .RS 4
1238 Creates a virtual Ethernet link ("veth") to the container and adds it to an automatically managed Ethernet bridge interface\&. The bridge interface is named after the passed argument, prefixed with
1239 "vz\-"\&. The bridge interface is automatically created when the first container configured for its name is started, and is automatically removed when the last container configured for its name exits\&. Hence, each bridge interface configured this way exists only as long as there\*(Aqs at least one container referencing it running\&. This option is very similar to
1240 \fB\-\-network\-bridge=\fR, besides this automatic creation/removal of the bridge device\&.
1241 .sp
1242 This setting makes it easy to place multiple related containers on a common, virtual Ethernet\-based broadcast domain, here called a "zone"\&. Each container may only be part of one zone, but each zone may contain any number of containers\&. Each zone is referenced by its name\&. Names may be chosen freely (as long as they form valid network interface names when prefixed with
1243 "vz\-"), and it is sufficient to pass the same name to the
1244 \fB\-\-network\-zone=\fR
1245 switch of the various concurrently running containers to join them in one zone\&.
1246 .sp
1247 Note that
1248 \fBsystemd-networkd.service\fR(8)
1249 includes by default a network file
1250 /usr/lib/systemd/network/80\-container\-vz\&.network
1251 matching the bridge interfaces created this way, which contains settings to enable automatic address provisioning on the created virtual network via DHCP, as well as automatic IP routing onto the host\*(Aqs external network interfaces\&. Using
1252 \fB\-\-network\-zone=\fR
1253 is hence in most cases fully automatic and sufficient to connect multiple local containers in a joined broadcast domain to the host, with further connectivity to the external network\&.
1254 .sp
1255 Added in version 230\&.
1256 .RE
1257 .PP
1258 \fB\-\-network\-namespace\-path=\fR
1259 .RS 4
1260 Takes the path to a file representing a kernel network namespace that the container shall run in\&. The specified path should refer to a (possibly bind\-mounted) network namespace file, as exposed by the kernel below
1261 /proc/$PID/ns/net\&. This makes the container enter the given network namespace\&. One of the typical use cases is to give a network namespace under
1262 /run/netns
1263 created by
1264 \fBip-netns\fR(8), for example,
1265 \fB\-\-network\-namespace\-path=/run/netns/foo\fR\&. Note that this option cannot be used together with other network\-related options, such as
1266 \fB\-\-private\-network\fR
1267 or
1268 \fB\-\-network\-interface=\fR\&.
1269 .sp
1270 Added in version 236\&.
1271 .RE
1272 .PP
1273 \fB\-p\fR, \fB\-\-port=\fR
1274 .RS 4
1275 If private networking is enabled, maps an IP port on the host onto an IP port on the container\&. Takes a protocol specifier (either
1276 "tcp"
1277 or
1278 "udp"), separated by a colon from a host port number in the range 1 to 65535, separated by a colon from a container port number in the range from 1 to 65535\&. The protocol specifier and its separating colon may be omitted, in which case
1279 "tcp"
1280 is assumed\&. The container port number and its colon may be omitted, in which case the same port as the host port is implied\&. This option is only supported if private networking is used, such as with
1281 \fB\-\-network\-veth\fR,
1282 \fB\-\-network\-zone=\fR
1283 \fB\-\-network\-bridge=\fR\&.
1284 .sp
1285 Added in version 219\&.
1286 .RE
1287 .SS "Security Options"
1288 .PP
1289 \fB\-\-capability=\fR
1290 .RS 4
1291 List one or more additional capabilities to grant the container\&. Takes a comma\-separated list of capability names, see
1292 \fBcapabilities\fR(7)
1293 for more information\&. Note that the following capabilities will be granted in any way:
1294 \fBCAP_AUDIT_CONTROL\fR,
1295 \fBCAP_AUDIT_WRITE\fR,
1296 \fBCAP_CHOWN\fR,
1297 \fBCAP_DAC_OVERRIDE\fR,
1298 \fBCAP_DAC_READ_SEARCH\fR,
1299 \fBCAP_FOWNER\fR,
1300 \fBCAP_FSETID\fR,
1301 \fBCAP_IPC_OWNER\fR,
1302 \fBCAP_KILL\fR,
1303 \fBCAP_LEASE\fR,
1304 \fBCAP_LINUX_IMMUTABLE\fR,
1305 \fBCAP_MKNOD\fR,
1306 \fBCAP_NET_BIND_SERVICE\fR,
1307 \fBCAP_NET_BROADCAST\fR,
1308 \fBCAP_NET_RAW\fR,
1309 \fBCAP_SETFCAP\fR,
1310 \fBCAP_SETGID\fR,
1311 \fBCAP_SETPCAP\fR,
1312 \fBCAP_SETUID\fR,
1313 \fBCAP_SYS_ADMIN\fR,
1314 \fBCAP_SYS_BOOT\fR,
1315 \fBCAP_SYS_CHROOT\fR,
1316 \fBCAP_SYS_NICE\fR,
1317 \fBCAP_SYS_PTRACE\fR,
1318 \fBCAP_SYS_RESOURCE\fR,
1319 \fBCAP_SYS_TTY_CONFIG\fR\&. Also
1320 \fBCAP_NET_ADMIN\fR
1321 is retained if
1322 \fB\-\-private\-network\fR
1323 is specified\&. If the special value
1324 "all"
1325 is passed, all capabilities are retained\&.
1326 .sp
1327 If the special value of
1328 "help"
1329 is passed, the program will print known capability names and exit\&.
1330 .sp
1331 This option sets the bounding set of capabilities which also limits the ambient capabilities as given with the
1332 \fB\-\-ambient\-capability=\fR\&.
1333 .sp
1334 Added in version 186\&.
1335 .RE
1336 .PP
1337 \fB\-\-drop\-capability=\fR
1338 .RS 4
1339 Specify one or more additional capabilities to drop for the container\&. This allows running the container with fewer capabilities than the default (see above)\&.
1340 .sp
1341 If the special value of
1342 "help"
1343 is passed, the program will print known capability names and exit\&.
1344 .sp
1345 This option sets the bounding set of capabilities which also limits the ambient capabilities as given with the
1346 \fB\-\-ambient\-capability=\fR\&.
1347 .sp
1348 Added in version 209\&.
1349 .RE
1350 .PP
1351 \fB\-\-ambient\-capability=\fR
1352 .RS 4
1353 Specify one or more additional capabilities to pass in the inheritable and ambient set to the program started within the container\&. The value
1354 "all"
1355 is not supported for this setting\&.
1356 .sp
1357 All capabilities specified here must be in the set allowed with the
1358 \fB\-\-capability=\fR
1359 and
1360 \fB\-\-drop\-capability=\fR
1361 options\&. Otherwise, an error message will be shown\&.
1362 .sp
1363 This option cannot be combined with the boot mode of the container (as requested via
1364 \fB\-\-boot\fR)\&.
1365 .sp
1366 If the special value of
1367 "help"
1368 is passed, the program will print known capability names and exit\&.
1369 .sp
1370 Added in version 248\&.
1371 .RE
1372 .PP
1373 \fB\-\-no\-new\-privileges=\fR
1374 .RS 4
1375 Takes a boolean argument\&. Specifies the value of the
1376 \fBPR_SET_NO_NEW_PRIVS\fR
1377 flag for the container payload\&. Defaults to off\&. When turned on the payload code of the container cannot acquire new privileges, i\&.e\&. the "setuid" file bit as well as file system capabilities will not have an effect anymore\&. See
1378 \fBprctl\fR(2)
1379 for details about this flag\&.
1380 .sp
1381 Added in version 239\&.
1382 .RE
1383 .PP
1384 \fB\-\-system\-call\-filter=\fR
1385 .RS 4
1386 Alter the system call filter applied to containers\&. Takes a space\-separated list of system call names or group names (the latter prefixed with
1387 "@", as listed by the
1388 \fBsyscall\-filter\fR
1389 command of
1390 \fBsystemd-analyze\fR(1))\&. Passed system calls will be permitted\&. The list may optionally be prefixed by
1391 "~", in which case all listed system calls are prohibited\&. If this command line option is used multiple times the configured lists are combined\&. If both a positive and a negative list (that is one system call list without and one with the
1392 "~"
1393 prefix) are configured, the negative list takes precedence over the positive list\&. Note that
1394 \fBsystemd\-nspawn\fR
1395 always implements a system call allow list (as opposed to a deny list!), and this command line option hence adds or removes entries from the default allow list, depending on the
1396 "~"
1397 prefix\&. Note that the applied system call filter is also altered implicitly if additional capabilities are passed using the
1398 \fB\-\-capabilities=\fR\&.
1399 .sp
1400 Added in version 235\&.
1401 .RE
1402 .PP
1403 \fB\-\-restrict\-address\-families=\fR
1404 .RS 4
1405 Restrict the socket address families accessible to the container\&. Takes a space\-separated list of address family names, such as
1406 \fBAF_INET\fR,
1407 \fBAF_INET6\fR
1408 or
1409 \fBAF_UNIX\fR\&. When prefixed with
1410 "~"
1411 the listed address families will be prohibited, otherwise they will be permitted (allowlisted)\&. Use the special value
1412 "none"
1413 to prohibit all address families\&. This option may be specified more than once, in which case the configured lists are combined\&. If both a positive and a negative list are configured, the negative list takes precedence over the positive list\&.
1414 .sp
1415 Note that currently this option defaults to no restrictions, i\&.e\&. all address families are accessible\&. In a future version of systemd, the default will be changed to restrict address families to
1416 \fBAF_INET\fR,
1417 \fBAF_INET6\fR
1418 and
1419 \fBAF_UNIX\fR\&. Use
1420 \fB\-\-restrict\-address\-families=\fR
1421 (with an empty argument) or set
1422 \fIRestrictAddressFamilies=\fR
1423 in a
1424 \&.nspawn
1425 file to opt out of filtering explicitly\&.
1426 .sp
1427 Added in version 261\&.
1428 .RE
1429 .PP
1430 \fB\-Z\fR, \fB\-\-selinux\-context=\fR
1431 .RS 4
1432 Sets the SELinux security context to be used to label processes in the container\&.
1433 .sp
1434 Added in version 209\&.
1435 .RE
1436 .PP
1437 \fB\-L\fR, \fB\-\-selinux\-apifs\-context=\fR
1438 .RS 4
1439 Sets the SELinux security context to be used to label files in the virtual API file systems in the container\&.
1440 .sp
1441 Added in version 209\&.
1442 .RE
1443 .SS "Resource Options"
1444 .PP
1445 \fB\-\-rlimit=\fR
1446 .RS 4
1447 Sets the specified POSIX resource limit for the container payload\&. Expects an assignment of the form
1448 "\fILIMIT\fR=\fISOFT\fR:\fIHARD\fR"
1449 or
1450 "\fILIMIT\fR=\fIVALUE\fR", where
1451 \fILIMIT\fR
1452 should refer to a resource limit type, such as
1453 \fBRLIMIT_NOFILE\fR
1454 or
1455 \fBRLIMIT_NICE\fR\&. The
1456 \fISOFT\fR
1457 and
1458 \fIHARD\fR
1459 fields should refer to the numeric soft and hard resource limit values\&. If the second form is used,
1460 \fIVALUE\fR
1461 may specify a value that is used both as soft and hard limit\&. In place of a numeric value the special string
1462 "infinity"
1463 may be used to turn off resource limiting for the specific type of resource\&. This command line option may be used multiple times to control limits on multiple limit types\&. If used multiple times for the same limit type, the last use wins\&. For details about resource limits see
1464 \fBsetrlimit\fR(2)\&. By default resource limits for the container\*(Aqs init process (PID 1) are set to the same values the Linux kernel originally passed to the host init system\&. Note that some resource limits are enforced on resources counted per user, in particular
1465 \fBRLIMIT_NPROC\fR\&. This means that unless user namespacing is deployed (i\&.e\&.
1466 \fB\-\-private\-users=\fR
1467 is used, see above), any limits set will be applied to the resource usage of the same user on all local containers as well as the host\&. This means particular care needs to be taken with these limits as they might be triggered by possibly less trusted code\&. Example:
1468 "\-\-rlimit=RLIMIT_NOFILE=8192:16384"\&.
1469 .sp
1470 Added in version 239\&.
1471 .RE
1472 .PP
1473 \fB\-\-oom\-score\-adjust=\fR
1474 .RS 4
1475 Changes the OOM ("Out Of Memory") score adjustment value for the container payload\&. This controls
1476 /proc/self/oom_score_adj
1477 which influences the preference with which this container is terminated when memory becomes scarce\&. For details see
1478 \fBproc\fR(5)\&. Takes an integer in the range \-1000\&...1000\&.
1479 .sp
1480 Added in version 239\&.
1481 .RE
1482 .PP
1483 \fB\-\-cpu\-affinity=\fR
1484 .RS 4
1485 Controls the CPU affinity of the container payload\&. Takes a comma separated list of CPU numbers or number ranges (the latter\*(Aqs start and end value separated by dashes)\&. See
1486 \fBsched_setaffinity\fR(2)
1487 for details\&.
1488 .sp
1489 Added in version 239\&.
1490 .RE
1491 .PP
1492 \fB\-\-personality=\fR
1493 .RS 4
1494 Control the architecture ("personality") reported by
1495 \fBuname\fR(2)
1496 in the container\&. Currently, only
1497 "x86"
1498 and
1499 "x86\-64"
1500 are supported\&. This is useful when running a 32\-bit container on a 64\-bit host\&. If this setting is not used, the personality reported in the container is the same as the one reported on the host\&.
1501 .sp
1502 Added in version 209\&.
1503 .RE
1504 .SS "Integration Options"
1505 .PP
1506 \fB\-\-resolv\-conf=\fR
1507 .RS 4
1508 Configures how
1509 /etc/resolv\&.conf
1510 inside of the container shall be handled (i\&.e\&. DNS configuration synchronization from host to container)\&. Takes one of
1511 "off",
1512 "copy\-host",
1513 "copy\-static",
1514 "copy\-uplink",
1515 "copy\-stub",
1516 "replace\-host",
1517 "replace\-static",
1518 "replace\-uplink",
1519 "replace\-stub",
1520 "bind\-host",
1521 "bind\-static",
1522 "bind\-uplink",
1523 "bind\-stub",
1524 "delete"
1525 or
1526 "auto"\&.
1527 .sp
1528 If set to
1529 "off"
1530 the
1531 /etc/resolv\&.conf
1532 file in the container is left as it is included in the image, and neither modified nor bind mounted over\&.
1533 .sp
1534 If set to
1535 "copy\-host", the
1536 /etc/resolv\&.conf
1537 file from the host is copied into the container, unless the file exists already and is not a regular file (e\&.g\&. a symlink)\&. Similarly, if
1538 "replace\-host"
1539 is used the file is copied, replacing any existing inode, including symlinks\&. Similarly, if
1540 "bind\-host"
1541 is used, the file is bind mounted from the host into the container\&.
1542 .sp
1543 If set to
1544 "copy\-static",
1545 "replace\-static"
1546 or
1547 "bind\-static"
1548 the static
1549 resolv\&.conf
1550 file supplied with
1551 \fBsystemd-resolved.service\fR(8)
1552 (specifically:
1553 /usr/lib/systemd/resolv\&.conf) is copied or bind mounted into the container\&.
1554 .sp
1555 If set to
1556 "copy\-uplink",
1557 "replace\-uplink"
1558 or
1559 "bind\-uplink"
1560 the uplink
1561 resolv\&.conf
1562 file managed by
1563 systemd\-resolved\&.service
1564 (specifically:
1565 /run/systemd/resolve/resolv\&.conf) is copied or bind mounted into the container\&.
1566 .sp
1567 If set to
1568 "copy\-stub",
1569 "replace\-stub"
1570 or
1571 "bind\-stub"
1572 the stub
1573 resolv\&.conf
1574 file managed by
1575 systemd\-resolved\&.service
1576 (specifically:
1577 /run/systemd/resolve/stub\-resolv\&.conf) is copied or bind mounted into the container\&.
1578 .sp
1579 If set to
1580 "delete"
1581 the
1582 /etc/resolv\&.conf
1583 file in the container is deleted if it exists\&.
1584 .sp
1585 Finally, if set to
1586 "auto"
1587 the file is left as it is if private networking is turned on (see
1588 \fB\-\-private\-network\fR)\&. Otherwise, if
1589 systemd\-resolved\&.service
1590 is running its stub
1591 resolv\&.conf
1592 file is used, and if not the host\*(Aqs
1593 /etc/resolv\&.conf
1594 file\&. In the latter cases the file is copied if the image is writable, and bind mounted otherwise\&.
1595 .sp
1596 It\*(Aqs recommended to use
1597 "copy\-\&..."
1598 or
1599 "replace\-\&..."
1600 if the container shall be able to make changes to the DNS configuration on its own, deviating from the host\*(Aqs settings\&. Otherwise,
1601 "bind"
1602 is preferable, as it means direct changes to
1603 /etc/resolv\&.conf
1604 in the container are not allowed, as it is a read\-only bind mount (but note that if the container has enough privileges, it might simply go ahead and unmount the bind mount anyway)\&. Note that both if the file is bind mounted and if it is copied no further propagation of configuration is generally done after the one\-time early initialization (this is because the file is usually updated through copying and renaming)\&. Defaults to
1605 "auto"\&.
1606 .sp
1607 Added in version 239\&.
1608 .RE
1609 .PP
1610 \fB\-\-timezone=\fR
1611 .RS 4
1612 Configures how
1613 /etc/localtime
1614 inside of the container (i\&.e\&. local timezone synchronization from host to container) shall be handled\&. Takes one of
1615 "off",
1616 "copy",
1617 "bind",
1618 "symlink",
1619 "delete"
1620 or
1621 "auto"\&. If set to
1622 "off"
1623 the
1624 /etc/localtime
1625 file in the container is left as it is included in the image, and neither modified nor bind mounted over\&. If set to
1626 "copy"
1627 the
1628 /etc/localtime
1629 file of the host is copied into the container\&. Similarly, if
1630 "bind"
1631 is used, the file is bind mounted from the host into the container\&. If set to
1632 "symlink", a symlink is created pointing from
1633 /etc/localtime
1634 in the container to the timezone file in the container that matches the timezone setting on the host\&. If set to
1635 "delete", the file in the container is deleted, should it exist\&. If set to
1636 "auto"
1637 and the
1638 /etc/localtime
1639 file of the host is a symlink, then
1640 "symlink"
1641 mode is used, and
1642 "copy"
1643 otherwise, except if the image is read\-only in which case
1644 "bind"
1645 is used instead\&. Defaults to
1646 "auto"\&.
1647 .sp
1648 Added in version 239\&.
1649 .RE
1650 .PP
1651 \fB\-\-link\-journal=\fR
1652 .RS 4
1653 Control whether the container\*(Aqs journal shall be made visible to the host system\&. If enabled, allows viewing the container\*(Aqs journal files from the host (but not vice versa)\&. Takes one of
1654 "no",
1655 "host",
1656 "try\-host",
1657 "guest",
1658 "try\-guest",
1659 "auto"\&. If
1660 "no", the journal is not linked\&. If
1661 "host", the journal files are stored on the host file system (beneath
1662 /var/log/journal/\fImachine\-id\fR) and the subdirectory is bind\-mounted into the container at the same location\&. If
1663 "guest", the journal files are stored on the guest file system (beneath
1664 /var/log/journal/\fImachine\-id\fR) and the subdirectory is symlinked into the host at the same location\&.
1665 "try\-host"
1666 and
1667 "try\-guest"
1668 do the same but do not fail if the host does not have persistent journaling enabled, or if the container is in the
1669 \fB\-\-ephemeral\fR
1670 mode\&. If
1671 "auto"
1672 (the default), and the right subdirectory of
1673 /var/log/journal
1674 exists, it will be bind mounted into the container\&. If the subdirectory does not exist, no linking is performed\&. Effectively, booting a container once with
1675 "guest"
1676 or
1677 "host"
1678 will link the journal persistently if further on the default of
1679 "auto"
1680 is used\&.
1681 .sp
1682 Note that
1683 \fB\-\-link\-journal=try\-guest\fR
1684 is the default if the
1685 systemd\-nspawn@\&.service
1686 template unit file is used\&.
1687 .sp
1688 Added in version 187\&.
1689 .RE
1690 .PP
1691 \fB\-j\fR
1692 .RS 4
1693 Equivalent to
1694 \fB\-\-link\-journal=try\-guest\fR\&.
1695 .sp
1696 Added in version 187\&.
1697 .RE
1698 .PP
1699 \fB\-\-forward\-journal=\fR
1700 .RS 4
1701 Forward the container\*(Aqs journal to the host by starting
1702 \fBsystemd-journal-remote\fR(8)
1703 listening on a Unix socket that is bind\-mounted into the container\&. The container\*(Aqs
1704 \fBsystemd-journald\fR(8)
1705 connects to the socket via the
1706 \fIjournal\&.forward_to_socket\fR
1707 credential and streams journal entries to the host in real\-time\&. Takes a path to a journal file or directory where the received entries will be stored\&. If the path ends in
1708 "\&.journal", entries are written to a single file; otherwise, entries are split per host into the specified directory\&.
1709 .sp
1710 Added in version 261\&.
1711 .RE
1712 .PP
1713 \fB\-\-forward\-journal\-max\-use=\fR\fB\fIBYTES\fR\fR, \fB\-\-forward\-journal\-keep\-free=\fR\fB\fIBYTES\fR\fR, \fB\-\-forward\-journal\-max\-file\-size=\fR\fB\fIBYTES\fR\fR, \fB\-\-forward\-journal\-max\-files=\fR\fB\fIN\fR\fR
1714 .RS 4
1715 These options configure the corresponding settings of
1716 \fBsystemd-journal-remote\fR(8)
1717 when forwarding journal entries from the container\&. See
1718 \fBjournal-remote.conf\fR(5)
1719 for the descriptions of these settings\&.
1720 .sp
1721 Added in version 261\&.
1722 .RE
1723 .SS "Mount Options"
1724 .PP
1725 \fB\-\-bind=\fR, \fB\-\-bind\-ro=\fR
1726 .RS 4
1727 Bind mount a file or directory from the host into the container\&. Takes one of: a path argument\ \&\(em in which case the specified path will be mounted from the host to the same path in the container, or a colon\-separated pair of paths\ \&\(em in which case the first specified path is the source in the host, and the second path is the destination in the container, or a colon\-separated triple of source path, destination path and mount options\&. The source path may optionally be prefixed with a
1728 "+"
1729 character\&. If so, the source path is taken relative to the image\*(Aqs root directory\&. This permits setting up bind mounts within the container image\&. The source path may be specified as empty string, in which case a temporary directory below the host\*(Aqs
1730 /var/tmp/
1731 directory is used\&. It is automatically removed when the container is shut down\&. If the source path is not absolute, it is resolved relative to the current working directory\&. The
1732 \fB\-\-bind\-ro=\fR
1733 option creates read\-only bind mounts\&. Backslash escapes are interpreted, so
1734 "\e:"
1735 may be used to embed colons in either path\&. This option may be specified multiple times for creating multiple independent bind mount points\&.
1736 .sp
1737 Mount options are comma\-separated\&.
1738 \fBrbind\fR
1739 and
1740 \fBnorbind\fR
1741 control whether to create a recursive or a regular bind mount\&. Defaults to
1742 \fBrbind\fR\&.
1743 \fBnoidmap\fR,
1744 \fBidmap\fR,
1745 \fBrootidmap\fR
1746 and
1747 \fBowneridmap\fR
1748 control ID mapping\&.
1749 .sp
1750 Using
1751 \fBidmap\fR,
1752 \fBrootidmap\fR
1753 or
1754 \fBowneridmap\fR
1755 requires support by the source filesystem for user/group ID mapped mounts\&. Defaults to
1756 \fBnoidmap\fR\&. With
1757 \fBx\fR
1758 being the container\*(Aqs UID range offset,
1759 \fBy\fR
1760 being the length of the container\*(Aqs UID range, and
1761 \fBp\fR
1762 being the owner UID of the bind mount source inode on the host:
1763 .sp
1764 .RS 4
1765 .ie n \{\
1766 \h'-04'\(bu\h'+03'\c
1767 .\}
1768 .el \{\
1769 .sp -1
1770 .IP \(bu 2.3
1771 .\}
1772 If
1773 \fBnoidmap\fR
1774 is used, any user
1775 \fBz\fR
1776 in the range
1777 \fB0 \&... y\fR
1778 seen from inside of the container is mapped to
1779 \fBx + z\fR
1780 in the
1781 \fBx \&... x + y\fR
1782 range on the host\&. Other host users are mapped to
1783 \fBnobody\fR
1784 inside the container\&.
1785 .RE
1786 .sp
1787 .RS 4
1788 .ie n \{\
1789 \h'-04'\(bu\h'+03'\c
1790 .\}
1791 .el \{\
1792 .sp -1
1793 .IP \(bu 2.3
1794 .\}
1795 If
1796 \fBidmap\fR
1797 is used, any user
1798 \fBz\fR
1799 in the UID range
1800 \fB0 \&... y\fR
1801 as seen from inside the container is mapped to the same
1802 \fBz\fR
1803 in the same
1804 \fB0 \&... y\fR
1805 range on the host\&. Other host users are mapped to
1806 \fBnobody\fR
1807 inside the container\&.
1808 .RE
1809 .sp
1810 .RS 4
1811 .ie n \{\
1812 \h'-04'\(bu\h'+03'\c
1813 .\}
1814 .el \{\
1815 .sp -1
1816 .IP \(bu 2.3
1817 .\}
1818 If
1819 \fBrootidmap\fR
1820 is used, the user
1821 \fB0\fR
1822 seen from inside of the container is mapped to
1823 \fBp\fR
1824 on the host\&. Other host users are mapped to
1825 \fBnobody\fR
1826 inside the container\&.
1827 .RE
1828 .sp
1829 .RS 4
1830 .ie n \{\
1831 \h'-04'\(bu\h'+03'\c
1832 .\}
1833 .el \{\
1834 .sp -1
1835 .IP \(bu 2.3
1836 .\}
1837 If
1838 \fBowneridmap\fR
1839 is used, the owner of the target directory inside of the container is mapped to
1840 \fBp\fR
1841 on the host\&. Other host users are mapped to
1842 \fBnobody\fR
1843 inside the container\&.
1844 .RE
1845 .sp
1846 Whichever ID mapping option is used, the same mapping will be used for users and groups IDs\&. If
1847 \fBrootidmap\fR
1848 or
1849 \fBowneridmap\fR
1850 are used, the group owning the bind mounted directory will have no effect\&.
1851 .sp
1852 Note that when this option is used in combination with
1853 \fB\-\-private\-users\fR, the resulting mount points will be owned by the
1854 \fBnobody\fR
1855 user\&. That\*(Aqs because the mount and its files and directories continue to be owned by the relevant host users and groups, which do not exist in the container, and thus show up under the wildcard UID 65534 (nobody)\&. If such bind mounts are created, it is recommended to make them read\-only, using
1856 \fB\-\-bind\-ro=\fR\&. Alternatively you can use the "idmap" mount option to map the filesystem IDs\&.
1857 .sp
1858 Added in version 198\&.
1859 .RE
1860 .PP
1861 \fB\-\-bind\-user=\fR
1862 .RS 4
1863 Binds the home directory of the specified user on the host into the container\&. Takes the name of an existing user on the host as argument\&. May be used multiple times to bind multiple users into the container\&. This does two things:
1864 .sp
1865 .RS 4
1866 .ie n \{\
1867 \h'-04' 1.\h'+01'\c
1868 .\}
1869 .el \{\
1870 .sp -1
1871 .IP " 1." 4.2
1872 .\}
1873 The user\*(Aqs home directory is bind mounted from the host into
1874 /run/host/home/, using an idmapped mount to map the host user\*(Aqs UID/GID to its assigned UID/GID in the container\&.
1875 .RE
1876 .sp
1877 .RS 4
1878 .ie n \{\
1879 \h'-04' 2.\h'+01'\c
1880 .\}
1881 .el \{\
1882 .sp -1
1883 .IP " 2." 4.2
1884 .\}
1885 A JSON user and group record is generated in
1886 /run/userdb/
1887 that describes the mapped user\&. It contains a minimized representation of the host\*(Aqs user record, adjusted to the UID/GID and home directory path assigned to the user in the container\&. The
1888 \fBnss-systemd\fR(8)
1889 glibc NSS module will pick up these records from there and make them available in the container\*(Aqs user/group databases\&.
1890 .RE
1891 .sp
1892 The combination of the two operations above ensures that it is possible to log into the container using the same account information as on the host\&. The user is only mapped transiently, while the container is running, and the mapping itself does not result in persistent changes to the container (except maybe for log messages generated at login time, and similar)\&. Note that in particular the UID/GID assignment in the container is not made persistently\&. If the user is mapped transiently, it is best to not allow the user to make persistent changes to the container\&. If the user leaves files or directories owned by the user, and those UIDs/GIDs are reused during later container invocations (possibly with a different
1893 \fB\-\-bind\-user=\fR
1894 mapping), those files and directories will be accessible to the "new" user\&.
1895 .sp
1896 The user/group record mapping only works if the container contains systemd 249 or newer, with
1897 \fBnss\-systemd\fR
1898 properly configured in
1899 nsswitch\&.conf\&. See
1900 \fBnss-systemd\fR(8)
1901 for details\&.
1902 .sp
1903 Note that the user record propagated from the host into the container will contain the UNIX password hash of the user, so that seamless logins in the container are possible\&. If the container is less trusted than the host it is hence important to use a strong UNIX password hash function (e\&.g\&. yescrypt or similar, with the
1904 "$y$"
1905 hash prefix)\&.
1906 .sp
1907 When binding a user from the host into the container checks are executed to ensure that the username is not yet known in the container\&. Moreover, it is checked that the UID/GID allocated for it is not currently defined in the user/group databases of the container\&. Both checks directly access the container\*(Aqs
1908 /etc/passwd
1909 and
1910 /etc/group, and thus might not detect existing accounts in other databases\&.
1911 .sp
1912 Added in version 249\&.
1913 .RE
1914 .PP
1915 \fB\-\-bind\-user\-shell=\fR
1916 .RS 4
1917 When used with
1918 \fB\-\-bind\-user=\fR, includes the specified shell in the user records of users bound into the container\&. Takes either a boolean or an absolute path\&.
1919 .sp
1920 .RS 4
1921 .ie n \{\
1922 \h'-04'\(bu\h'+03'\c
1923 .\}
1924 .el \{\
1925 .sp -1
1926 .IP \(bu 2.3
1927 .\}
1928 If false (the default), no shell is passed in the user records for users bound into the container\&. This causes bound users to the use the container\*(Aqs default shell\&.
1929 .RE
1930 .sp
1931 .RS 4
1932 .ie n \{\
1933 \h'-04'\(bu\h'+03'\c
1934 .\}
1935 .el \{\
1936 .sp -1
1937 .IP \(bu 2.3
1938 .\}
1939 If true, the shells specified by the host user records are included in the user records of all users bound into the container\&.
1940 .RE
1941 .sp
1942 .RS 4
1943 .ie n \{\
1944 \h'-04'\(bu\h'+03'\c
1945 .\}
1946 .el \{\
1947 .sp -1
1948 .IP \(bu 2.3
1949 .\}
1950 If passed an absolute path, sets that path as the shell for user records of all users bound into the container\&.
1951 .RE
1952 .sp
1953 Note: This will not check whether the specified shells exist in the container\&.
1954 .sp
1955 This operation is only supported in combination with
1956 \fB\-\-bind\-user=\fR\&.
1957 .sp
1958 Added in version 258\&.
1959 .RE
1960 .PP
1961 \fB\-\-bind\-user\-group=\fR\fB\fINAME\fR\fR
1962 .RS 4
1963 When used with
1964 \fB\-\-bind\-user=\fR, includes the specified group as an auxiliary group in the user records of users bound into the container\&. Takes a group name\&.
1965 .sp
1966 Note: This will not check whether the specified groups exist in the container\&.
1967 .sp
1968 This operation is only supported in combination with
1969 \fB\-\-bind\-user=\fR\&.
1970 .sp
1971 Added in version 259\&.
1972 .RE
1973 .PP
1974 \fB\-\-inaccessible=\fR
1975 .RS 4
1976 Make the specified path inaccessible in the container\&. This over\-mounts the specified path (which must exist in the container) with a file node of the same type that is empty and has the most restrictive access mode supported\&. This is an effective way to mask files, directories and other file system objects from the container payload\&. This option may be used more than once in case all specified paths are masked\&.
1977 .sp
1978 Added in version 242\&.
1979 .RE
1980 .PP
1981 \fB\-\-tmpfs=\fR
1982 .RS 4
1983 Mount a tmpfs file system into the container\&. Takes a single absolute path argument that specifies where to mount the tmpfs instance to (in which case the directory access mode will be chosen as 0755, owned by root/root), or optionally a colon\-separated pair of path and mount option string that is used for mounting (in which case the kernel default for access mode and owner will be chosen, unless otherwise specified)\&. Backslash escapes are interpreted in the path, so
1984 "\e:"
1985 may be used to embed colons in the path\&.
1986 .sp
1987 Note that this option cannot be used to replace the root file system of the container with a temporary file system\&. However, the
1988 \fB\-\-volatile=\fR
1989 option described below provides similar functionality, with a focus on implementing stateless operating system images\&.
1990 .sp
1991 Added in version 214\&.
1992 .RE
1993 .PP
1994 \fB\-\-overlay=\fR, \fB\-\-overlay\-ro=\fR
1995 .RS 4
1996 Combine multiple directory trees into one overlay file system and mount it into the container\&. Takes a list of colon\-separated paths to the directory trees to combine and the destination mount point\&.
1997 .sp
1998 Backslash escapes are interpreted in the paths, so
1999 "\e:"
2000 may be used to embed colons in the paths\&.
2001 .sp
2002 If three or more paths are specified, then the last specified path is the destination mount point in the container, all paths specified before refer to directory trees on the host and are combined in the specified order into one overlay file system\&. The left\-most path is hence the lowest directory tree, the second\-to\-last path the highest directory tree in the stacking order\&. If
2003 \fB\-\-overlay\-ro=\fR
2004 is used instead of
2005 \fB\-\-overlay=\fR, a read\-only overlay file system is created\&. If a writable overlay file system is created, all changes made to it are written to the highest directory tree in the stacking order, i\&.e\&. the second\-to\-last specified\&.
2006 .sp
2007 If only two paths are specified, then the second specified path is used both as the top\-level directory tree in the stacking order as seen from the host, as well as the mount point for the overlay file system in the container\&. At least two paths have to be specified\&.
2008 .sp
2009 The source paths may optionally be prefixed with
2010 "+"
2011 character\&. If so they are taken relative to the image\*(Aqs root directory\&. The uppermost source path may also be specified as an empty string, in which case a temporary directory below the host\*(Aqs
2012 /var/tmp/
2013 is used\&. The directory is removed automatically when the container is shut down\&. This behaviour is useful in order to make read\-only container directories writable while the container is running\&. For example, use
2014 "\-\-overlay=+/var::/var"
2015 in order to automatically overlay a writable temporary directory on a read\-only
2016 /var/
2017 directory\&. If a source path is not absolute, it is resolved relative to the current working directory\&.
2018 .sp
2019 For details about overlay file systems, see
2020 \m[blue]\fBOverlay Filesystem\fR\m[]\&\s-2\u[5]\d\s+2\&. Note that the semantics of overlay file systems are substantially different from normal file systems, in particular regarding reported device and inode information\&. Device and inode information may change for a file while it is being written to, and processes might see out\-of\-date versions of files at times\&. Note that this switch automatically derives the
2021 "workdir="
2022 mount option for the overlay file system from the top\-level directory tree, making it a sibling of it\&. It is hence essential that the top\-level directory tree is not a mount point itself (since the working directory must be on the same file system as the top\-most directory tree)\&. Also note that the
2023 "lowerdir="
2024 mount option receives the paths to stack in the opposite order of this switch\&.
2025 .sp
2026 Note that this option cannot be used to replace the root file system of the container with an overlay file system\&. However, the
2027 \fB\-\-volatile=\fR
2028 option described above provides similar functionality, with a focus on implementing stateless operating system images\&.
2029 .sp
2030 Added in version 220\&.
2031 .RE
2032 .SS "Input/Output Options"
2033 .PP
2034 \fB\-\-console=\fR\fB\fIMODE\fR\fR
2035 .RS 4
2036 Configures how to set up standard input, output and error output for the container payload, as well as the
2037 /dev/console
2038 device for the container\&. Takes one of
2039 \fBinteractive\fR,
2040 \fBread\-only\fR,
2041 \fBpassive\fR,
2042 \fBpipe\fR
2043 or
2044 \fBautopipe\fR\&. If
2045 \fBinteractive\fR, a pseudo\-TTY is allocated and made available as
2046 /dev/console
2047 in the container\&. It is then bi\-directionally connected to the standard input and output passed to
2048 \fBsystemd\-nspawn\fR\&.
2049 \fBread\-only\fR
2050 is similar but only the output of the container is propagated and no input from the caller is read\&. If
2051 \fBpassive\fR, a pseudo TTY is allocated, but it is not connected anywhere\&. In
2052 \fBpipe\fR
2053 mode no pseudo TTY is allocated, but the standard input, output and error output file descriptors passed to
2054 \fBsystemd\-nspawn\fR
2055 are passed on \(em as they are \(em to the container payload, see the following paragraph\&. Finally,
2056 \fBautopipe\fR
2057 mode operates like
2058 \fBinteractive\fR
2059 when
2060 \fBsystemd\-nspawn\fR
2061 is invoked on a terminal, and like
2062 \fBpipe\fR
2063 otherwise\&. Defaults to
2064 \fBinteractive\fR
2065 if
2066 \fBsystemd\-nspawn\fR
2067 is invoked from a terminal, and
2068 \fBread\-only\fR
2069 otherwise\&.
2070 .sp
2071 In
2072 \fBpipe\fR
2073 mode,
2074 /dev/console
2075 will not exist in the container\&. This means that the container payload generally cannot be a full init system as init systems tend to require
2076 /dev/console
2077 to be available\&. On the other hand, in this mode container invocations can be used within shell pipelines\&. This is because intermediary pseudo TTYs do not permit independent bidirectional propagation of the end\-of\-file (EOF) condition, which is necessary for shell pipelines to work correctly\&.
2078 \fINote that the \fR\fI\fBpipe\fR\fR\fI mode should be used carefully\fR, as passing arbitrary file descriptors to less trusted container payloads might open up unwanted interfaces for access by the container payload\&. For example, if a passed file descriptor refers to a TTY of some form, APIs such as
2079 \fBTIOCSTI\fR
2080 may be used to synthesize input that might be used for escaping the container\&. Hence
2081 \fBpipe\fR
2082 mode should only be used if the payload is sufficiently trusted or when the standard input/output/error output file descriptors are known safe, for example pipes\&.
2083 .sp
2084 Added in version 242\&.
2085 .RE
2086 .PP
2087 \fB\-\-pipe\fR, \fB\-P\fR
2088 .RS 4
2089 Equivalent to
2090 \fB\-\-console=pipe\fR\&.
2091 .sp
2092 Added in version 242\&.
2093 .RE
2094 .PP
2095 \fB\-\-background=\fR\fB\fICOLOR\fR\fR
2096 .RS 4
2097 Change the terminal background color to the specified ANSI color as long as the container runs\&. The color specified should be an ANSI X3\&.64 SGR background color, i\&.e\&. strings such as
2098 "40",
2099 "41", \&...,
2100 "47",
2101 "48;2;\&...",
2102 "48;5;\&..."\&. See
2103 \m[blue]\fBANSI Escape Code (Wikipedia)\fR\m[]\&\s-2\u[6]\d\s+2
2104 for details\&. Assign an empty string to disable any coloring\&.
2105 .sp
2106 Added in version 256\&.
2107 .RE
2108 .SS "Credentials"
2109 .PP
2110 \fB\-\-load\-credential=\fR\fB\fIID\fR\fR\fB:\fR\fB\fIPATH\fR\fR, \fB\-\-set\-credential=\fR\fB\fIID\fR\fR\fB:\fR\fB\fIVALUE\fR\fR
2111 .RS 4
2112 Pass a credential to the container\&. These two options correspond to the
2113 \fILoadCredential=\fR
2114 and
2115 \fISetCredential=\fR
2116 settings in unit files\&. See
2117 \fBsystemd.exec\fR(5)
2118 for details about these concepts, as well as the syntax of the option\*(Aqs arguments\&.
2119 .sp
2120 Note: when
2121 \fBsystemd\-nspawn\fR
2122 runs as systemd system service it can propagate the credentials it received via
2123 \fILoadCredential=\fR/\fISetCredential=\fR
2124 to the container payload\&. A systemd service manager running as PID 1 in the container can further propagate them to the services it itself starts\&. It is thus possible to easily propagate credentials from a parent service manager to a container manager service and from there into its payload\&. This can even be done recursively\&.
2125 .sp
2126 In order to embed binary data into the credential data for
2127 \fB\-\-set\-credential=\fR, use C\-style escaping (i\&.e\&.
2128 "\en"
2129 to embed a newline, or
2130 "\ex00"
2131 to embed a
2132 \fBNUL\fR
2133 byte)\&. Note that the invoking shell might already apply unescaping once, hence this might require double escaping!
2134 .sp
2135 The
2136 \fBsystemd-sysusers.service\fR(8)
2137 and
2138 \fBsystemd-firstboot\fR(1)
2139 services read credentials configured this way for the purpose of configuring the container\*(Aqs root user\*(Aqs password and shell, as well as system locale, keymap and timezone during the first boot process of the container\&. This is particularly useful in combination with
2140 \fB\-\-volatile=yes\fR
2141 where every single boot appears as first boot, since configuration applied to
2142 /etc/
2143 is lost on container reboot cycles\&. See the respective man pages for details\&. Example:
2144 .sp
2145 .if n \{\
2146 .RS 4
2147 .\}
2148 .nf
2149 # systemd\-nspawn \-i image\&.raw \e
2150 \-\-volatile=yes \e
2151 \-\-set\-credential=firstboot\&.locale:de_DE\&.UTF\-8 \e
2152 \-\-set\-credential=passwd\&.hashed\-password\&.root:\*(Aq$y$j9T$yAuRJu1o5HioZAGDYPU5d\&.$F64ni6J2y2nNQve90M/p0ZP0ECP/qqzipNyaY9fjGpC\*(Aq \e
2153 \-b
2154 .fi
2155 .if n \{\
2156 .RE
2157 .\}
2158 .sp
2159 The above command line will invoke the specified image file
2160 image\&.raw
2161 in volatile mode, i\&.e\&. with empty
2162 /etc/
2163 and
2164 /var/\&. The container payload will recognize this as a first boot, and will invoke
2165 systemd\-firstboot\&.service, which then reads the two passed credentials to configure the system\*(Aqs initial locale and root password\&.
2166 .sp
2167 Added in version 247\&.
2168 .RE
2169 .SS "Other"
2170 .PP
2171 \fB\-\-system\fR, \fB\-\-user\fR
2172 .RS 4
2173 Specify whether to run in system or user scope\&. This controls which service manager and machined instance to interact with, as well as operational defaults such as user namespace mode and private networking\&. If neither is specified,
2174 \fB\-\-system\fR
2175 is implied when running as root,
2176 \fB\-\-user\fR
2177 otherwise\&.
2178 .sp
2179 Note: for backwards compatibility,
2180 \fB\-\-user\fR
2181 followed by a positional argument is interpreted as the deprecated
2182 \fB\-\-user=\fR\fB\fINAME\fR\fR
2183 form (now
2184 \fB\-\-uid=\fR)\&. To use
2185 \fB\-\-user\fR
2186 for scope selection when positional arguments follow, separate them with
2187 "\-\-"\&.
2188 .sp
2189 Added in version 261\&.
2190 .RE
2191 .PP
2192 \fB\-\-no\-pager\fR
2193 .RS 4
2194 Do not pipe output into a pager\&.
2195 .RE
2196 .PP
2197 \fB\-h\fR, \fB\-\-help\fR
2198 .RS 4
2199 Print a short help text and exit\&.
2200 .RE
2201 .PP
2202 \fB\-\-version\fR
2203 .RS 4
2204 Print a short version string and exit\&.
2205 .RE
2206 .PP
2207 \fB\-\-no\-ask\-password\fR
2208 .RS 4
2209 Do not query the user for authentication for privileged operations\&.
2210 .RE
2211 .SH "HOTKEYS"
2212 .PP
2213 When invoked in interactive mode (i\&.e\&. the default
2214 \fB\-\-console=interactive\fR), a few special keyboard shortcuts are understood that control the container runtime\&. These shortcuts need to be typed within 1s to have effect, otherwise they will be forwarded to the container as regular keypresses\&.
2215 .PP
2216 Ctrl\-] Ctrl\-] Ctrl\-]
2217 .RS 4
2218 Immediately terminate the container, killing all processes\&.
2219 .RE
2220 .PP
2221 Ctrl\-] Ctrl\-] r
2222 .RS 4
2223 Issue a reboot request to the container\&.
2224 .sp
2225 Added in version 258\&.
2226 .RE
2227 .PP
2228 Ctrl\-] Ctrl\-] p
2229 .RS 4
2230 Issue a shutdown request to the container\&.
2231 .sp
2232 Added in version 258\&.
2233 .RE
2234 .SH "ENVIRONMENT"
2235 .PP
2236 \fI$SYSTEMD_LOG_LEVEL\fR
2237 .RS 4
2238 The maximum log level of emitted messages (messages with a higher log level, i\&.e\&. less important ones, will be suppressed)\&. Takes a comma\-separated list of values\&. A value may be either one of (in order of decreasing importance)
2239 \fBemerg\fR,
2240 \fBalert\fR,
2241 \fBcrit\fR,
2242 \fBerr\fR,
2243 \fBwarning\fR,
2244 \fBnotice\fR,
2245 \fBinfo\fR,
2246 \fBdebug\fR, or an integer in the range 0\&...7\&. See
2247 \fBsyslog\fR(3)
2248 for more information\&. Each value may optionally be prefixed with one of
2249 \fBconsole\fR,
2250 \fBsyslog\fR,
2251 \fBkmsg\fR
2252 or
2253 \fBjournal\fR
2254 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
2255 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
2256 specifies to log at debug level except when logging to the console which should be at info level)\&. Note that the global maximum log level takes priority over any per target maximum log levels\&.
2257 .RE
2258 .PP
2259 \fI$SYSTEMD_LOG_COLOR\fR
2260 .RS 4
2261 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
2262 .sp
2263 This setting is only useful when messages are written directly to the terminal, because
2264 \fBjournalctl\fR(1)
2265 and other tools that display logs will color messages based on the log level on their own\&.
2266 .RE
2267 .PP
2268 \fI$SYSTEMD_LOG_TIME\fR
2269 .RS 4
2270 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
2271 .sp
2272 This setting is only useful when messages are written directly to the terminal or a file, because
2273 \fBjournalctl\fR(1)
2274 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
2275 .RE
2276 .PP
2277 \fI$SYSTEMD_LOG_LOCATION\fR
2278 .RS 4
2279 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
2280 .sp
2281 Note that the log location is often attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
2282 .RE
2283 .PP
2284 \fI$SYSTEMD_LOG_TID\fR
2285 .RS 4
2286 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
2287 .sp
2288 Note that the this information is attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
2289 .RE
2290 .PP
2291 \fI$SYSTEMD_LOG_TARGET\fR
2292 .RS 4
2293 The destination for log messages\&. One of
2294 \fBconsole\fR
2295 (log to the attached tty),
2296 \fBconsole\-prefixed\fR
2297 (log to the attached tty but with prefixes encoding the log level and "facility", see
2298 \fBsyslog\fR(3),
2299 \fBkmsg\fR
2300 (log to the kernel circular log buffer),
2301 \fBjournal\fR
2302 (log to the journal),
2303 \fBjournal\-or\-kmsg\fR
2304 (log to the journal if available, and to kmsg otherwise),
2305 \fBauto\fR
2306 (determine the appropriate log target automatically, the default),
2307 \fBnull\fR
2308 (disable log output)\&.
2309 .RE
2310 .PP
2311 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
2312 .RS 4
2313 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
2314 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
2315 .RE
2316 .PP
2317 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
2318 .RS 4
2319 Pager to use when
2320 \fB\-\-no\-pager\fR
2321 is not given\&.
2322 \fI$SYSTEMD_PAGER\fR
2323 is used if set; otherwise
2324 \fI$PAGER\fR
2325 is used\&. If neither
2326 \fI$SYSTEMD_PAGER\fR
2327 nor
2328 \fI$PAGER\fR
2329 are set, a set of well\-known pager implementations is tried in turn, including
2330 \fBless\fR(1)
2331 and
2332 \fBmore\fR(1), until one is found\&. If no pager implementation is discovered, no pager is invoked\&. Setting those environment variables to an empty string or the value
2333 "cat"
2334 is equivalent to passing
2335 \fB\-\-no\-pager\fR\&.
2336 .sp
2337 Note: if
2338 \fI$SYSTEMD_PAGERSECURE\fR
2339 is not set,
2340 \fI$SYSTEMD_PAGER\fR
2341 and
2342 \fI$PAGER\fR
2343 can only be used to disable the pager (with
2344 "cat"
2345 or
2346 ""), and are otherwise ignored\&.
2347 .RE
2348 .PP
2349 \fI$SYSTEMD_LESS\fR
2350 .RS 4
2351 Override the options passed to
2352 \fBless\fR
2353 (by default
2354 "FRSXMK")\&.
2355 .sp
2356 Users might want to change two options in particular:
2357 .PP
2358 \fBK\fR
2359 .RS 4
2360 This option instructs the pager to exit immediately when
2361 Ctrl+C
2362 is pressed\&. To allow
2363 \fBless\fR
2364 to handle
2365 Ctrl+C
2366 itself to switch back to the pager command prompt, unset this option\&.
2367 .sp
2368 If the value of
2369 \fI$SYSTEMD_LESS\fR
2370 does not include
2371 "K", and the pager that is invoked is
2372 \fBless\fR,
2373 Ctrl+C
2374 will be ignored by the executable, and needs to be handled by the pager\&.
2375 .RE
2376 .PP
2377 \fBX\fR
2378 .RS 4
2379 This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal\&. It is set by default to allow command output to remain visible in the terminal even after the pager exits\&. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse\&.
2380 .RE
2381 .sp
2382 Note that setting the regular
2383 \fI$LESS\fR
2384 environment variable has no effect for
2385 \fBless\fR
2386 invocations by systemd tools\&.
2387 .sp
2388 See
2389 \fBless\fR(1)
2390 for more discussion\&.
2391 .RE
2392 .PP
2393 \fI$SYSTEMD_LESSCHARSET\fR
2394 .RS 4
2395 Override the charset passed to
2396 \fBless\fR
2397 (by default
2398 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
2399 .sp
2400 Note that setting the regular
2401 \fI$LESSCHARSET\fR
2402 environment variable has no effect for
2403 \fBless\fR
2404 invocations by systemd tools\&.
2405 .RE
2406 .PP
2407 \fI$SYSTEMD_PAGERSECURE\fR
2408 .RS 4
2409 Common pager commands like
2410 \fBless\fR(1), in addition to "paging", i\&.e\&. scrolling through the output, support opening of or writing to other files and running arbitrary shell commands\&. When commands are invoked with elevated privileges, for example under
2411 \fBsudo\fR(8)
2412 or
2413 \fBpkexec\fR(1), the pager becomes a security boundary\&. Care must be taken that only programs with strictly limited functionality are used as pagers, and unintended interactive features like opening or creation of new files or starting of subprocesses are not allowed\&. "Secure mode" for the pager may be enabled as described below,
2414 \fIif the pager supports that\fR
2415 (most pagers are not written in a way that takes this into consideration)\&. It is recommended to either explicitly enable "secure mode" or to completely disable the pager using
2416 \fB\-\-no\-pager\fR
2417 or
2418 \fIPAGER=cat\fR
2419 when allowing untrusted users to execute commands with elevated privileges\&.
2420 .sp
2421 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
2422 \fBLESSSECURE=1\fR
2423 will be set when invoking the pager, which instructs the pager to disable commands that open or create new files or start new subprocesses\&. Currently only
2424 \fBless\fR(1)
2425 is known to understand this variable and implement "secure mode"\&.
2426 .sp
2427 When set to false, no limitation is placed on the pager\&. Setting
2428 \fISYSTEMD_PAGERSECURE=0\fR
2429 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
2430 .sp
2431 When
2432 \fI$SYSTEMD_PAGERSECURE\fR
2433 is not set, systemd tools attempt to automatically figure out if "secure mode" should be enabled and whether the pager supports it\&. "Secure mode" is enabled if the effective UID is not the same as the owner of the login session, see
2434 \fBgeteuid\fR(2)
2435 and
2436 \fBsd_pid_get_owner_uid\fR(3), or when running under
2437 \fBsudo\fR(8)
2438 or similar tools (\fI$SUDO_UID\fR
2439 is set
2440 \&\s-2\u[7]\d\s+2)\&. In those cases,
2441 \fISYSTEMD_PAGERSECURE=1\fR
2442 will be set and pagers which are not known to implement "secure mode" will not be used at all\&. Note that this autodetection only covers the most common mechanisms to elevate privileges and is intended as convenience\&. It is recommended to explicitly set
2443 \fI$SYSTEMD_PAGERSECURE\fR
2444 or disable the pager\&.
2445 .sp
2446 Note that if the
2447 \fI$SYSTEMD_PAGER\fR
2448 or
2449 \fI$PAGER\fR
2450 variables are to be honoured, other than to disable the pager,
2451 \fI$SYSTEMD_PAGERSECURE\fR
2452 must be set too\&.
2453 .RE
2454 .PP
2455 \fI$SYSTEMD_COLORS\fR
2456 .RS 4
2457 Takes a boolean argument, or a special value\&. By default (unset),
2458 \fBsystemd\fR
2459 and related utilities will use colors in their output if possible\&. If
2460 \fI$COLORTERM\fR
2461 is set to
2462 "truecolor"
2463 or
2464 "24bit", 24\-bit colors will be enabled, 256 colors otherwise, unless
2465 \fI$NO_COLOR\fR
2466 or
2467 \fI$TERM\fR
2468 indicates colors are disabled\&.
2469 .PP
2470 \fBtrue\fR
2471 .RS 4
2472 Same as unset, except that
2473 \fI$NO_COLOR\fR
2474 is ignored\&.
2475 .RE
2476 .PP
2477 \fBfalse\fR
2478 .RS 4
2479 The output will be monochrome\&.
2480 .RE
2481 .PP
2482 "16", "256", "24bit"
2483 .RS 4
2484 Always use the base 16 ANSI colors, 256 colors, or 24 bit color, respectively\&.
2485 .RE
2486 .PP
2487 "auto\-16", "auto\-256", "auto\-24bit"
2488 .RS 4
2489 Use the given quantity of colours, subject to
2490 \fI$TERM\fR, and what the console is connected to\&.
2491 .RE
2492 .RE
2493 .PP
2494 \fI$SYSTEMD_URLIFY\fR
2495 .RS 4
2496 The value must be a boolean\&. Controls whether clickable links should be generated in the output for terminal emulators supporting this\&. This can be specified to override the decision that
2497 \fBsystemd\fR
2498 makes based on
2499 \fI$TERM\fR
2500 and other conditions\&.
2501 .RE
2502 .SH "EXAMPLES"
2503 .PP
2504 \fBExample\ \&1.\ \&Download an Ubuntu TAR image and open a shell in it\fR
2505 .sp
2506 .if n \{\
2507 .RS 4
2508 .\}
2509 .nf
2510 # importctl pull\-tar \-mN https://cloud\-images\&.ubuntu\&.com/jammy/current/jammy\-server\-cloudimg\-amd64\-root\&.tar\&.xz
2511 # systemd\-nspawn \-M jammy\-server\-cloudimg\-amd64\-root
2512 .fi
2513 .if n \{\
2514 .RE
2515 .\}
2516 .PP
2517 This downloads and verifies the specified
2518 \&.tar
2519 image, and then uses
2520 \fBsystemd-nspawn\fR(1)
2521 to open a shell in it\&.
2522 .PP
2523 \fBExample\ \&2.\ \&Build and boot a minimal Fedora distribution in a container\fR
2524 .sp
2525 .if n \{\
2526 .RS 4
2527 .\}
2528 .nf
2529 # dnf \-y \-\-releasever=44 \-\-installroot=/var/lib/machines/f44 \e
2530 \-\-use\-host\-config \-\-setopt=install_weak_deps=0 \e
2531 \-\-repo=fedora \-\-repo=updates install \e
2532 passwd dnf fedora\-release nano util\-linux systemd systemd\-networkd
2533 # systemd\-nspawn \-bD /var/lib/machines/f44
2534 .fi
2535 .if n \{\
2536 .RE
2537 .\}
2538 .PP
2539 (Omit
2540 \fI\-\-use\-host\-config\fR
2541 when using
2542 \fBdnf\fR
2543 <= 4\&.) This installs a minimal Fedora distribution into the directory
2544 /var/lib/machines/f44
2545 and then boots that OS in a namespace container\&. Because the installation is located underneath the standard
2546 /var/lib/machines/
2547 directory, it is also possible to start the machine using
2548 \fBsystemd\-nspawn \-M f44\fR\&.
2549 .PP
2550 \fBExample\ \&3.\ \&Spawn a shell in a container of a minimal Debian unstable distribution\fR
2551 .sp
2552 .if n \{\
2553 .RS 4
2554 .\}
2555 .nf
2556 # debootstrap unstable ~/debian\-tree/
2557 # systemd\-nspawn \-D ~/debian\-tree/
2558 .fi
2559 .if n \{\
2560 .RE
2561 .\}
2562 .PP
2563 This installs a minimal Debian unstable distribution into the directory
2564 ~/debian\-tree/
2565 and then spawns a shell from this image in a namespace container\&.
2566 .PP
2567 \fBdebootstrap\fR
2568 supports
2569 \m[blue]\fBDebian\fR\m[]\&\s-2\u[8]\d\s+2, and
2570 \m[blue]\fBUbuntu\fR\m[]\&\s-2\u[9]\d\s+2
2571 out of the box, so the same command can be used to install any of those\&. For other distributions from the Debian family, a mirror has to be specified, see
2572 \fBdebootstrap\fR(8)\&.
2573 .PP
2574 \fBExample\ \&4.\ \&Boot a minimal Arch Linux distribution in a container\fR
2575 .sp
2576 .if n \{\
2577 .RS 4
2578 .\}
2579 .nf
2580 # pacstrap \-c ~/arch\-tree/ base
2581 # systemd\-nspawn \-bD ~/arch\-tree/
2582 .fi
2583 .if n \{\
2584 .RE
2585 .\}
2586 .PP
2587 This installs a minimal Arch Linux distribution into the directory
2588 ~/arch\-tree/
2589 and then boots an OS in a namespace container in it\&.
2590 .PP
2591 \fBExample\ \&5.\ \&Install the OpenSUSE Tumbleweed rolling distribution\fR
2592 .sp
2593 .if n \{\
2594 .RS 4
2595 .\}
2596 .nf
2597 # zypper \-\-root=/var/lib/machines/tumbleweed ar \-c \e
2598 https://download\&.opensuse\&.org/tumbleweed/repo/oss tumbleweed
2599 # zypper \-\-root=/var/lib/machines/tumbleweed refresh
2600 # zypper \-\-root=/var/lib/machines/tumbleweed install \-\-no\-recommends \e
2601 systemd shadow zypper openSUSE\-release vim
2602 # systemd\-nspawn \-M tumbleweed passwd root
2603 # systemd\-nspawn \-M tumbleweed \-b
2604 .fi
2605 .if n \{\
2606 .RE
2607 .\}
2608 .PP
2609 \fBExample\ \&6.\ \&Boot into an ephemeral snapshot of the host system\fR
2610 .sp
2611 .if n \{\
2612 .RS 4
2613 .\}
2614 .nf
2615 # systemd\-nspawn \-D / \-xb
2616 .fi
2617 .if n \{\
2618 .RE
2619 .\}
2620 .PP
2621 This runs a copy of the host system in a snapshot which is removed immediately when the container exits\&. All file system changes made during runtime will be lost on shutdown, hence\&.
2622 .PP
2623 \fBExample\ \&7.\ \&Run a container with SELinux sandbox security contexts\fR
2624 .sp
2625 .if n \{\
2626 .RS 4
2627 .\}
2628 .nf
2629 # chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 \-R /srv/container
2630 # systemd\-nspawn \-L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 \e
2631 \-Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 \-D /srv/container /bin/sh
2632 .fi
2633 .if n \{\
2634 .RE
2635 .\}
2636 .PP
2637 \fBExample\ \&8.\ \&Run a container with an OSTree deployment\fR
2638 .sp
2639 .if n \{\
2640 .RS 4
2641 .\}
2642 .nf
2643 # systemd\-nspawn \-b \-i ~/image\&.raw \e
2644 \-\-pivot\-root=/ostree/deploy/$OS/deploy/$CHECKSUM:/sysroot \e
2645 \-\-bind=+/sysroot/ostree/deploy/$OS/var:/var
2646 .fi
2647 .if n \{\
2648 .RE
2649 .\}
2650 .SH "EXIT STATUS"
2651 .PP
2652 The exit code of the program executed in the container is returned\&.
2653 .SH "SEE ALSO"
2654 .PP
2655 \fBsystemd\fR(1), \fBsystemd.nspawn\fR(5), \fBchroot\fR(1), \fBdnf\fR(8), \fBdebootstrap\fR(8), \fBpacman\fR(8), \fBzypper\fR(8), \fBsystemd.slice\fR(5), \fBmachinectl\fR(1), \fBimportctl\fR(1), \fBsystemd-mountfsd.service\fR(8), \fBsystemd-nsresourced.service\fR(8), \fBsystemd.mstack\fR(7), \fBbtrfs\fR(8)
2656 .SH "NOTES"
2657 .IP " 1." 4
2658 Container Interface
2659 .RS 4
2660 \%https://systemd.io/CONTAINER_INTERFACE
2661 .RE
2662 .IP " 2." 4
2663 UAPI.2 Discoverable Partitions Specification
2664 .RS 4
2665 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
2666 .RE
2667 .IP " 3." 4
2668 OCI Runtime Specification
2669 .RS 4
2670 \%https://github.com/opencontainers/runtime-spec/blob/master/spec.md
2671 .RE
2672 .IP " 4." 4
2673 File Descriptor Store
2674 .RS 4
2675 \%https://systemd.io/FILE_DESCRIPTOR_STORE
2676 .RE
2677 .IP " 5." 4
2678 Overlay Filesystem
2679 .RS 4
2680 \%https://docs.kernel.org/filesystems/overlayfs.html
2681 .RE
2682 .IP " 6." 4
2683 ANSI Escape Code (Wikipedia)
2684 .RS 4
2685 \%https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters
2686 .RE
2687 .IP " 7." 4
2688 It is recommended for other tools to set and check
2689 \fI$SUDO_UID\fR
2690 as appropriate, treating it is a common interface.
2691 .IP " 8." 4
2692 Debian
2693 .RS 4
2694 \%https://www.debian.org
2695 .RE
2696 .IP " 9." 4
2697 Ubuntu
2698 .RS 4
2699 \%https://www.ubuntu.com
2700 .RE
2701 .IP "10." 4
2702 Arch Linux
2703 .RS 4
2704 \%https://www.archlinux.org
2705 .RE
2706 .IP "11." 4
2707 OpenSUSE Tumbleweed
2708 .RS 4
2709 \%https://software.opensuse.org/distributions/tumbleweed
2710 .RE