| 1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ |
| 4 |
<!ENTITY % entities SYSTEM "custom-entities.ent" > |
| 5 |
%entities; |
| 6 |
]> |
| 7 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 8 |
|
| 9 |
<refentry id="systemd.nspawn" conditional="ENABLE_NSPAWN" xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 10 |
|
| 11 |
<refentryinfo> |
| 12 |
<title>systemd.nspawn</title> |
| 13 |
<productname>systemd</productname> |
| 14 |
</refentryinfo> |
| 15 |
|
| 16 |
<refmeta> |
| 17 |
<refentrytitle>systemd.nspawn</refentrytitle> |
| 18 |
<manvolnum>5</manvolnum> |
| 19 |
</refmeta> |
| 20 |
|
| 21 |
<refnamediv> |
| 22 |
<refname>systemd.nspawn</refname> |
| 23 |
<refpurpose>Container settings</refpurpose> |
| 24 |
</refnamediv> |
| 25 |
|
| 26 |
<refsynopsisdiv> |
| 27 |
<para><simplelist> |
| 28 |
<member><filename>/etc/systemd/nspawn/<replaceable>machine</replaceable>.nspawn</filename></member> |
| 29 |
<member><filename>/run/systemd/nspawn/<replaceable>machine</replaceable>.nspawn</filename></member> |
| 30 |
<member><filename>/var/lib/machines/<replaceable>machine</replaceable>.nspawn</filename></member> |
| 31 |
</simplelist></para> |
| 32 |
</refsynopsisdiv> |
| 33 |
|
| 34 |
<refsect1> |
| 35 |
<title>Description</title> |
| 36 |
|
| 37 |
<para>An nspawn container settings file (suffix <filename>.nspawn</filename>) contains runtime |
| 38 |
configuration for a local container, and is used by |
| 39 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>. |
| 40 |
Files of this type are named after the containers they define settings for. They are optional, and only |
| 41 |
required for containers whose execution environment shall differ from the defaults. Files of this type |
| 42 |
mostly contain settings that may also be set on the <command>systemd-nspawn</command> command line, and |
| 43 |
make it easier to persistently attach specific settings to specific containers. The syntax of these files |
| 44 |
is inspired by <filename>.desktop</filename> files, similarly to other configuration files supported by |
| 45 |
the systemd project. See |
| 46 |
<citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry> for an |
| 47 |
overview.</para> |
| 48 |
</refsect1> |
| 49 |
|
| 50 |
<refsect1> |
| 51 |
<title><filename>.nspawn</filename> File Discovery</title> |
| 52 |
|
| 53 |
<para>Files are searched for by appending the <filename>.nspawn</filename> suffix to the machine name of |
| 54 |
the container, as specified with the <option>--machine=</option> switch of |
| 55 |
<command>systemd-nspawn</command>, or derived from the directory or image file name. This file is first |
| 56 |
searched for in <filename>/etc/systemd/nspawn/</filename> and |
| 57 |
<filename>/run/systemd/nspawn/</filename>. If found there, the settings are read and all of them take |
| 58 |
full effect (but may still be overridden by corresponding command line arguments). Otherwise, the file |
| 59 |
will then be searched for next to the image file or in the immediate parent of the root directory of the |
| 60 |
container. If the file is found there, only a subset of the settings will take effect however. All |
| 61 |
settings that possibly elevate privileges or grant additional access to resources of the host (such as |
| 62 |
files or directories) are ignored. To which options this applies is documented below.</para> |
| 63 |
|
| 64 |
<para>Persistent settings files created and maintained by the |
| 65 |
administrator (and thus trusted) should be placed in |
| 66 |
<filename>/etc/systemd/nspawn/</filename>, while automatically |
| 67 |
downloaded (and thus potentially untrusted) settings files are |
| 68 |
placed in <filename>/var/lib/machines/</filename> instead (next to |
| 69 |
the container images), where their security impact is limited. In |
| 70 |
order to add privileged settings to <filename>.nspawn</filename> |
| 71 |
files acquired from the image vendor, it is recommended to copy the |
| 72 |
settings files into <filename>/etc/systemd/nspawn/</filename> and |
| 73 |
edit them there, so that the privileged options become |
| 74 |
available. The precise algorithm for how the files are searched and |
| 75 |
interpreted may be configured with |
| 76 |
<command>systemd-nspawn</command>'s <option>--settings=</option> |
| 77 |
switch, see |
| 78 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 79 |
for details.</para> |
| 80 |
</refsect1> |
| 81 |
|
| 82 |
<refsect1> |
| 83 |
<title>[Exec] Section Options</title> |
| 84 |
|
| 85 |
<para>Settings files may include an [Exec] |
| 86 |
section, which carries various execution parameters:</para> |
| 87 |
|
| 88 |
<variablelist class='nspawn-directives'> |
| 89 |
|
| 90 |
<varlistentry> |
| 91 |
<term><varname>Boot=</varname></term> |
| 92 |
|
| 93 |
<listitem><para>Takes a boolean argument, which defaults to off. If enabled, <command>systemd-nspawn</command> |
| 94 |
will automatically search for an <filename>init</filename> executable and invoke it. In this case, the |
| 95 |
specified parameters using <varname>Parameters=</varname> are passed as additional arguments to the |
| 96 |
<filename>init</filename> process. This setting corresponds to the <option>--boot</option> switch on the |
| 97 |
<command>systemd-nspawn</command> command line. This option may not be combined with |
| 98 |
<varname>ProcessTwo=yes</varname>. This option is specified by default in the |
| 99 |
<filename>[email protected]</filename> template unit.</para> |
| 100 |
|
| 101 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 102 |
</varlistentry> |
| 103 |
|
| 104 |
<varlistentry> |
| 105 |
<term><varname>Ephemeral=</varname></term> |
| 106 |
|
| 107 |
<listitem><para>Takes a boolean argument, which defaults to off, If enabled, the container is run with |
| 108 |
a temporary snapshot of its file system that is removed immediately when the container terminates. |
| 109 |
This is equivalent to the <option>--ephemeral</option> command line switch. See |
| 110 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for details |
| 111 |
about the specific options supported.</para> |
| 112 |
|
| 113 |
<xi:include href="version-info.xml" xpointer="v240"/></listitem> |
| 114 |
</varlistentry> |
| 115 |
|
| 116 |
<varlistentry> |
| 117 |
<term><varname>ProcessTwo=</varname></term> |
| 118 |
|
| 119 |
<listitem><para>Takes a boolean argument, which defaults to off. If enabled, the specified program is run as |
| 120 |
PID 2. A stub init process is run as PID 1. This setting corresponds to the <option>--as-pid2</option> switch |
| 121 |
on the <command>systemd-nspawn</command> command line. This option may not be combined with |
| 122 |
<varname>Boot=yes</varname>.</para> |
| 123 |
|
| 124 |
<xi:include href="version-info.xml" xpointer="v229"/></listitem> |
| 125 |
</varlistentry> |
| 126 |
|
| 127 |
<varlistentry> |
| 128 |
<term><varname>Parameters=</varname></term> |
| 129 |
|
| 130 |
<listitem><para>Takes a whitespace-separated list of arguments. Single (<literal>'</literal>) and |
| 131 |
double (<literal>"</literal>) quotes may be used around arguments with whitespace. This is either a |
| 132 |
command line, beginning with the binary name to execute, or – if <varname>Boot=</varname> is enabled |
| 133 |
– the list of arguments to pass to the init process. This setting corresponds to the command line |
| 134 |
parameters passed on the <command>systemd-nspawn</command> command line.</para> |
| 135 |
|
| 136 |
<para>Note: <option>Boot=no</option>, <option>Parameters=a b "c c"</option> is the same as |
| 137 |
<command>systemd-nspawn a b "c c"</command>, and <option>Boot=yes</option>, <option>Parameters=b 'c c'</option> |
| 138 |
is the same as <command>systemd-nspawn --boot b 'c c'</command>.</para> |
| 139 |
|
| 140 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 141 |
</varlistentry> |
| 142 |
|
| 143 |
<varlistentry> |
| 144 |
<term><varname>Environment=</varname></term> |
| 145 |
|
| 146 |
<listitem><para>Takes an environment variable assignment |
| 147 |
consisting of key and value, separated by |
| 148 |
<literal>=</literal>. Sets an environment variable for the |
| 149 |
main process invoked in the container. This setting may be |
| 150 |
used multiple times to set multiple environment variables. It |
| 151 |
corresponds to the <option>--setenv=</option> command line |
| 152 |
switch.</para> |
| 153 |
|
| 154 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 155 |
</varlistentry> |
| 156 |
|
| 157 |
<varlistentry> |
| 158 |
<term><varname>User=</varname></term> |
| 159 |
|
| 160 |
<listitem><para>Takes a UNIX user name. Specifies the user |
| 161 |
name to invoke the main process of the container as. This user |
| 162 |
must be known in the container's user database. This |
| 163 |
corresponds to the <option>--user=</option> command line |
| 164 |
switch.</para> |
| 165 |
|
| 166 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 167 |
</varlistentry> |
| 168 |
|
| 169 |
<varlistentry> |
| 170 |
<term><varname>WorkingDirectory=</varname></term> |
| 171 |
|
| 172 |
<listitem><para>Selects the working directory for the process invoked in the container. Expects an absolute |
| 173 |
path in the container's file system namespace. This corresponds to the <option>--chdir=</option> command line |
| 174 |
switch.</para> |
| 175 |
|
| 176 |
<xi:include href="version-info.xml" xpointer="v229"/></listitem> |
| 177 |
</varlistentry> |
| 178 |
|
| 179 |
<varlistentry> |
| 180 |
<term><varname>PivotRoot=</varname></term> |
| 181 |
|
| 182 |
<listitem><para>Selects a directory to pivot to <filename>/</filename> inside the container when starting up. |
| 183 |
Takes a single path, or a pair of two paths separated by a colon. Both paths must be absolute, and are resolved |
| 184 |
in the container's file system namespace. This corresponds to the <option>--pivot-root=</option> command line |
| 185 |
switch.</para> |
| 186 |
|
| 187 |
<xi:include href="version-info.xml" xpointer="v233"/></listitem> |
| 188 |
</varlistentry> |
| 189 |
|
| 190 |
<varlistentry> |
| 191 |
<term><varname>Capability=</varname></term> |
| 192 |
<term><varname>DropCapability=</varname></term> |
| 193 |
|
| 194 |
<listitem><para>Takes a space-separated list of Linux process |
| 195 |
capabilities (see |
| 196 |
<citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
| 197 |
for details). The <varname>Capability=</varname> setting |
| 198 |
specifies additional capabilities to pass on top of the |
| 199 |
default set of capabilities. The |
| 200 |
<varname>DropCapability=</varname> setting specifies |
| 201 |
capabilities to drop from the default set. These settings |
| 202 |
correspond to the <option>--capability=</option> and |
| 203 |
<option>--drop-capability=</option> command line |
| 204 |
switches. Note that <varname>Capability=</varname> is a |
| 205 |
privileged setting, and only takes effect in |
| 206 |
<filename>.nspawn</filename> files in |
| 207 |
<filename>/etc/systemd/nspawn/</filename> and |
| 208 |
<filename>/run/system/nspawn/</filename> (see above). On the |
| 209 |
other hand, <varname>DropCapability=</varname> takes effect in |
| 210 |
all cases. If the special value <literal>all</literal> is passed, all |
| 211 |
capabilities are retained (or dropped).</para> |
| 212 |
<para>These settings change the bounding set of capabilities which |
| 213 |
also limits the ambient capabilities as given with the |
| 214 |
<varname>AmbientCapability=</varname>.</para> |
| 215 |
|
| 216 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 217 |
</varlistentry> |
| 218 |
|
| 219 |
<varlistentry> |
| 220 |
<term><varname>AmbientCapability=</varname></term> |
| 221 |
<listitem><para>Takes a space-separated list of Linux process |
| 222 |
capabilities (see |
| 223 |
<citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
| 224 |
for details). The <varname>AmbientCapability=</varname> setting |
| 225 |
specifies capabilities which will be passed to the started program |
| 226 |
in the inheritable and ambient capability sets. This will grant |
| 227 |
these capabilities to this process. This setting correspond to |
| 228 |
the <option>--ambient-capability=</option> command line switch. |
| 229 |
</para> |
| 230 |
|
| 231 |
<para>The value <literal>all</literal> is not supported for this |
| 232 |
setting.</para> |
| 233 |
|
| 234 |
<para>The setting of <varname>AmbientCapability=</varname> must |
| 235 |
be covered by the bounding set settings which were established by |
| 236 |
<varname>Capability=</varname> and <varname>DropCapability=</varname>. |
| 237 |
</para> |
| 238 |
|
| 239 |
<para>Note that <varname>AmbientCapability=</varname> is a privileged |
| 240 |
setting (see above).</para> |
| 241 |
|
| 242 |
<xi:include href="version-info.xml" xpointer="v248"/></listitem> |
| 243 |
</varlistentry> |
| 244 |
|
| 245 |
<varlistentry> |
| 246 |
<term><varname>NoNewPrivileges=</varname></term> |
| 247 |
|
| 248 |
<listitem><para>Takes a boolean argument that controls the <constant>PR_SET_NO_NEW_PRIVS</constant> flag for |
| 249 |
the container payload. This is equivalent to the |
| 250 |
<option>--no-new-privileges=</option> command line switch. See |
| 251 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 252 |
details.</para> |
| 253 |
|
| 254 |
<xi:include href="version-info.xml" xpointer="v239"/> |
| 255 |
</listitem> |
| 256 |
</varlistentry> |
| 257 |
|
| 258 |
<varlistentry> |
| 259 |
<term><varname>KillSignal=</varname></term> |
| 260 |
|
| 261 |
<listitem><para>Specify the process signal to send to the |
| 262 |
container's PID 1 when nspawn itself receives SIGTERM, in |
| 263 |
order to trigger an orderly shutdown of the container. |
| 264 |
Defaults to SIGRTMIN+3 if <option>Boot=</option> is used |
| 265 |
(on systemd-compatible init systems SIGRTMIN+3 triggers an |
| 266 |
orderly shutdown). For a list of valid signals, see |
| 267 |
<citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para> |
| 268 |
|
| 269 |
<xi:include href="version-info.xml" xpointer="v230"/></listitem> |
| 270 |
</varlistentry> |
| 271 |
|
| 272 |
<varlistentry> |
| 273 |
<term><varname>Personality=</varname></term> |
| 274 |
|
| 275 |
<listitem><para>Configures the kernel personality for the |
| 276 |
container. This is equivalent to the |
| 277 |
<option>--personality=</option> switch.</para> |
| 278 |
|
| 279 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 280 |
</varlistentry> |
| 281 |
|
| 282 |
<varlistentry> |
| 283 |
<term><varname>MachineID=</varname></term> |
| 284 |
|
| 285 |
<listitem><para>Configures the 128-bit machine ID (UUID) to pass to |
| 286 |
the container. This is equivalent to the |
| 287 |
<option>--uuid=</option> command line switch. This option is |
| 288 |
privileged (see above). </para> |
| 289 |
|
| 290 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 291 |
</varlistentry> |
| 292 |
|
| 293 |
<varlistentry> |
| 294 |
<term><varname>PrivateUsers=</varname></term> |
| 295 |
|
| 296 |
<listitem><para>Configures support for usernamespacing. This is equivalent to the |
| 297 |
<option>--private-users=</option> command line switch, and takes the same options. This option is privileged |
| 298 |
(see above). This option is the default if the <filename>[email protected]</filename> template unit file |
| 299 |
is used.</para> |
| 300 |
|
| 301 |
<xi:include href="version-info.xml" xpointer="v230"/></listitem> |
| 302 |
</varlistentry> |
| 303 |
|
| 304 |
<varlistentry> |
| 305 |
<term><varname>PrivateUsersDelegate=</varname></term> |
| 306 |
|
| 307 |
<listitem><para>Takes a non-negative integer. Configures delegation of additional 64K UID/GID ranges |
| 308 |
into the container's user namespace for use by nested containers. When set to a value greater than |
| 309 |
zero, the |
| 310 |
<citerefentry><refentrytitle>systemd-nsresourced.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 311 |
varlink socket will be bind-mounted into the container so that processes inside the container can |
| 312 |
allocate further user namespaces from the delegated ranges. This is equivalent to the |
| 313 |
<option>--private-users-delegate=</option> command line switch. Requires |
| 314 |
<varname>PrivateUsers=managed</varname>. Defaults to 0. See |
| 315 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 316 |
for details.</para> |
| 317 |
|
| 318 |
<xi:include href="version-info.xml" xpointer="v260"/></listitem> |
| 319 |
</varlistentry> |
| 320 |
|
| 321 |
<varlistentry> |
| 322 |
<term><varname>NotifyReady=</varname></term> |
| 323 |
|
| 324 |
<listitem><para>Configures support for notifications from the container's init process. This is equivalent to |
| 325 |
the <option>--notify-ready=</option> command line switch, and takes the same parameters. See |
| 326 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for details |
| 327 |
about the specific options supported.</para> |
| 328 |
|
| 329 |
<xi:include href="version-info.xml" xpointer="v231"/></listitem> |
| 330 |
</varlistentry> |
| 331 |
|
| 332 |
<varlistentry> |
| 333 |
<term><varname>SystemCallFilter=</varname></term> |
| 334 |
|
| 335 |
<listitem><para>Configures the system call filter applied to containers. This is equivalent to the |
| 336 |
<option>--system-call-filter=</option> command line switch, and takes the same list parameter. See |
| 337 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 338 |
details.</para> |
| 339 |
|
| 340 |
<xi:include href="version-info.xml" xpointer="v235"/></listitem> |
| 341 |
</varlistentry> |
| 342 |
|
| 343 |
<varlistentry> |
| 344 |
<term><varname>RestrictAddressFamilies=</varname></term> |
| 345 |
|
| 346 |
<listitem><para>Restricts the socket address families accessible to the container. This is equivalent |
| 347 |
to the <option>--restrict-address-families=</option> command line switch, and takes the same list |
| 348 |
parameter. See |
| 349 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 350 |
details.</para> |
| 351 |
|
| 352 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 353 |
</varlistentry> |
| 354 |
|
| 355 |
<varlistentry> |
| 356 |
<term><varname>LimitCPU=</varname></term> |
| 357 |
<term><varname>LimitFSIZE=</varname></term> |
| 358 |
<term><varname>LimitDATA=</varname></term> |
| 359 |
<term><varname>LimitSTACK=</varname></term> |
| 360 |
<term><varname>LimitCORE=</varname></term> |
| 361 |
<term><varname>LimitRSS=</varname></term> |
| 362 |
<term><varname>LimitNOFILE=</varname></term> |
| 363 |
<term><varname>LimitAS=</varname></term> |
| 364 |
<term><varname>LimitNPROC=</varname></term> |
| 365 |
<term><varname>LimitMEMLOCK=</varname></term> |
| 366 |
<term><varname>LimitLOCKS=</varname></term> |
| 367 |
<term><varname>LimitSIGPENDING=</varname></term> |
| 368 |
<term><varname>LimitMSGQUEUE=</varname></term> |
| 369 |
<term><varname>LimitNICE=</varname></term> |
| 370 |
<term><varname>LimitRTPRIO=</varname></term> |
| 371 |
<term><varname>LimitRTTIME=</varname></term> |
| 372 |
|
| 373 |
<listitem><para>Configures various types of resource limits applied to containers. This is equivalent to the |
| 374 |
<option>--rlimit=</option> command line switch, and takes the same arguments. See |
| 375 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 376 |
details.</para> |
| 377 |
|
| 378 |
<xi:include href="version-info.xml" xpointer="v239"/></listitem> |
| 379 |
</varlistentry> |
| 380 |
|
| 381 |
<varlistentry> |
| 382 |
<term><varname>OOMScoreAdjust=</varname></term> |
| 383 |
|
| 384 |
<listitem><para>Configures the OOM score adjustment value. This is equivalent to the |
| 385 |
<option>--oom-score-adjust=</option> command line switch, and takes the same argument. See |
| 386 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 387 |
details.</para> |
| 388 |
|
| 389 |
<xi:include href="version-info.xml" xpointer="v239"/></listitem> |
| 390 |
</varlistentry> |
| 391 |
|
| 392 |
<varlistentry> |
| 393 |
<term><varname>CPUAffinity=</varname></term> |
| 394 |
|
| 395 |
<listitem><para>Configures the CPU affinity. This is equivalent to the <option>--cpu-affinity=</option> command |
| 396 |
line switch, and takes the same argument. See |
| 397 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 398 |
details.</para> |
| 399 |
|
| 400 |
<xi:include href="version-info.xml" xpointer="v239"/></listitem> |
| 401 |
</varlistentry> |
| 402 |
|
| 403 |
<varlistentry> |
| 404 |
<term><varname>Hostname=</varname></term> |
| 405 |
|
| 406 |
<listitem><para>Configures the kernel hostname set for the container. This is equivalent to the |
| 407 |
<option>--hostname=</option> command line switch, and takes the same argument. See |
| 408 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 409 |
details.</para> |
| 410 |
|
| 411 |
<xi:include href="version-info.xml" xpointer="v239"/></listitem> |
| 412 |
</varlistentry> |
| 413 |
|
| 414 |
<varlistentry> |
| 415 |
<term><varname>ResolvConf=</varname></term> |
| 416 |
|
| 417 |
<listitem><para>Configures how <filename>/etc/resolv.conf</filename> in the container shall be handled. This is |
| 418 |
equivalent to the <option>--resolv-conf=</option> command line switch, and takes the same argument. See |
| 419 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 420 |
details.</para> |
| 421 |
|
| 422 |
<xi:include href="version-info.xml" xpointer="v239"/></listitem> |
| 423 |
</varlistentry> |
| 424 |
|
| 425 |
<varlistentry> |
| 426 |
<term><varname>Timezone=</varname></term> |
| 427 |
|
| 428 |
<listitem><para>Configures how <filename>/etc/localtime</filename> in the container shall be handled. This is |
| 429 |
equivalent to the <option>--timezone=</option> command line switch, and takes the same argument. See |
| 430 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 431 |
details.</para> |
| 432 |
|
| 433 |
<xi:include href="version-info.xml" xpointer="v239"/></listitem> |
| 434 |
</varlistentry> |
| 435 |
|
| 436 |
<varlistentry> |
| 437 |
<term><varname>LinkJournal=</varname></term> |
| 438 |
|
| 439 |
<listitem><para>Configures how to link host and container journal setups. This is equivalent to the |
| 440 |
<option>--link-journal=</option> command line switch, and takes the same parameter. See |
| 441 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for |
| 442 |
details.</para> |
| 443 |
|
| 444 |
<xi:include href="version-info.xml" xpointer="v239"/></listitem> |
| 445 |
</varlistentry> |
| 446 |
|
| 447 |
<varlistentry> |
| 448 |
<term><varname>SuppressSync=</varname></term> |
| 449 |
|
| 450 |
<listitem><para>Configures whether to suppress disk synchronization for the container payload. This |
| 451 |
is equivalent to the <option>--suppress-sync=</option> command line switch, and takes the same |
| 452 |
parameter. See |
| 453 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 454 |
for details.</para> |
| 455 |
|
| 456 |
<xi:include href="version-info.xml" xpointer="v250"/></listitem> |
| 457 |
</varlistentry> |
| 458 |
|
| 459 |
</variablelist> |
| 460 |
</refsect1> |
| 461 |
|
| 462 |
<refsect1> |
| 463 |
<title>[Files] Section Options</title> |
| 464 |
|
| 465 |
<para>Settings files may include a [Files] |
| 466 |
section, which carries various parameters configuring the file |
| 467 |
system of the container:</para> |
| 468 |
|
| 469 |
<variablelist class='nspawn-directives'> |
| 470 |
|
| 471 |
<varlistentry> |
| 472 |
<term><varname>ReadOnly=</varname></term> |
| 473 |
|
| 474 |
<listitem><para>Takes a boolean argument, which defaults to off. If |
| 475 |
specified, the container will be run with a read-only file |
| 476 |
system. This setting corresponds to the |
| 477 |
<option>--read-only</option> command line |
| 478 |
switch.</para> |
| 479 |
|
| 480 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 481 |
</varlistentry> |
| 482 |
|
| 483 |
<varlistentry> |
| 484 |
<term><varname>Volatile=</varname></term> |
| 485 |
|
| 486 |
<listitem><para>Takes a boolean argument, or the special value |
| 487 |
<literal>state</literal>. This configures whether to run the |
| 488 |
container with volatile state and/or configuration. This |
| 489 |
option is equivalent to <option>--volatile=</option>, see |
| 490 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 491 |
for details about the specific options |
| 492 |
supported.</para> |
| 493 |
|
| 494 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 495 |
</varlistentry> |
| 496 |
|
| 497 |
<varlistentry> |
| 498 |
<term><varname>Bind=</varname></term> |
| 499 |
<term><varname>BindReadOnly=</varname></term> |
| 500 |
|
| 501 |
<listitem><para>Adds a bind mount from the host into the |
| 502 |
container. Takes a single path, a pair of two paths separated |
| 503 |
by a colon, or a triplet of two paths plus an option string |
| 504 |
separated by colons. This option may be used multiple times to |
| 505 |
configure multiple bind mounts. This option is equivalent to |
| 506 |
the command line switches <option>--bind=</option> and |
| 507 |
<option>--bind-ro=</option>, see |
| 508 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 509 |
for details about the specific options supported. This setting |
| 510 |
is privileged (see above).</para> |
| 511 |
|
| 512 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 513 |
</varlistentry> |
| 514 |
|
| 515 |
<varlistentry> |
| 516 |
<term><varname>BindUser=</varname></term> |
| 517 |
|
| 518 |
<listitem><para>Binds a user from the host into the container. This option is equivalent to the |
| 519 |
command line switch <option>--bind-user=</option>, see |
| 520 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 521 |
for details about the specific options supported. This setting is privileged (see |
| 522 |
above).</para> |
| 523 |
|
| 524 |
<xi:include href="version-info.xml" xpointer="v249"/></listitem> |
| 525 |
</varlistentry> |
| 526 |
|
| 527 |
<varlistentry> |
| 528 |
<term><varname>BindUserShell=</varname></term> |
| 529 |
|
| 530 |
<listitem><para>When used with <varname>BindUser</varname>, specifies the shell that is included in |
| 531 |
the user record of users bound from the host into the container. This option is equivalent to the |
| 532 |
command line switch <option>--bind-user-shell=</option>, see |
| 533 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 534 |
for details about the specific options supported. This setting is privileged (see above).</para> |
| 535 |
|
| 536 |
<xi:include href="version-info.xml" xpointer="v258"/></listitem> |
| 537 |
</varlistentry> |
| 538 |
|
| 539 |
<varlistentry> |
| 540 |
<term><varname>TemporaryFileSystem=</varname></term> |
| 541 |
|
| 542 |
<listitem><para>Adds a <literal>tmpfs</literal> mount to the |
| 543 |
container. Takes a path or a pair of path and option string, |
| 544 |
separated by a colon. This option may be used multiple times to |
| 545 |
configure multiple <literal>tmpfs</literal> mounts. This |
| 546 |
option is equivalent to the command line switch |
| 547 |
<option>--tmpfs=</option>, see |
| 548 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 549 |
for details about the specific options supported. This setting |
| 550 |
is privileged (see above).</para> |
| 551 |
|
| 552 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 553 |
</varlistentry> |
| 554 |
|
| 555 |
<varlistentry> |
| 556 |
<term><varname>Inaccessible=</varname></term> |
| 557 |
|
| 558 |
<listitem><para>Masks the specified file or directory in the container, by over-mounting it with an empty file |
| 559 |
node of the same type with the most restrictive access mode. Takes a file system path as argument. This option |
| 560 |
may be used multiple times to mask multiple files or directories. This option is equivalent to the command line |
| 561 |
switch <option>--inaccessible=</option>, see |
| 562 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for details |
| 563 |
about the specific options supported. This setting is privileged (see above).</para> |
| 564 |
|
| 565 |
<xi:include href="version-info.xml" xpointer="v242"/></listitem> |
| 566 |
</varlistentry> |
| 567 |
|
| 568 |
<varlistentry> |
| 569 |
<term><varname>Overlay=</varname></term> |
| 570 |
<term><varname>OverlayReadOnly=</varname></term> |
| 571 |
|
| 572 |
<listitem><para>Adds an overlay mount point. Takes a colon-separated list of paths. This option may be used |
| 573 |
multiple times to configure multiple overlay mounts. This option is equivalent to the command line switches |
| 574 |
<option>--overlay=</option> and <option>--overlay-ro=</option>, see |
| 575 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for details |
| 576 |
about the specific options supported. This setting is privileged (see above).</para> |
| 577 |
|
| 578 |
<xi:include href="version-info.xml" xpointer="v233"/></listitem> |
| 579 |
</varlistentry> |
| 580 |
|
| 581 |
<varlistentry> |
| 582 |
<term><varname>PrivateUsersOwnership=</varname></term> |
| 583 |
|
| 584 |
<listitem><para>Configures whether the ownership of the files and directories in the container tree |
| 585 |
shall be adjusted to the UID/GID range used, if necessary and user namespacing is enabled. This is |
| 586 |
equivalent to the <option>--private-users-ownership=</option> command line switch. This option is |
| 587 |
privileged (see above).</para> |
| 588 |
|
| 589 |
<xi:include href="version-info.xml" xpointer="v249"/></listitem> |
| 590 |
</varlistentry> |
| 591 |
|
| 592 |
</variablelist> |
| 593 |
</refsect1> |
| 594 |
|
| 595 |
<refsect1> |
| 596 |
<title>[Network] Section Options</title> |
| 597 |
|
| 598 |
<para>Settings files may include a [Network] |
| 599 |
section, which carries various parameters configuring the network |
| 600 |
connectivity of the container:</para> |
| 601 |
|
| 602 |
<variablelist class='nspawn-directives'> |
| 603 |
|
| 604 |
<varlistentry> |
| 605 |
<term><varname>Private=</varname></term> |
| 606 |
|
| 607 |
<listitem><para>Takes a boolean argument, which defaults to off. If |
| 608 |
enabled, the container will run in its own network namespace |
| 609 |
and not share network interfaces and configuration with the |
| 610 |
host. This setting corresponds to the |
| 611 |
<option>--private-network</option> command line |
| 612 |
switch.</para> |
| 613 |
|
| 614 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 615 |
</varlistentry> |
| 616 |
|
| 617 |
<varlistentry> |
| 618 |
<term><varname>NamespacePath=</varname></term> |
| 619 |
|
| 620 |
<listitem><para>Takes the path to a file representing a kernel |
| 621 |
network namespace that the container shall run in. The specified path |
| 622 |
should refer to a (possibly bind-mounted) network namespace file, as |
| 623 |
exposed by the kernel below <filename>/proc/$PID/ns/net</filename>. |
| 624 |
This makes the container enter the given network namespace. One of the |
| 625 |
typical use cases is to give a network namespace under |
| 626 |
<filename>/run/netns</filename> created by <citerefentry |
| 627 |
project='man-pages'><refentrytitle>ip-netns</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
| 628 |
for example, <varname>NamespacePath=/run/netns/foo</varname>. |
| 629 |
Note that this option cannot be used together with other |
| 630 |
network-related options, such as <varname>Private=</varname> |
| 631 |
or <varname>Interface=</varname>. This option corresponds to the |
| 632 |
<option>--network-namespace-path</option> command line switch.</para> |
| 633 |
|
| 634 |
<xi:include href="version-info.xml" xpointer="v259"/></listitem> |
| 635 |
</varlistentry> |
| 636 |
|
| 637 |
<varlistentry> |
| 638 |
<term><varname>VirtualEthernet=</varname></term> |
| 639 |
|
| 640 |
<listitem><para>Takes a boolean argument. Configures whether to create a virtual Ethernet connection |
| 641 |
(<literal>veth</literal>) between host and the container. This setting implies |
| 642 |
<varname>Private=yes</varname>. This setting corresponds to the <option>--network-veth</option> |
| 643 |
command line switch. This option is the default if the |
| 644 |
<filename>[email protected]</filename> template unit file is used.</para> |
| 645 |
|
| 646 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 647 |
</varlistentry> |
| 648 |
|
| 649 |
<varlistentry> |
| 650 |
<term><varname>VirtualEthernetExtra=</varname></term> |
| 651 |
|
| 652 |
<listitem><para>Takes a colon-separated pair of interface names. Configures an additional virtual |
| 653 |
Ethernet connection (<literal>veth</literal>) between host and the container. The first specified |
| 654 |
name is the interface name on the host, the second the interface name in the container. The latter |
| 655 |
may be omitted in which case it is set to the same name as the host side interface. This setting |
| 656 |
implies <varname>Private=yes</varname>. This setting corresponds to the |
| 657 |
<option>--network-veth-extra=</option> command line switch, and may be used multiple times. It is |
| 658 |
independent of <varname>VirtualEthernet=</varname>. Note that this option is unrelated to the |
| 659 |
<varname>Bridge=</varname> setting below, and thus any connections created this way are not |
| 660 |
automatically added to any bridge device on the host side. This option is privileged (see |
| 661 |
above).</para> |
| 662 |
|
| 663 |
<xi:include href="version-info.xml" xpointer="v228"/></listitem> |
| 664 |
</varlistentry> |
| 665 |
|
| 666 |
<varlistentry> |
| 667 |
<term><varname>Interface=</varname></term> |
| 668 |
|
| 669 |
<listitem><para>Takes a space-separated list of interfaces to add to the container. |
| 670 |
The interface object is defined either by a single interface name, referencing the name on the host, |
| 671 |
or a colon-separated pair of interfaces, in which case the first one references the name on the host, |
| 672 |
and the second one the name in the container. |
| 673 |
This option corresponds to the |
| 674 |
<option>--network-interface=</option> command line switch and |
| 675 |
implies <varname>Private=yes</varname>. This option is |
| 676 |
privileged (see above).</para> |
| 677 |
|
| 678 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 679 |
</varlistentry> |
| 680 |
|
| 681 |
<varlistentry> |
| 682 |
<term><varname>MACVLAN=</varname></term> |
| 683 |
<term><varname>IPVLAN=</varname></term> |
| 684 |
|
| 685 |
<listitem><para>Takes a space-separated list of interfaces to |
| 686 |
add MACLVAN or IPVLAN interfaces to, which are then added to |
| 687 |
the container. The interface object is defined either by a single interface name, referencing the name |
| 688 |
on the host, or a colon-separated pair of interfaces, in which case the first one references the name |
| 689 |
on the host, and the second one the name in the container. These options correspond to the |
| 690 |
<option>--network-macvlan=</option> and |
| 691 |
<option>--network-ipvlan=</option> command line switches and |
| 692 |
imply <varname>Private=yes</varname>. These options are |
| 693 |
privileged (see above).</para> |
| 694 |
|
| 695 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 696 |
</varlistentry> |
| 697 |
|
| 698 |
<varlistentry> |
| 699 |
<term><varname>Bridge=</varname></term> |
| 700 |
|
| 701 |
<listitem><para>Takes an interface name. This setting implies |
| 702 |
<varname>VirtualEthernet=yes</varname> and |
| 703 |
<varname>Private=yes</varname> and has the effect that the |
| 704 |
host side of the created virtual Ethernet link is connected to |
| 705 |
the specified bridge interface. This option corresponds to the |
| 706 |
<option>--network-bridge=</option> command line switch. This |
| 707 |
option is privileged (see above).</para> |
| 708 |
|
| 709 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 710 |
</varlistentry> |
| 711 |
|
| 712 |
<varlistentry> |
| 713 |
<term><varname>Zone=</varname></term> |
| 714 |
|
| 715 |
<listitem><para>Takes a network zone name. This setting implies <varname>VirtualEthernet=yes</varname> and |
| 716 |
<varname>Private=yes</varname> and has the effect that the host side of the created virtual Ethernet link is |
| 717 |
connected to an automatically managed bridge interface named after the passed argument, prefixed with |
| 718 |
<literal>vz-</literal>. This option corresponds to the <option>--network-zone=</option> command line |
| 719 |
switch. This option is privileged (see above).</para> |
| 720 |
|
| 721 |
<xi:include href="version-info.xml" xpointer="v230"/></listitem> |
| 722 |
</varlistentry> |
| 723 |
|
| 724 |
<varlistentry> |
| 725 |
<term><varname>Port=</varname></term> |
| 726 |
|
| 727 |
<listitem><para>Exposes a TCP or UDP port of the container on |
| 728 |
the host. This option corresponds to the |
| 729 |
<option>--port=</option> command line switch, see |
| 730 |
<citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 731 |
for the precise syntax of the argument this option takes. This |
| 732 |
option is privileged (see above).</para> |
| 733 |
|
| 734 |
<xi:include href="version-info.xml" xpointer="v226"/></listitem> |
| 735 |
</varlistentry> |
| 736 |
</variablelist> |
| 737 |
</refsect1> |
| 738 |
|
| 739 |
<refsect1> |
| 740 |
<title>See Also</title> |
| 741 |
<para><simplelist type="inline"> |
| 742 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 743 |
<member><citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 744 |
<member><citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry></member> |
| 745 |
</simplelist></para> |
| 746 |
</refsect1> |
| 747 |
|
| 748 |
</refentry> |