]> git.proxmox.com Git - mirror_lxc.git/blob - doc/lxc.container.conf.sgml.in
Merge pull request #3563 from Drachenfels-GmbH/cgroup-fixes
[mirror_lxc.git] / doc / lxc.container.conf.sgml.in
1 <!--
2
3 lxc: linux Container library
4
5 (C) Copyright IBM Corp. 2007, 2008
6
7 Authors:
8 Daniel Lezcano <daniel.lezcano at free.fr>
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
24 -->
25
26 <!DOCTYPE refentry PUBLIC @docdtd@ [
27
28 <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
29 ]>
30
31 <refentry>
32
33 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
34
35 <refmeta>
36 <refentrytitle>lxc.container.conf</refentrytitle>
37 <manvolnum>5</manvolnum>
38 </refmeta>
39
40 <refnamediv>
41 <refname>lxc.container.conf</refname>
42
43 <refpurpose>
44 LXC container configuration file
45 </refpurpose>
46 </refnamediv>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>
52 LXC is the well-known and heavily tested low-level Linux container
53 runtime. It is in active development since 2008 and has proven itself in
54 critical production environments world-wide. Some of its core contributors
55 are the same people that helped to implement various well-known
56 containerization features inside the Linux kernel.
57 </para>
58
59 <para>
60 LXC's main focus is system containers. That is, containers which offer an
61 environment as close as possible as the one you'd get from a VM but
62 without the overhead that comes with running a separate kernel and
63 simulating all the hardware.
64 </para>
65
66 <para>
67 This is achieved through a combination of kernel security features such as
68 namespaces, mandatory access control and control groups.
69 </para>
70
71 <para>
72 LXC has support for unprivileged containers. Unprivileged containers are
73 containers that are run without any privilege. This requires support for
74 user namespaces in the kernel that the container is run on. LXC was the
75 first runtime to support unprivileged containers after user namespaces
76 were merged into the mainline kernel.
77 </para>
78
79 <para>
80 In essence, user namespaces isolate given sets of UIDs and GIDs. This is
81 achieved by establishing a mapping between a range of UIDs and GIDs on the
82 host to a different (unprivileged) range of UIDs and GIDs in the
83 container. The kernel will translate this mapping in such a way that
84 inside the container all UIDs and GIDs appear as you would expect from the
85 host whereas on the host these UIDs and GIDs are in fact unprivileged. For
86 example, a process running as UID and GID 0 inside the container might
87 appear as UID and GID 100000 on the host. The implementation and working
88 details can be gathered from the corresponding user namespace man page.
89 UID and GID mappings can be defined with the <option>lxc.idmap</option>
90 key.
91 </para>
92
93 <para>
94 Linux containers are defined with a simple configuration file. Each
95 option in the configuration file has the form <command>key =
96 value</command> fitting in one line. The "#" character means the line is a
97 comment. List options, like capabilities and cgroups options, can be used
98 with no value to clear any previously defined values of that option.
99 </para>
100
101 <para>
102 LXC namespaces configuration keys use single dots. This means complex
103 configuration keys such as <option>lxc.net.0</option> expose various
104 subkeys such as <option>lxc.net.0.type</option>,
105 <option>lxc.net.0.link</option>, <option>lxc.net.0.ipv6.address</option>, and
106 others for even more fine-grained configuration.
107 </para>
108
109 <refsect2>
110 <title>Configuration</title>
111 <para>
112 In order to ease administration of multiple related containers, it is
113 possible to have a container configuration file cause another file to be
114 loaded. For instance, network configuration can be defined in one common
115 file which is included by multiple containers. Then, if the containers
116 are moved to another host, only one file may need to be updated.
117 </para>
118
119 <variablelist>
120 <varlistentry>
121 <term>
122 <option>lxc.include</option>
123 </term>
124 <listitem>
125 <para>
126 Specify the file to be included. The included file must be
127 in the same valid lxc configuration file format.
128 </para>
129 </listitem>
130 </varlistentry>
131 </variablelist>
132 </refsect2>
133
134 <refsect2>
135 <title>Architecture</title>
136 <para>
137 Allows one to set the architecture for the container. For example, set a
138 32bits architecture for a container running 32bits binaries on a 64bits
139 host. This fixes the container scripts which rely on the architecture to
140 do some work like downloading the packages.
141 </para>
142
143 <variablelist>
144 <varlistentry>
145 <term>
146 <option>lxc.arch</option>
147 </term>
148 <listitem>
149 <para>
150 Specify the architecture for the container.
151 </para>
152 <para>
153 Some valid options are
154 <option>x86</option>,
155 <option>i686</option>,
156 <option>x86_64</option>,
157 <option>amd64</option>
158 </para>
159 </listitem>
160 </varlistentry>
161 </variablelist>
162
163 </refsect2>
164
165 <refsect2>
166 <title>Hostname</title>
167 <para>
168 The utsname section defines the hostname to be set for the container.
169 That means the container can set its own hostname without changing the
170 one from the system. That makes the hostname private for the container.
171 </para>
172 <variablelist>
173 <varlistentry>
174 <term>
175 <option>lxc.uts.name</option>
176 </term>
177 <listitem>
178 <para>
179 specify the hostname for the container
180 </para>
181 </listitem>
182 </varlistentry>
183 </variablelist>
184 </refsect2>
185
186 <refsect2>
187 <title>Halt signal</title>
188 <para>
189 Allows one to specify signal name or number sent to the container's
190 init process to cleanly shutdown the container. Different init systems
191 could use different signals to perform clean shutdown sequence. This
192 option allows the signal to be specified in kill(1) fashion, e.g.
193 SIGPWR, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal is
194 SIGPWR.
195 </para>
196 <variablelist>
197 <varlistentry>
198 <term>
199 <option>lxc.signal.halt</option>
200 </term>
201 <listitem>
202 <para>
203 specify the signal used to halt the container
204 </para>
205 </listitem>
206 </varlistentry>
207 </variablelist>
208 </refsect2>
209
210 <refsect2>
211 <title>Reboot signal</title>
212 <para>
213 Allows one to specify signal name or number to reboot the container.
214 This option allows signal to be specified in kill(1) fashion, e.g.
215 SIGTERM, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal
216 is SIGINT.
217 </para>
218 <variablelist>
219 <varlistentry>
220 <term>
221 <option>lxc.signal.reboot</option>
222 </term>
223 <listitem>
224 <para>
225 specify the signal used to reboot the container
226 </para>
227 </listitem>
228 </varlistentry>
229 </variablelist>
230 </refsect2>
231
232 <refsect2>
233 <title>Stop signal</title>
234 <para>
235 Allows one to specify signal name or number to forcibly shutdown the
236 container. This option allows signal to be specified in kill(1) fashion,
237 e.g. SIGKILL, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default
238 signal is SIGKILL.
239 </para>
240 <variablelist>
241 <varlistentry>
242 <term>
243 <option>lxc.signal.stop</option>
244 </term>
245 <listitem>
246 <para>
247 specify the signal used to stop the container
248 </para>
249 </listitem>
250 </varlistentry>
251 </variablelist>
252 </refsect2>
253
254 <refsect2>
255 <title>Init command</title>
256 <para>
257 Sets the command to use as the init system for the containers.
258 </para>
259 <variablelist>
260 <varlistentry>
261 <term>
262 <option>lxc.execute.cmd</option>
263 </term>
264 <listitem>
265 <para>
266 Absolute path from container rootfs to the binary to run by default. This
267 mostly makes sense for <command>lxc-execute</command>.
268 </para>
269 </listitem>
270 </varlistentry>
271 </variablelist>
272 <variablelist>
273 <varlistentry>
274 <term>
275 <option>lxc.init.cmd</option>
276 </term>
277 <listitem>
278 <para>
279 Absolute path from container rootfs to the binary to use as init. This
280 mostly makes sense for <command>lxc-start</command>. Default is <command>/sbin/init</command>.
281 </para>
282 </listitem>
283 </varlistentry>
284 </variablelist>
285 </refsect2>
286
287 <refsect2>
288 <title>Init working directory</title>
289 <para>
290 Sets the absolute path inside the container as the working directory for the containers.
291 LXC will switch to this directory before executing init.
292 </para>
293 <variablelist>
294 <varlistentry>
295 <term>
296 <option>lxc.init.cwd</option>
297 </term>
298 <listitem>
299 <para>
300 Absolute path inside the container to use as the working directory.
301 </para>
302 </listitem>
303 </varlistentry>
304 </variablelist>
305 </refsect2>
306
307 <refsect2>
308 <title>Init ID</title>
309 <para>
310 Sets the UID/GID to use for the init system, and subsequent commands.
311 Note that using a non-root UID when booting a system container will
312 likely not work due to missing privileges. Setting the UID/GID is mostly
313 useful when running application containers.
314
315 Defaults to: UID(0), GID(0)
316 </para>
317 <variablelist>
318 <varlistentry>
319 <term>
320 <option>lxc.init.uid</option>
321 </term>
322 <listitem>
323 <para>
324 UID to use for init.
325 </para>
326 </listitem>
327 </varlistentry>
328 <varlistentry>
329 <term>
330 <option>lxc.init.gid</option>
331 </term>
332 <listitem>
333 <para>
334 GID to use for init.
335 </para>
336 </listitem>
337 </varlistentry>
338 </variablelist>
339 </refsect2>
340
341 <refsect2>
342 <title>Proc</title>
343 <para>
344 Configure proc filesystem for the container.
345 </para>
346 <variablelist>
347 <varlistentry>
348 <term>
349 <option>lxc.proc.[proc file name]</option>
350 </term>
351 <listitem>
352 <para>
353 Specify the proc file name to be set. The file names available
354 are those listed under /proc/PID/.
355 Example:
356 </para>
357 <programlisting>
358 lxc.proc.oom_score_adj = 10
359 </programlisting>
360 </listitem>
361 </varlistentry>
362 </variablelist>
363 </refsect2>
364
365 <refsect2>
366 <title>Ephemeral</title>
367 <para>
368 Allows one to specify whether a container will be destroyed on shutdown.
369 </para>
370 <variablelist>
371 <varlistentry>
372 <term>
373 <option>lxc.ephemeral</option>
374 </term>
375 <listitem>
376 <para>
377 The only allowed values are 0 and 1. Set this to 1 to destroy a
378 container on shutdown.
379 </para>
380 </listitem>
381 </varlistentry>
382 </variablelist>
383 </refsect2>
384
385 <refsect2>
386 <title>Network</title>
387 <para>
388 The network section defines how the network is virtualized in
389 the container. The network virtualization acts at layer
390 two. In order to use the network virtualization, parameters
391 must be specified to define the network interfaces of the
392 container. Several virtual interfaces can be assigned and used
393 in a container even if the system has only one physical
394 network interface.
395 </para>
396 <variablelist>
397 <varlistentry>
398 <term>
399 <option>lxc.net</option>
400 </term>
401 <listitem>
402 <para>
403 may be used without a value to clear all previous network options.
404 </para>
405 </listitem>
406 </varlistentry>
407 <varlistentry>
408 <term>
409 <option>lxc.net.[i].type</option>
410 </term>
411 <listitem>
412 <para>
413 specify what kind of network virtualization to be used
414 for the container.
415 Multiple networks can be specified by using an additional index
416 <option>i</option>
417 after all <option>lxc.net.*</option> keys. For example,
418 <option>lxc.net.0.type = veth</option> and
419 <option>lxc.net.1.type = veth</option> specify two different
420 networks of the same type. All keys sharing the same index
421 <option>i</option> will be treated as belonging to the same
422 network. For example, <option>lxc.net.0.link = br0</option>
423 will belong to <option>lxc.net.0.type</option>.
424 Currently, the different virtualization types can be:
425 </para>
426
427 <para>
428 <option>none:</option> will cause the container to share
429 the host's network namespace. This means the host
430 network devices are usable in the container. It also
431 means that if both the container and host have upstart as
432 init, 'halt' in a container (for instance) will shut down the
433 host. Note that unprivileged containers do not work with this
434 setting due to an inability to mount sysfs. An unsafe workaround
435 would be to bind mount the host's sysfs.
436 </para>
437
438 <para>
439 <option>empty:</option> will create only the loopback
440 interface.
441 </para>
442
443 <para>
444 <option>veth:</option> a virtual ethernet pair
445 device is created with one side assigned to the container
446 and the other side on the host.
447 <option>lxc.net.[i].veth.mode</option> specifies the
448 mode the veth parent will use on the host.
449 The accepted modes are <option>bridge</option> and <option>router</option>.
450 The mode defaults to bridge if not specified.
451 In <option>bridge</option> mode the host side is attached to a bridge specified by
452 the <option>lxc.net.[i].link</option> option.
453 If the bridge link is not specified, then the veth pair device
454 will be created but not attached to any bridge.
455 Otherwise, the bridge has to be created on the system
456 before starting the container.
457 <command>lxc</command> won't handle any
458 configuration outside of the container.
459 In <option>router</option> mode static routes are created on the host for the
460 container's IP addresses pointing to the host side veth interface.
461 Additionally Proxy ARP and Proxy NDP entries are added on the host side veth interface
462 for the gateway IPs defined in the container to allow the container to reach the host.
463 By default, <command>lxc</command> chooses a name for the
464 network device belonging to the outside of the
465 container, but if you wish to handle
466 this name yourselves, you can tell <command>lxc</command>
467 to set a specific name with
468 the <option>lxc.net.[i].veth.pair</option> option (except for
469 unprivileged containers where this option is ignored for security
470 reasons).
471
472 Static routes can be added on the host pointing to the container using the
473 <option>lxc.net.[i].veth.ipv4.route</option> and
474 <option>lxc.net.[i].veth.ipv6.route</option> options.
475 Several lines specify several routes.
476 The route is in format x.y.z.t/m, eg. 192.168.1.0/24.
477
478 In <option>bridge</option> mode untagged VLAN membership can be set with the
479 <option>lxc.net.[i].veth.vlan.id</option> option. It accepts a special value of 'none' indicating
480 that the container port should be removed from the bridge's default untagged VLAN.
481 The <option>lxc.net.[i].veth.vlan.tagged.id</option> option can be specified multiple times to set
482 the container's bridge port membership to one or more tagged VLANs.
483 </para>
484
485 <para>
486 <option>vlan:</option> a vlan interface is linked with
487 the interface specified by
488 the <option>lxc.net.[i].link</option> and assigned to
489 the container. The vlan identifier is specified with the
490 option <option>lxc.net.[i].vlan.id</option>.
491 </para>
492
493 <para>
494 <option>macvlan:</option> a macvlan interface is linked
495 with the interface specified by
496 the <option>lxc.net.[i].link</option> and assigned to
497 the container.
498 <option>lxc.net.[i].macvlan.mode</option> specifies the
499 mode the macvlan will use to communicate between
500 different macvlan on the same upper device. The accepted
501 modes are <option>private</option>, <option>vepa</option>,
502 <option>bridge</option> and <option>passthru</option>.
503 In <option>private</option> mode, the device never
504 communicates with any other device on the same upper_dev (default).
505 In <option>vepa</option> mode, the new Virtual Ethernet Port
506 Aggregator (VEPA) mode, it assumes that the adjacent
507 bridge returns all frames where both source and
508 destination are local to the macvlan port, i.e. the
509 bridge is set up as a reflective relay. Broadcast
510 frames coming in from the upper_dev get flooded to all
511 macvlan interfaces in VEPA mode, local frames are not
512 delivered locally. In <option>bridge</option> mode, it
513 provides the behavior of a simple bridge between
514 different macvlan interfaces on the same port. Frames
515 from one interface to another one get delivered directly
516 and are not sent out externally. Broadcast frames get
517 flooded to all other bridge ports and to the external
518 interface, but when they come back from a reflective
519 relay, we don't deliver them again. Since we know all
520 the MAC addresses, the macvlan bridge mode does not
521 require learning or STP like the bridge module does. In
522 <option>passthru</option> mode, all frames received by
523 the physical interface are forwarded to the macvlan
524 interface. Only one macvlan interface in <option>passthru</option>
525 mode is possible for one physical interface.
526 </para>
527
528 <para>
529 <option>ipvlan:</option> an ipvlan interface is linked
530 with the interface specified by
531 the <option>lxc.net.[i].link</option> and assigned to
532 the container.
533 <option>lxc.net.[i].ipvlan.mode</option> specifies the
534 mode the ipvlan will use to communicate between
535 different ipvlan on the same upper device. The accepted
536 modes are <option>l3</option>, <option>l3s</option> and
537 <option>l2</option>. It defaults to <option>l3</option> mode.
538 In <option>l3</option> mode TX processing up to L3 happens on the stack instance
539 attached to the dependent device and packets are switched to the stack instance of the
540 parent device for the L2 processing and routing from that instance will be
541 used before packets are queued on the outbound device. In this mode the dependent devices
542 will not receive nor can send multicast / broadcast traffic.
543 In <option>l3s</option> mode TX processing is very similar to the L3 mode except that
544 iptables (conn-tracking) works in this mode and hence it is L3-symmetric (L3s).
545 This will have slightly less performance but that shouldn't matter since you are
546 choosing this mode over plain-L3 mode to make conn-tracking work.
547 In <option>l2</option> mode TX processing happens on the stack instance attached to
548 the dependent device and packets are switched and queued to the parent device to send devices
549 out. In this mode the dependent devices will RX/TX multicast and broadcast (if applicable) as well.
550 <option>lxc.net.[i].ipvlan.isolation</option> specifies the isolation mode.
551 The accepted isolation values are <option>bridge</option>,
552 <option>private</option> and <option>vepa</option>.
553 It defaults to <option>bridge</option>.
554 In <option>bridge</option> isolation mode dependent devices can cross-talk among themselves
555 apart from talking through the parent device.
556 In <option>private</option> isolation mode the port is set in private mode.
557 i.e. port won't allow cross communication between dependent devices.
558 In <option>vepa</option> isolation mode the port is set in VEPA mode.
559 i.e. port will offload switching functionality to the external entity as
560 described in 802.1Qbg.
561 </para>
562
563 <para>
564 <option>phys:</option> an already existing interface
565 specified by the <option>lxc.net.[i].link</option> is
566 assigned to the container.
567 </para>
568 </listitem>
569 </varlistentry>
570
571 <varlistentry>
572 <term>
573 <option>lxc.net.[i].flags</option>
574 </term>
575 <listitem>
576 <para>
577 Specify an action to do for the network.
578 </para>
579
580 <para><option>up:</option> activates the interface.
581 </para>
582 </listitem>
583 </varlistentry>
584
585 <varlistentry>
586 <term>
587 <option>lxc.net.[i].link</option>
588 </term>
589 <listitem>
590 <para>
591 Specify the interface to be used for real network traffic.
592 </para>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry>
597 <term>
598 <option>lxc.net.[i].l2proxy</option>
599 </term>
600 <listitem>
601 <para>
602 Controls whether layer 2 IP neighbour proxy entries will be added to the
603 lxc.net.[i].link interface for the IP addresses of the container.
604 Can be set to 0 or 1. Defaults to 0.
605 When used with IPv4 addresses, the following sysctl values need to be set:
606 net.ipv4.conf.[link].forwarding=1
607 When used with IPv6 addresses, the following sysctl values need to be set:
608 net.ipv6.conf.[link].proxy_ndp=1
609 net.ipv6.conf.[link].forwarding=1
610 </para>
611 </listitem>
612 </varlistentry>
613
614 <varlistentry>
615 <term>
616 <option>lxc.net.[i].mtu</option>
617 </term>
618 <listitem>
619 <para>
620 Specify the maximum transfer unit for this interface.
621 </para>
622 </listitem>
623 </varlistentry>
624
625 <varlistentry>
626 <term>
627 <option>lxc.net.[i].name</option>
628 </term>
629 <listitem>
630 <para>
631 The interface name is dynamically allocated, but if another name
632 is needed because the configuration files being used by the
633 container use a generic name, eg. eth0, this option will rename
634 the interface in the container.
635 </para>
636 </listitem>
637 </varlistentry>
638
639 <varlistentry>
640 <term>
641 <option>lxc.net.[i].hwaddr</option>
642 </term>
643 <listitem>
644 <para>
645 The interface mac address is dynamically allocated by default to
646 the virtual interface, but in some cases, this is needed to
647 resolve a mac address conflict or to always have the same
648 link-local ipv6 address. Any "x" in address will be replaced by
649 random value, this allows setting hwaddr templates.
650 </para>
651 </listitem>
652 </varlistentry>
653
654 <varlistentry>
655 <term>
656 <option>lxc.net.[i].ipv4.address</option>
657 </term>
658 <listitem>
659 <para>
660 Specify the ipv4 address to assign to the virtualized interface.
661 Several lines specify several ipv4 addresses. The address is in
662 format x.y.z.t/m, eg. 192.168.1.123/24.
663 </para>
664 </listitem>
665 </varlistentry>
666
667 <varlistentry>
668 <term>
669 <option>lxc.net.[i].ipv4.gateway</option>
670 </term>
671 <listitem>
672 <para>
673 Specify the ipv4 address to use as the gateway inside the
674 container. The address is in format x.y.z.t, eg. 192.168.1.123.
675
676 Can also have the special value <option>auto</option>,
677 which means to take the primary address from the bridge
678 interface (as specified by the
679 <option>lxc.net.[i].link</option> option) and use that as
680 the gateway. <option>auto</option> is only available when
681 using the <option>veth</option>,
682 <option>macvlan</option> and <option>ipvlan</option> network types.
683 Can also have the special value of <option>dev</option>,
684 which means to set the default gateway as a device route.
685 This is primarily for use with layer 3 network modes, such as IPVLAN.
686 </para>
687 </listitem>
688 </varlistentry>
689
690 <varlistentry>
691 <term>
692 <option>lxc.net.[i].ipv6.address</option>
693 </term>
694 <listitem>
695 <para>
696 Specify the ipv6 address to assign to the virtualized
697 interface. Several lines specify several ipv6 addresses. The
698 address is in format x::y/m, eg.
699 2003:db8:1:0:214:1234:fe0b:3596/64
700 </para>
701 </listitem>
702 </varlistentry>
703
704 <varlistentry>
705 <term>
706 <option>lxc.net.[i].ipv6.gateway</option>
707 </term>
708 <listitem>
709 <para>
710 Specify the ipv6 address to use as the gateway inside the
711 container. The address is in format x::y, eg. 2003:db8:1:0::1
712
713 Can also have the special value <option>auto</option>,
714 which means to take the primary address from the bridge
715 interface (as specified by the
716 <option>lxc.net.[i].link</option> option) and use that as
717 the gateway. <option>auto</option> is only available when
718 using the <option>veth</option>,
719 <option>macvlan</option> and <option>ipvlan</option> network types.
720 Can also have the special value of <option>dev</option>,
721 which means to set the default gateway as a device route.
722 This is primarily for use with layer 3 network modes, such as IPVLAN.
723 </para>
724 </listitem>
725 </varlistentry>
726
727 <varlistentry>
728 <term>
729 <option>lxc.net.[i].script.up</option>
730 </term>
731 <listitem>
732 <para>
733 Add a configuration option to specify a script to be
734 executed after creating and configuring the network used
735 from the host side.
736 </para>
737
738 <para>
739 In addition to the information available to all hooks. The
740 following information is provided to the script:
741 <itemizedlist>
742 <listitem>
743 <para>
744 LXC_HOOK_TYPE: the hook type. This is either 'up' or 'down'.
745 </para>
746 </listitem>
747
748 <listitem>
749 <para>
750 LXC_HOOK_SECTION: the section type 'net'.
751 </para>
752 </listitem>
753
754 <listitem>
755 <para>
756 LXC_NET_TYPE: the network type. This is one of the valid
757 network types listed here (e.g. 'vlan', 'macvlan', 'ipvlan', 'veth').
758 </para>
759 </listitem>
760
761 <listitem>
762 <para>
763 LXC_NET_PARENT: the parent device on the host. This is only
764 set for network types 'mavclan', 'veth', 'phys'.
765 </para>
766 </listitem>
767
768 <listitem>
769 <para>
770 LXC_NET_PEER: the name of the peer device on the host. This is
771 only set for 'veth' network types. Note that this information
772 is only available when <option>lxc.hook.version</option> is set
773 to 1.
774 </para>
775 </listitem>
776 </itemizedlist>
777
778 Whether this information is provided in the form of environment
779 variables or as arguments to the script depends on the value of
780 <option>lxc.hook.version</option>. If set to 1 then information is
781 provided in the form of environment variables. If set to 0
782 information is provided as arguments to the script.
783 </para>
784
785 <para>
786 Standard output from the script is logged at debug level.
787 Standard error is not logged, but can be captured by the
788 hook redirecting its standard error to standard output.
789 </para>
790 </listitem>
791 </varlistentry>
792
793 <varlistentry>
794 <term>
795 <option>lxc.net.[i].script.down</option>
796 </term>
797 <listitem>
798 <para>
799 Add a configuration option to specify a script to be
800 executed before destroying the network used from the
801 host side.
802 </para>
803
804 <para>
805 In addition to the information available to all hooks. The
806 following information is provided to the script:
807 <itemizedlist>
808 <listitem>
809 <para>
810 LXC_HOOK_TYPE: the hook type. This is either 'up' or 'down'.
811 </para>
812 </listitem>
813
814 <listitem>
815 <para>
816 LXC_HOOK_SECTION: the section type 'net'.
817 </para>
818 </listitem>
819
820 <listitem>
821 <para>
822 LXC_NET_TYPE: the network type. This is one of the valid
823 network types listed here (e.g. 'vlan', 'macvlan', 'ipvlan', 'veth').
824 </para>
825 </listitem>
826
827 <listitem>
828 <para>
829 LXC_NET_PARENT: the parent device on the host. This is only
830 set for network types 'mavclan', 'veth', 'phys'.
831 </para>
832 </listitem>
833
834 <listitem>
835 <para>
836 LXC_NET_PEER: the name of the peer device on the host. This is
837 only set for 'veth' network types. Note that this information
838 is only available when <option>lxc.hook.version</option> is set
839 to 1.
840 </para>
841 </listitem>
842 </itemizedlist>
843
844 Whether this information is provided in the form of environment
845 variables or as arguments to the script depends on the value of
846 <option>lxc.hook.version</option>. If set to 1 then information is
847 provided in the form of environment variables. If set to 0
848 information is provided as arguments to the script.
849 </para>
850
851 <para>
852 Standard output from the script is logged at debug level.
853 Standard error is not logged, but can be captured by the
854 hook redirecting its standard error to standard output.
855 </para>
856 </listitem>
857 </varlistentry>
858 </variablelist>
859 </refsect2>
860
861 <refsect2>
862 <title>New pseudo tty instance (devpts)</title>
863 <para>
864 For stricter isolation the container can have its own private
865 instance of the pseudo tty.
866 </para>
867 <variablelist>
868 <varlistentry>
869 <term>
870 <option>lxc.pty.max</option>
871 </term>
872 <listitem>
873 <para>
874 If set, the container will have a new pseudo tty
875 instance, making this private to it. The value specifies
876 the maximum number of pseudo ttys allowed for a pty
877 instance (this limitation is not implemented yet).
878 </para>
879 </listitem>
880 </varlistentry>
881 </variablelist>
882 </refsect2>
883
884 <refsect2>
885 <title>Container system console</title>
886 <para>
887 If the container is configured with a root filesystem and the
888 inittab file is setup to use the console, you may want to specify
889 where the output of this console goes.
890 </para>
891 <variablelist>
892
893 <varlistentry>
894 <term>
895 <option>lxc.console.buffer.size</option>
896 </term>
897 <listitem>
898 <para>
899 Setting this option instructs liblxc to allocate an in-memory
900 ringbuffer. The container's console output will be written to the
901 ringbuffer. Note that ringbuffer must be at least as big as a
902 standard page size. When passed a value smaller than a single page
903 size liblxc will allocate a ringbuffer of a single page size. A page
904 size is usually 4KB.
905
906 The keyword 'auto' will cause liblxc to allocate a ringbuffer of
907 128KB.
908
909 When manually specifying a size for the ringbuffer the value should
910 be a power of 2 when converted to bytes. Valid size prefixes are
911 'KB', 'MB', 'GB'. (Note that all conversions are based on multiples
912 of 1024. That means 'KB' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.
913 Additionally, the case of the suffix is ignored, i.e. 'kB', 'KB' and
914 'Kb' are treated equally.)
915 </para>
916 </listitem>
917 </varlistentry>
918
919 <varlistentry>
920 <term>
921 <option>lxc.console.size</option>
922 </term>
923 <listitem>
924 <para>
925 Setting this option instructs liblxc to place a limit on the size of
926 the console log file specified in
927 <option>lxc.console.logfile</option>. Note that size of the log file
928 must be at least as big as a standard page size. When passed a value
929 smaller than a single page size liblxc will set the size of log file
930 to a single page size. A page size is usually 4KB.
931
932 The keyword 'auto' will cause liblxc to place a limit of 128KB on
933 the log file.
934
935 When manually specifying a size for the log file the value should
936 be a power of 2 when converted to bytes. Valid size prefixes are
937 'KB', 'MB', 'GB'. (Note that all conversions are based on multiples
938 of 1024. That means 'KB' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.
939 Additionally, the case of the suffix is ignored, i.e. 'kB', 'KB' and
940 'Kb' are treated equally.)
941
942 If users want to mirror the console ringbuffer on disk they should set
943 <option>lxc.console.size</option> equal to
944 <option>lxc.console.buffer.size</option>.
945 </para>
946 </listitem>
947 </varlistentry>
948
949 <varlistentry>
950 <term>
951 <option>lxc.console.logfile</option>
952 </term>
953 <listitem>
954 <para>
955 Specify a path to a file where the console output will be written.
956 Note that in contrast to the on-disk ringbuffer logfile this file
957 will keep growing potentially filling up the users disks if not
958 rotated and deleted. This problem can also be avoided by using the
959 in-memory ringbuffer options
960 <option>lxc.console.buffer.size</option> and
961 <option>lxc.console.buffer.logfile</option>.
962 </para>
963 </listitem>
964 </varlistentry>
965
966 <varlistentry>
967 <term>
968 <option>lxc.console.rotate</option>
969 </term>
970 <listitem>
971 <para>
972 Whether to rotate the console logfile specified in
973 <option>lxc.console.logfile</option>. Users can send an API
974 request to rotate the logfile. Note that the old logfile will have
975 the same name as the original with the suffix ".1" appended.
976
977 Users wishing to prevent the console log file from filling the
978 disk should rotate the logfile and delete it if unneeded. This
979 problem can also be avoided by using the in-memory ringbuffer
980 options <option>lxc.console.buffer.size</option> and
981 <option>lxc.console.buffer.logfile</option>.
982 </para>
983 </listitem>
984 </varlistentry>
985
986 <varlistentry>
987 <term>
988 <option>lxc.console.path</option>
989 </term>
990 <listitem>
991 <para>
992 Specify a path to a device to which the console will be
993 attached. The keyword 'none' will simply disable the
994 console. Note, when specifying 'none' and creating a device node
995 for the console in the container at /dev/console or bind-mounting
996 the hosts's /dev/console into the container at /dev/console the
997 container will have direct access to the hosts's /dev/console.
998 This is dangerous when the container has write access to the
999 device and should thus be used with caution.
1000 </para>
1001 </listitem>
1002 </varlistentry>
1003 </variablelist>
1004 </refsect2>
1005
1006 <refsect2>
1007 <title>Console through the ttys</title>
1008 <para>
1009 This option is useful if the container is configured with a root
1010 filesystem and the inittab file is setup to launch a getty on the
1011 ttys. The option specifies the number of ttys to be available for
1012 the container. The number of gettys in the inittab file of the
1013 container should not be greater than the number of ttys specified
1014 in this option, otherwise the excess getty sessions will die and
1015 respawn indefinitely giving annoying messages on the console or in
1016 <filename>/var/log/messages</filename>.
1017 </para>
1018 <variablelist>
1019 <varlistentry>
1020 <term>
1021 <option>lxc.tty.max</option>
1022 </term>
1023 <listitem>
1024 <para>
1025 Specify the number of tty to make available to the
1026 container.
1027 </para>
1028 </listitem>
1029 </varlistentry>
1030 </variablelist>
1031 </refsect2>
1032
1033 <refsect2>
1034 <title>Console devices location</title>
1035 <para>
1036 LXC consoles are provided through Unix98 PTYs created on the
1037 host and bind-mounted over the expected devices in the container.
1038 By default, they are bind-mounted over <filename>/dev/console</filename>
1039 and <filename>/dev/ttyN</filename>. This can prevent package upgrades
1040 in the guest. Therefore you can specify a directory location (under
1041 <filename>/dev</filename> under which LXC will create the files and
1042 bind-mount over them. These will then be symbolically linked to
1043 <filename>/dev/console</filename> and <filename>/dev/ttyN</filename>.
1044 A package upgrade can then succeed as it is able to remove and replace
1045 the symbolic links.
1046 </para>
1047 <variablelist>
1048 <varlistentry>
1049 <term>
1050 <option>lxc.tty.dir</option>
1051 </term>
1052 <listitem>
1053 <para>
1054 Specify a directory under <filename>/dev</filename>
1055 under which to create the container console devices. Note that LXC
1056 will move any bind-mounts or device nodes for /dev/console into
1057 this directory.
1058 </para>
1059 </listitem>
1060 </varlistentry>
1061 </variablelist>
1062 </refsect2>
1063
1064 <refsect2>
1065 <title>/dev directory</title>
1066 <para>
1067 By default, lxc creates a few symbolic links (fd,stdin,stdout,stderr)
1068 in the container's <filename>/dev</filename> directory but does not
1069 automatically create device node entries. This allows the container's
1070 <filename>/dev</filename> to be set up as needed in the container
1071 rootfs. If lxc.autodev is set to 1, then after mounting the container's
1072 rootfs LXC will mount a fresh tmpfs under <filename>/dev</filename>
1073 (limited to 500K by default, unless defined in lxc.autodev.tmpfs.size)
1074 and fill in a minimal set of initial devices.
1075 This is generally required when starting a container containing
1076 a "systemd" based "init" but may be optional at other times. Additional
1077 devices in the containers /dev directory may be created through the
1078 use of the <option>lxc.hook.autodev</option> hook.
1079 </para>
1080 <variablelist>
1081 <varlistentry>
1082 <term>
1083 <option>lxc.autodev</option>
1084 </term>
1085 <listitem>
1086 <para>
1087 Set this to 0 to stop LXC from mounting and populating a minimal
1088 <filename>/dev</filename> when starting the container.
1089 </para>
1090 </listitem>
1091 </varlistentry>
1092
1093 <varlistentry>
1094 <term>
1095 <option>lxc.autodev.tmpfs.size</option>
1096 </term>
1097 <listitem>
1098 <para>
1099 Set this to define the size of the /dev tmpfs.
1100 The default value is 500000 (500K). If the parameter is used
1101 but without value, the default value is used.
1102 </para>
1103 </listitem>
1104 </varlistentry>
1105 </variablelist>
1106 </refsect2>
1107
1108 <refsect2>
1109 <title>Mount points</title>
1110 <para>
1111 The mount points section specifies the different places to be
1112 mounted. These mount points will be private to the container
1113 and won't be visible by the processes running outside of the
1114 container. This is useful to mount /etc, /var or /home for
1115 examples.
1116 </para>
1117 <para>
1118 NOTE - LXC will generally ensure that mount targets and relative
1119 bind-mount sources are properly confined under the container
1120 root, to avoid attacks involving over-mounting host directories
1121 and files. (Symbolic links in absolute mount sources are ignored)
1122 However, if the container configuration first mounts a directory which
1123 is under the control of the container user, such as /home/joe, into
1124 the container at some <filename>path</filename>, and then mounts
1125 under <filename>path</filename>, then a TOCTTOU attack would be
1126 possible where the container user modifies a symbolic link under
1127 his home directory at just the right time.
1128 </para>
1129 <variablelist>
1130 <varlistentry>
1131 <term>
1132 <option>lxc.mount.fstab</option>
1133 </term>
1134 <listitem>
1135 <para>
1136 specify a file location in
1137 the <filename>fstab</filename> format, containing the
1138 mount information. The mount target location can and in
1139 most cases should be a relative path, which will become
1140 relative to the mounted container root. For instance,
1141 </para>
1142 <programlisting>
1143 proc proc proc nodev,noexec,nosuid 0 0
1144 </programlisting>
1145 <para>
1146 Will mount a proc filesystem under the container's /proc,
1147 regardless of where the root filesystem comes from. This
1148 is resilient to block device backed filesystems as well as
1149 container cloning.
1150 </para>
1151 <para>
1152 Note that when mounting a filesystem from an
1153 image file or block device the third field (fs_vfstype)
1154 cannot be auto as with
1155 <citerefentry>
1156 <refentrytitle>mount</refentrytitle>
1157 <manvolnum>8</manvolnum>
1158 </citerefentry>
1159 but must be explicitly specified.
1160 </para>
1161 </listitem>
1162 </varlistentry>
1163
1164 <varlistentry>
1165 <term>
1166 <option>lxc.mount.entry</option>
1167 </term>
1168 <listitem>
1169 <para>
1170 Specify a mount point corresponding to a line in the
1171 fstab format.
1172
1173 Moreover lxc supports mount propagation, such as rshared or
1174 rprivate, and adds three additional mount options.
1175 <option>optional</option> don't fail if mount does not work.
1176 <option>create=dir</option> or <option>create=file</option>
1177 to create dir (or file) when the point will be mounted.
1178 <option>relative</option> source path is taken to be relative to
1179 the mounted container root. For instance,
1180 </para>
1181 <programlisting>
1182 dev/null proc/kcore none bind,relative 0 0
1183 </programlisting>
1184 <para>
1185 Will expand dev/null to ${<option>LXC_ROOTFS_MOUNT</option>}/dev/null,
1186 and mount it to proc/kcore inside the container.
1187 </para>
1188 </listitem>
1189 </varlistentry>
1190
1191 <varlistentry>
1192 <term>
1193 <option>lxc.mount.auto</option>
1194 </term>
1195 <listitem>
1196 <para>
1197 specify which standard kernel file systems should be
1198 automatically mounted. This may dramatically simplify
1199 the configuration. The file systems are:
1200 </para>
1201 <itemizedlist>
1202 <listitem>
1203 <para>
1204 <option>proc:mixed</option> (or <option>proc</option>):
1205 mount <filename>/proc</filename> as read-write, but
1206 remount <filename>/proc/sys</filename> and
1207 <filename>/proc/sysrq-trigger</filename> read-only
1208 for security / container isolation purposes.
1209 </para>
1210 </listitem>
1211 <listitem>
1212 <para>
1213 <option>proc:rw</option>: mount
1214 <filename>/proc</filename> as read-write
1215 </para>
1216 </listitem>
1217 <listitem>
1218 <para>
1219 <option>sys:mixed</option> (or <option>sys</option>):
1220 mount <filename>/sys</filename> as read-only but with
1221 /sys/devices/virtual/net writable.
1222 </para>
1223 </listitem>
1224 <listitem>
1225 <para>
1226 <option>sys:ro</option>:
1227 mount <filename>/sys</filename> as read-only
1228 for security / container isolation purposes.
1229 </para>
1230 </listitem>
1231 <listitem>
1232 <para>
1233 <option>sys:rw</option>: mount
1234 <filename>/sys</filename> as read-write
1235 </para>
1236 </listitem>
1237
1238 <listitem>
1239 <para>
1240 <option>cgroup:mixed</option>:
1241 Mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1242 create directories for all hierarchies to which the container
1243 is added, create subdirectories in those hierarchies with the
1244 name of the cgroup, and bind-mount the container's own cgroup
1245 into that directory. The container will be able to write to
1246 its own cgroup directory, but not the parents, since they will
1247 be remounted read-only.
1248 </para>
1249 </listitem>
1250
1251 <listitem>
1252 <para>
1253 <option>cgroup:mixed:force</option>:
1254 The <option>force</option> option will cause LXC to perform
1255 the cgroup mounts for the container under all circumstances.
1256 Otherwise it is similar to <option>cgroup:mixed</option>.
1257 This is mainly useful when the cgroup namespaces are enabled
1258 where LXC will normally leave mounting cgroups to the init
1259 binary of the container since it is perfectly safe to do so.
1260 </para>
1261 </listitem>
1262
1263 <listitem>
1264 <para>
1265 <option>cgroup:ro</option>:
1266 similar to <option>cgroup:mixed</option>, but everything will
1267 be mounted read-only.
1268 </para>
1269 </listitem>
1270
1271 <listitem>
1272 <para>
1273 <option>cgroup:ro:force</option>:
1274 The <option>force</option> option will cause LXC to perform
1275 the cgroup mounts for the container under all circumstances.
1276 Otherwise it is similar to <option>cgroup:ro</option>.
1277 This is mainly useful when the cgroup namespaces are enabled
1278 where LXC will normally leave mounting cgroups to the init
1279 binary of the container since it is perfectly safe to do so.
1280 </para>
1281 </listitem>
1282
1283 <listitem>
1284 <para>
1285 <option>cgroup:rw</option>: similar to
1286 <option>cgroup:mixed</option>, but everything will be mounted
1287 read-write. Note that the paths leading up to the container's
1288 own cgroup will be writable, but will not be a cgroup
1289 filesystem but just part of the tmpfs of
1290 <filename>/sys/fs/cgroup</filename>
1291 </para>
1292 </listitem>
1293
1294 <listitem>
1295 <para>
1296 <option>cgroup:rw:force</option>:
1297 The <option>force</option> option will cause LXC to perform
1298 the cgroup mounts for the container under all circumstances.
1299 Otherwise it is similar to <option>cgroup:rw</option>.
1300 This is mainly useful when the cgroup namespaces are enabled
1301 where LXC will normally leave mounting cgroups to the init
1302 binary of the container since it is perfectly safe to do so.
1303 </para>
1304 </listitem>
1305
1306 <listitem>
1307 <para>
1308 <option>cgroup</option> (without specifier):
1309 defaults to <option>cgroup:rw</option> if the
1310 container retains the CAP_SYS_ADMIN capability,
1311 <option>cgroup:mixed</option> otherwise.
1312 </para>
1313 </listitem>
1314
1315 <listitem>
1316 <para>
1317 <option>cgroup-full:mixed</option>:
1318 mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1319 create directories for all hierarchies to which
1320 the container is added, bind-mount the hierarchies
1321 from the host to the container and make everything
1322 read-only except the container's own cgroup. Note
1323 that compared to <option>cgroup</option>, where
1324 all paths leading up to the container's own cgroup
1325 are just simple directories in the underlying
1326 tmpfs, here
1327 <filename>/sys/fs/cgroup/$hierarchy</filename>
1328 will contain the host's full cgroup hierarchy,
1329 albeit read-only outside the container's own cgroup.
1330 This may leak quite a bit of information into the
1331 container.
1332 </para>
1333 </listitem>
1334
1335 <listitem>
1336 <para>
1337 <option>cgroup-full:mixed:force</option>:
1338 The <option>force</option> option will cause LXC to perform
1339 the cgroup mounts for the container under all circumstances.
1340 Otherwise it is similar to <option>cgroup-full:mixed</option>.
1341 This is mainly useful when the cgroup namespaces are enabled
1342 where LXC will normally leave mounting cgroups to the init
1343 binary of the container since it is perfectly safe to do so.
1344 </para>
1345 </listitem>
1346
1347 <listitem>
1348 <para>
1349 <option>cgroup-full:ro</option>: similar to
1350 <option>cgroup-full:mixed</option>, but everything
1351 will be mounted read-only.
1352 </para>
1353 </listitem>
1354
1355 <listitem>
1356 <para>
1357 <option>cgroup-full:ro:force</option>:
1358 The <option>force</option> option will cause LXC to perform
1359 the cgroup mounts for the container under all circumstances.
1360 Otherwise it is similar to <option>cgroup-full:ro</option>.
1361 This is mainly useful when the cgroup namespaces are enabled
1362 where LXC will normally leave mounting cgroups to the init
1363 binary of the container since it is perfectly safe to do so.
1364 </para>
1365 </listitem>
1366
1367 <listitem>
1368 <para>
1369 <option>cgroup-full:rw</option>: similar to
1370 <option>cgroup-full:mixed</option>, but everything
1371 will be mounted read-write. Note that in this case,
1372 the container may escape its own cgroup. (Note also
1373 that if the container has CAP_SYS_ADMIN support
1374 and can mount the cgroup filesystem itself, it may
1375 do so anyway.)
1376 </para>
1377 </listitem>
1378
1379 <listitem>
1380 <para>
1381 <option>cgroup-full:rw:force</option>:
1382 The <option>force</option> option will cause LXC to perform
1383 the cgroup mounts for the container under all circumstances.
1384 Otherwise it is similar to <option>cgroup-full:rw</option>.
1385 This is mainly useful when the cgroup namespaces are enabled
1386 where LXC will normally leave mounting cgroups to the init
1387 binary of the container since it is perfectly safe to do so.
1388 </para>
1389 </listitem>
1390
1391 <listitem>
1392 <para>
1393 <option>cgroup-full</option> (without specifier):
1394 defaults to <option>cgroup-full:rw</option> if the
1395 container retains the CAP_SYS_ADMIN capability,
1396 <option>cgroup-full:mixed</option> otherwise.
1397 </para>
1398 </listitem>
1399
1400 </itemizedlist>
1401 <para>
1402 If cgroup namespaces are enabled, then any <option>cgroup</option>
1403 auto-mounting request will be ignored, since the container can
1404 mount the filesystems itself, and automounting can confuse the
1405 container init.
1406 </para>
1407 <para>
1408 Note that if automatic mounting of the cgroup filesystem
1409 is enabled, the tmpfs under
1410 <filename>/sys/fs/cgroup</filename> will always be
1411 mounted read-write (but for the <option>:mixed</option>
1412 and <option>:ro</option> cases, the individual
1413 hierarchies,
1414 <filename>/sys/fs/cgroup/$hierarchy</filename>, will be
1415 read-only). This is in order to work around a quirk in
1416 Ubuntu's
1417 <citerefentry>
1418 <refentrytitle>mountall</refentrytitle>
1419 <manvolnum>8</manvolnum>
1420 </citerefentry>
1421 command that will cause containers to wait for user
1422 input at boot if
1423 <filename>/sys/fs/cgroup</filename> is mounted read-only
1424 and the container can't remount it read-write due to a
1425 lack of CAP_SYS_ADMIN.
1426 </para>
1427 <para>
1428 Examples:
1429 </para>
1430 <programlisting>
1431 lxc.mount.auto = proc sys cgroup
1432 lxc.mount.auto = proc:rw sys:rw cgroup-full:rw
1433 </programlisting>
1434 </listitem>
1435 </varlistentry>
1436
1437 </variablelist>
1438 </refsect2>
1439
1440 <refsect2>
1441 <title>Root file system</title>
1442 <para>
1443 The root file system of the container can be different than that
1444 of the host system.
1445 </para>
1446 <variablelist>
1447 <varlistentry>
1448 <term>
1449 <option>lxc.rootfs.path</option>
1450 </term>
1451 <listitem>
1452 <para>
1453 specify the root file system for the container. It can
1454 be an image file, a directory or a block device. If not
1455 specified, the container shares its root file system
1456 with the host.
1457 </para>
1458 <para>
1459 For directory or simple block-device backed containers,
1460 a pathname can be used. If the rootfs is backed by a nbd
1461 device, then <filename>nbd:file:1</filename> specifies that
1462 <filename>file</filename> should be attached to a nbd device,
1463 and partition 1 should be mounted as the rootfs.
1464 <filename>nbd:file</filename> specifies that the nbd device
1465 itself should be mounted. <filename>overlayfs:/lower:/upper</filename>
1466 specifies that the rootfs should be an overlay with <filename>/upper</filename>
1467 being mounted read-write over a read-only mount of <filename>/lower</filename>.
1468 For <filename>overlay</filename> multiple <filename>/lower</filename>
1469 directories can be specified. <filename>loop:/file</filename> tells lxc to attach
1470 <filename>/file</filename> to a loop device and mount the loop device.
1471 </para>
1472 </listitem>
1473 </varlistentry>
1474
1475 <varlistentry>
1476 <term>
1477 <option>lxc.rootfs.mount</option>
1478 </term>
1479 <listitem>
1480 <para>
1481 where to recursively bind <option>lxc.rootfs.path</option>
1482 before pivoting. This is to ensure success of the
1483 <citerefentry>
1484 <refentrytitle><command>pivot_root</command></refentrytitle>
1485 <manvolnum>8</manvolnum>
1486 </citerefentry>
1487 syscall. Any directory suffices, the default should
1488 generally work.
1489 </para>
1490 </listitem>
1491 </varlistentry>
1492
1493 <varlistentry>
1494 <term>
1495 <option>lxc.rootfs.options</option>
1496 </term>
1497 <listitem>
1498 <para>
1499 extra mount options to use when mounting the rootfs.
1500 </para>
1501 </listitem>
1502 </varlistentry>
1503
1504 <varlistentry>
1505 <term>
1506 <option>lxc.rootfs.managed</option>
1507 </term>
1508 <listitem>
1509 <para>
1510 Set this to 0 to indicate that LXC is not managing the
1511 container storage, then LXC will not modify the
1512 container storage. The default is 1.
1513 </para>
1514 </listitem>
1515 </varlistentry>
1516
1517 </variablelist>
1518 </refsect2>
1519
1520 <refsect2>
1521 <title>Control group</title>
1522 <para>
1523 The control group section contains the configuration for the
1524 different subsystem. <command>lxc</command> does not check the
1525 correctness of the subsystem name. This has the disadvantage
1526 of not detecting configuration errors until the container is
1527 started, but has the advantage of permitting any future
1528 subsystem.
1529 </para>
1530 <variablelist>
1531 <varlistentry>
1532 <term>
1533 <option>lxc.cgroup.[controller name]</option>
1534 </term>
1535 <listitem>
1536 <para>
1537 Specify the control group value to be set on a legacy cgroup
1538 hierarchy. The controller name is the literal name of the control
1539 group. The permitted names and the syntax of their values is not
1540 dictated by LXC, instead it depends on the features of the Linux
1541 kernel running at the time the container is started, eg.
1542 <option>lxc.cgroup.cpuset.cpus</option>
1543 </para>
1544 </listitem>
1545 </varlistentry>
1546 <varlistentry>
1547 <term>
1548 <option>lxc.cgroup2.[controller name]</option>
1549 </term>
1550 <listitem>
1551 <para>
1552 Specify the control group value to be set on the unified cgroup
1553 hierarchy. The controller name is the literal name of the control
1554 group. The permitted names and the syntax of their values is not
1555 dictated by LXC, instead it depends on the features of the Linux
1556 kernel running at the time the container is started, eg.
1557 <option>lxc.cgroup2.memory.high</option>
1558 </para>
1559 </listitem>
1560 </varlistentry>
1561 <varlistentry>
1562 <term>
1563 <option>lxc.cgroup.dir</option>
1564 </term>
1565 <listitem>
1566 <para>
1567 specify a directory or path in which the container's cgroup will
1568 be created. For example, setting
1569 <option>lxc.cgroup.dir = my-cgroup/first</option> for a container
1570 named "c1" will create the container's cgroup as a sub-cgroup of
1571 "my-cgroup". For example, if the user's current cgroup "my-user"
1572 is located in the root cgroup of the cpuset controller in a
1573 cgroup v1 hierarchy this would create the cgroup
1574 "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" for the
1575 container. Any missing cgroups will be created by LXC. This
1576 presupposes that the user has write access to its current cgroup.
1577 </para>
1578 </listitem>
1579 </varlistentry>
1580 <varlistentry>
1581 <term>
1582 <option>lxc.cgroup.dir.container</option>
1583 </term>
1584 <listitem>
1585 <para>
1586 This is similar to <option>lxc.cgroup.dir</option>, but must be
1587 used together with <option>lxc.cgroup.dir.monitor</option> and
1588 affects only the container's cgroup path. This option is mutually
1589 exclusive with <option>lxc.cgroup.dir</option>.
1590 Note that the final path the container attaches to may be
1591 extended further by the
1592 <option>lxc.cgroup.dir.container.inner</option> option.
1593 </para>
1594 </listitem>
1595 </varlistentry>
1596 <varlistentry>
1597 <term>
1598 <option>lxc.cgroup.dir.monitor</option>
1599 </term>
1600 <listitem>
1601 <para>
1602 This is the monitor process counterpart to
1603 <option>lxc.cgroup.dir.container</option>.
1604 </para>
1605 </listitem>
1606 </varlistentry>
1607 <varlistentry>
1608 <term>
1609 <option>lxc.cgroup.dir.monitor.pivot</option>
1610 </term>
1611 <listitem>
1612 <para>
1613 On container termination the PID of the monitor process is attached to this cgroup.
1614 This path should not be a subpath of any other configured cgroup dir to ensure
1615 proper removal of other cgroup paths on container termination.
1616 </para>
1617 </listitem>
1618 </varlistentry>
1619 <varlistentry>
1620 <term>
1621 <option>lxc.cgroup.dir.container.inner</option>
1622 </term>
1623 <listitem>
1624 <para>
1625 Specify an additional subdirectory where the cgroup namespace
1626 will be created. With this option, the cgroup limits will be
1627 applied to the outer path specified in
1628 <option>lxc.cgroup.dir.container</option>, which is not accessible
1629 from within the container, making it possible to better enforce
1630 limits for privileged containers in a way they cannot override
1631 them.
1632 This only works in conjunction with the
1633 <option>lxc.cgroup.dir.container</option> and
1634 <option>lxc.cgroup.dir.monitor</option> options and has otherwise
1635 no effect.
1636 </para>
1637 </listitem>
1638 </varlistentry>
1639 <varlistentry>
1640 <term>
1641 <option>lxc.cgroup.relative</option>
1642 </term>
1643 <listitem>
1644 <para>
1645 Set this to 1 to instruct LXC to never escape to the
1646 root cgroup. This makes it easy for users to adhere to
1647 restrictions enforced by cgroup2 and
1648 systemd. Specifically, this makes it possible to run LXC
1649 containers as systemd services.
1650 </para>
1651 </listitem>
1652 </varlistentry>
1653 </variablelist>
1654 </refsect2>
1655
1656 <refsect2>
1657 <title>Capabilities</title>
1658 <para>
1659 The capabilities can be dropped in the container if this one
1660 is run as root.
1661 </para>
1662 <variablelist>
1663 <varlistentry>
1664 <term>
1665 <option>lxc.cap.drop</option>
1666 </term>
1667 <listitem>
1668 <para>
1669 Specify the capability to be dropped in the container. A
1670 single line defining several capabilities with a space
1671 separation is allowed. The format is the lower case of
1672 the capability definition without the "CAP_" prefix,
1673 eg. CAP_SYS_MODULE should be specified as
1674 sys_module. See
1675 <citerefentry>
1676 <refentrytitle><command>capabilities</command></refentrytitle>
1677 <manvolnum>7</manvolnum>
1678 </citerefentry>.
1679 If used with no value, lxc will clear any drop capabilities
1680 specified up to this point.
1681 </para>
1682 </listitem>
1683 </varlistentry>
1684 <varlistentry>
1685 <term>
1686 <option>lxc.cap.keep</option>
1687 </term>
1688 <listitem>
1689 <para>
1690 Specify the capability to be kept in the container. All other
1691 capabilities will be dropped. When a special value of "none" is
1692 encountered, lxc will clear any keep capabilities specified up
1693 to this point. A value of "none" alone can be used to drop all
1694 capabilities.
1695 </para>
1696 </listitem>
1697 </varlistentry>
1698 </variablelist>
1699 </refsect2>
1700
1701 <refsect2>
1702 <title>Namespaces</title>
1703 <para>
1704 A namespace can be cloned (<option>lxc.namespace.clone</option>),
1705 kept (<option>lxc.namespace.keep</option>) or shared
1706 (<option>lxc.namespace.share.[namespace identifier]</option>).
1707 </para>
1708 <variablelist>
1709 <varlistentry>
1710 <term>
1711 <option>lxc.namespace.clone</option>
1712 </term>
1713 <listitem>
1714 <para>
1715 Specify namespaces which the container is supposed to be created
1716 with. The namespaces to create are specified as a space separated
1717 list. Each namespace must correspond to one of the standard
1718 namespace identifiers as seen in the
1719 <filename>/proc/PID/ns</filename> directory.
1720 When <option>lxc.namespace.clone</option> is not explicitly set all
1721 namespaces supported by the kernel and the current configuration
1722 will be used.
1723 </para>
1724
1725 <para>
1726 To create a new mount, net and ipc namespace set
1727 <option>lxc.namespace.clone=mount net ipc</option>.
1728 </para>
1729 </listitem>
1730 </varlistentry>
1731
1732 <varlistentry>
1733 <term>
1734 <option>lxc.namespace.keep</option>
1735 </term>
1736 <listitem>
1737 <para>
1738 Specify namespaces which the container is supposed to inherit from
1739 the process that created it. The namespaces to keep are specified as
1740 a space separated list. Each namespace must correspond to one of the
1741 standard namespace identifiers as seen in the
1742 <filename>/proc/PID/ns</filename> directory.
1743 The <option>lxc.namespace.keep</option> is a
1744 denylist option, i.e. it is useful when enforcing that containers
1745 must keep a specific set of namespaces.
1746 </para>
1747
1748 <para>
1749 To keep the network, user and ipc namespace set
1750 <option>lxc.namespace.keep=user net ipc</option>.
1751 </para>
1752
1753 <para>
1754 Note that sharing pid namespaces will likely not work with most init
1755 systems.
1756 </para>
1757
1758 <para>
1759 Note that if the container requests a new user namespace and the
1760 container wants to inherit the network namespace it needs to inherit
1761 the user namespace as well.
1762 </para>
1763 </listitem>
1764 </varlistentry>
1765
1766 <varlistentry>
1767 <term>
1768 <option>lxc.namespace.share.[namespace identifier]</option>
1769 </term>
1770 <listitem>
1771 <para>
1772 Specify a namespace to inherit from another container or process.
1773 The <option>[namespace identifier]</option> suffix needs to be
1774 replaced with one of the namespaces that appear in the
1775 <filename>/proc/PID/ns</filename> directory.
1776 </para>
1777
1778 <para>
1779 To inherit the namespace from another process set the
1780 <option>lxc.namespace.share.[namespace identifier]</option> to the PID of
1781 the process, e.g. <option>lxc.namespace.share.net=42</option>.
1782 </para>
1783
1784 <para>
1785 To inherit the namespace from another container set the
1786 <option>lxc.namespace.share.[namespace identifier]</option> to the name of
1787 the container, e.g. <option>lxc.namespace.share.pid=c3</option>.
1788 </para>
1789
1790 <para>
1791 To inherit the namespace from another container located in a
1792 different path than the standard liblxc path set the
1793 <option>lxc.namespace.share.[namespace identifier]</option> to the full
1794 path to the container, e.g.
1795 <option>lxc.namespace.share.user=/opt/c3</option>.
1796 </para>
1797
1798 <para>
1799 In order to inherit namespaces the caller needs to have sufficient
1800 privilege over the process or container.
1801 </para>
1802
1803 <para>
1804 Note that sharing pid namespaces between system containers will
1805 likely not work with most init systems.
1806 </para>
1807
1808 <para>
1809 Note that if two processes are in different user namespaces and one
1810 process wants to inherit the other's network namespace it usually
1811 needs to inherit the user namespace as well.
1812 </para>
1813
1814 <para>
1815 Note that without careful additional configuration of an LSM,
1816 sharing user+pid namespaces with a task may allow that task to
1817 escalate privileges to that of the task calling liblxc.
1818 </para>
1819 </listitem>
1820 </varlistentry>
1821
1822 <varlistentry>
1823 <term>
1824 <option>lxc.time.offset.boot</option>
1825 </term>
1826 <listitem>
1827 <para>
1828 Specify a positive or negative offset for the boottime clock. The
1829 format accepts hours (h), minutes (m), seconds (s),
1830 milliseconds (ms), microseconds (us), and nanoseconds (ns).
1831 </para>
1832 </listitem>
1833 </varlistentry>
1834
1835 <varlistentry>
1836 <term>
1837 <option>lxc.time.offset.monotonic</option>
1838 </term>
1839 <listitem>
1840 <para>
1841 Specify a positive or negative offset for the monotonic clock. The
1842 format accepts hours (h), minutes (m), seconds (s),
1843 milliseconds (ms), microseconds (us), and nanoseconds (ns).
1844 </para>
1845 </listitem>
1846 </varlistentry>
1847
1848 </variablelist>
1849 </refsect2>
1850
1851 <refsect2>
1852 <title>Resource limits</title>
1853 <para>
1854 The soft and hard resource limits for the container can be changed.
1855 Unprivileged containers can only lower them. Resources which are not
1856 explicitly specified will be inherited.
1857 </para>
1858 <variablelist>
1859 <varlistentry>
1860 <term>
1861 <option>lxc.prlimit.[limit name]</option>
1862 </term>
1863 <listitem>
1864 <para>
1865 Specify the resource limit to be set. A limit is specified as two
1866 colon separated values which are either numeric or the word
1867 'unlimited'. A single value can be used as a shortcut to set both
1868 soft and hard limit to the same value. The permitted names the
1869 "RLIMIT_" resource names in lowercase without the "RLIMIT_"
1870 prefix, eg. RLIMIT_NOFILE should be specified as "nofile". See
1871 <citerefentry>
1872 <refentrytitle><command>setrlimit</command></refentrytitle>
1873 <manvolnum>2</manvolnum>
1874 </citerefentry>.
1875 If used with no value, lxc will clear the resource limit
1876 specified up to this point. A resource with no explicitly
1877 configured limitation will be inherited from the process starting
1878 up the container.
1879 </para>
1880 </listitem>
1881 </varlistentry>
1882 </variablelist>
1883 </refsect2>
1884
1885 <refsect2>
1886 <title>Sysctl</title>
1887 <para>
1888 Configure kernel parameters for the container.
1889 </para>
1890 <variablelist>
1891 <varlistentry>
1892 <term>
1893 <option>lxc.sysctl.[kernel parameters name]</option>
1894 </term>
1895 <listitem>
1896 <para>
1897 Specify the kernel parameters to be set. The parameters available
1898 are those listed under /proc/sys/.
1899 Note that not all sysctls are namespaced. Changing Non-namespaced
1900 sysctls will cause the system-wide setting to be modified.
1901 <citerefentry>
1902 <refentrytitle><command>sysctl</command></refentrytitle>
1903 <manvolnum>8</manvolnum>
1904 </citerefentry>.
1905 If used with no value, lxc will clear the parameters specified up
1906 to this point.
1907 </para>
1908 </listitem>
1909 </varlistentry>
1910 </variablelist>
1911 </refsect2>
1912
1913 <refsect2>
1914 <title>Apparmor profile</title>
1915 <para>
1916 If lxc was compiled and installed with apparmor support, and the host
1917 system has apparmor enabled, then the apparmor profile under which the
1918 container should be run can be specified in the container
1919 configuration. The default is <command>lxc-container-default-cgns</command>
1920 if the host kernel is cgroup namespace aware, or
1921 <command>lxc-container-default</command> otherwise.
1922 </para>
1923 <variablelist>
1924 <varlistentry>
1925 <term>
1926 <option>lxc.apparmor.profile</option>
1927 </term>
1928 <listitem>
1929 <para>
1930 Specify the apparmor profile under which the container should
1931 be run. To specify that the container should be unconfined,
1932 use
1933 </para>
1934 <programlisting>lxc.apparmor.profile = unconfined</programlisting>
1935 <para>
1936 If the apparmor profile should remain unchanged (i.e. if you
1937 are nesting containers and are already confined), then use
1938 </para>
1939 <programlisting>lxc.apparmor.profile = unchanged</programlisting>
1940 <para>
1941 If you instruct LXC to generate the apparmor profile,
1942 then use
1943 </para>
1944 <programlisting>lxc.apparmor.profile = generated</programlisting>
1945 </listitem>
1946 </varlistentry>
1947 <varlistentry>
1948 <term>
1949 <option>lxc.apparmor.allow_incomplete</option>
1950 </term>
1951 <listitem>
1952 <para>
1953 Apparmor profiles are pathname based. Therefore many file
1954 restrictions require mount restrictions to be effective against
1955 a determined attacker. However, these mount restrictions are not
1956 yet implemented in the upstream kernel. Without the mount
1957 restrictions, the apparmor profiles still protect against accidental
1958 damager.
1959 </para>
1960 <para>
1961 If this flag is 0 (default), then the container will not be
1962 started if the kernel lacks the apparmor mount features, so that a
1963 regression after a kernel upgrade will be detected. To start the
1964 container under partial apparmor protection, set this flag to 1.
1965 </para>
1966 </listitem>
1967 </varlistentry>
1968
1969 <varlistentry>
1970 <term>
1971 <option>lxc.apparmor.allow_nesting</option>
1972 </term>
1973 <listitem>
1974 <para>
1975 If set this to 1, causes the following changes. When
1976 generated apparmor profiles are used, they will contain
1977 the necessary changes to allow creating a nested
1978 container. In addition to the usual mount points,
1979 <filename>/dev/.lxc/proc</filename>
1980 and <filename>/dev/.lxc/sys</filename> will contain
1981 procfs and sysfs mount points without the lxcfs
1982 overlays, which, if generated apparmor profiles are
1983 being used, will not be read/writable directly.
1984 </para>
1985 </listitem>
1986 </varlistentry>
1987
1988 <varlistentry>
1989 <term>
1990 <option>lxc.apparmor.raw</option>
1991 </term>
1992 <listitem>
1993 <para>
1994 A list of raw AppArmor profile lines to append to the
1995 profile. Only valid when using generated profiles.
1996 </para>
1997 </listitem>
1998 </varlistentry>
1999
2000 </variablelist>
2001 </refsect2>
2002
2003 <refsect2>
2004 <title>SELinux context</title>
2005 <para>
2006 If lxc was compiled and installed with SELinux support, and the host
2007 system has SELinux enabled, then the SELinux context under which the
2008 container should be run can be specified in the container
2009 configuration. The default is <command>unconfined_t</command>,
2010 which means that lxc will not attempt to change contexts.
2011 See @DATADIR@/lxc/selinux/lxc.te for an example policy and more
2012 information.
2013 </para>
2014 <variablelist>
2015 <varlistentry>
2016 <term>
2017 <option>lxc.selinux.context</option>
2018 </term>
2019 <listitem>
2020 <para>
2021 Specify the SELinux context under which the container should
2022 be run or <command>unconfined_t</command>. For example
2023 </para>
2024 <programlisting>lxc.selinux.context = system_u:system_r:lxc_t:s0:c22</programlisting>
2025 </listitem>
2026 </varlistentry>
2027 <varlistentry>
2028 <term>
2029 <option>lxc.selinux.context.keyring</option>
2030 </term>
2031 <listitem>
2032 <para>
2033 Specify the SELinux context under which the container's keyring
2034 should be created. By default this the same as lxc.selinux.context, or
2035 the context lxc is executed under if lxc.selinux.context has not been set.
2036 </para>
2037 <programlisting>lxc.selinux.context.keyring = system_u:system_r:lxc_t:s0:c22</programlisting>
2038 </listitem>
2039 </varlistentry>
2040 </variablelist>
2041 </refsect2>
2042
2043 <refsect2>
2044 <title>Kernel Keyring</title>
2045 <para>
2046 The Linux Keyring facility is primarily a way for various
2047 kernel components to retain or cache security data, authentication
2048 keys, encryption keys, and other data in the kernel. By default lxc
2049 will create a new session keyring for the started application.
2050 </para>
2051 <variablelist>
2052 <varlistentry>
2053 <term>
2054 <option>lxc.keyring.session</option>
2055 </term>
2056 <listitem>
2057 <para>
2058 Disable the creation of new session keyring by lxc. The started
2059 application will then inherit the current session keyring.
2060 By default, or when passing the value 1, a new keyring will be created.
2061 </para>
2062 <programlisting>lxc.keyring.session = 0</programlisting>
2063 </listitem>
2064 </varlistentry>
2065 </variablelist>
2066 </refsect2>
2067
2068 <refsect2>
2069 <title>Seccomp configuration</title>
2070 <para>
2071 A container can be started with a reduced set of available
2072 system calls by loading a seccomp profile at startup. The
2073 seccomp configuration file must begin with a version number
2074 on the first line, a policy type on the second line, followed
2075 by the configuration.
2076 </para>
2077 <para>
2078 Versions 1 and 2 are currently supported. In version 1, the
2079 policy is a simple allowlist. The second line therefore must
2080 read "allowlist", with the rest of the file containing one (numeric)
2081 syscall number per line. Each syscall number is allowlisted,
2082 while every unlisted number is denylisted for use in the container
2083 </para>
2084
2085 <para>
2086 In version 2, the policy may be denylist or allowlist,
2087 supports per-rule and per-policy default actions, and supports
2088 per-architecture system call resolution from textual names.
2089 </para>
2090 <para>
2091 An example denylist policy, in which all system calls are
2092 allowed except for mknod, which will simply do nothing and
2093 return 0 (success), looks like:
2094 </para>
2095
2096 <programlisting>
2097 2
2098 denylist
2099 mknod errno 0
2100 ioctl notify
2101 </programlisting>
2102
2103 <para>
2104 Specifying "errno" as action will cause LXC to register a seccomp filter
2105 that will cause a specific errno to be returned to the caller. The errno
2106 value can be specified after the "errno" action word.
2107 </para>
2108
2109 <para>
2110 Specifying "notify" as action will cause LXC to register a seccomp
2111 listener and retrieve a listener file descriptor from the kernel. When a
2112 syscall is made that is registered as "notify" the kernel will generate a
2113 poll event and send a message over the file descriptor. The caller can
2114 read this message, inspect the syscalls including its arguments. Based on
2115 this information the caller is expected to send back a message informing
2116 the kernel which action to take. Until that message is sent the kernel
2117 will block the calling process. The format of the messages to read and
2118 sent is documented in seccomp itself.
2119 </para>
2120
2121 <variablelist>
2122 <varlistentry>
2123 <term>
2124 <option>lxc.seccomp.profile</option>
2125 </term>
2126 <listitem>
2127 <para>
2128 Specify a file containing the seccomp configuration to
2129 load before the container starts.
2130 </para>
2131 </listitem>
2132 </varlistentry>
2133 <varlistentry>
2134 <term>
2135 <option>lxc.seccomp.allow_nesting</option>
2136 </term>
2137 <listitem>
2138 <para>
2139 If this flag is set to 1, then seccomp filters will be stacked
2140 regardless of whether a seccomp profile is already loaded.
2141 This allows nested containers to load their own seccomp profile.
2142 The default setting is 0.
2143 </para>
2144 </listitem>
2145 </varlistentry>
2146 <varlistentry>
2147 <term>
2148 <option>lxc.seccomp.notify.proxy</option>
2149 </term>
2150 <listitem>
2151 <para>
2152 Specify a unix socket to which LXC will connect and forward
2153 seccomp events to. The path must be in the form
2154 unix:/path/to/socket or unix:@socket. The former specifies a
2155 path-bound unix domain socket while the latter specifies an
2156 abstract unix domain socket.
2157 </para>
2158 </listitem>
2159 </varlistentry>
2160 <varlistentry>
2161 <term>
2162 <option>lxc.seccomp.notify.cookie</option>
2163 </term>
2164 <listitem>
2165 <para>
2166 An additional string sent along with proxied seccomp notification
2167 requests.
2168 </para>
2169 </listitem>
2170 </varlistentry>
2171 </variablelist>
2172 </refsect2>
2173
2174 <refsect2>
2175 <title>PR_SET_NO_NEW_PRIVS</title>
2176 <para>
2177 With PR_SET_NO_NEW_PRIVS active execve() promises not to grant
2178 privileges to do anything that could not have been done without
2179 the execve() call (for example, rendering the set-user-ID and
2180 set-group-ID mode bits, and file capabilities non-functional).
2181 Once set, this bit cannot be unset. The setting of this bit is
2182 inherited by children created by fork() and clone(), and preserved
2183 across execve().
2184 Note that PR_SET_NO_NEW_PRIVS is applied after the container has
2185 changed into its intended AppArmor profile or SElinux context.
2186 </para>
2187 <variablelist>
2188 <varlistentry>
2189 <term>
2190 <option>lxc.no_new_privs</option>
2191 </term>
2192 <listitem>
2193 <para>
2194 Specify whether the PR_SET_NO_NEW_PRIVS flag should be set for the
2195 container. Set to 1 to activate.
2196 </para>
2197 </listitem>
2198 </varlistentry>
2199 </variablelist>
2200 </refsect2>
2201
2202 <refsect2>
2203 <title>UID mappings</title>
2204 <para>
2205 A container can be started in a private user namespace with
2206 user and group id mappings. For instance, you can map userid
2207 0 in the container to userid 200000 on the host. The root
2208 user in the container will be privileged in the container,
2209 but unprivileged on the host. Normally a system container
2210 will want a range of ids, so you would map, for instance,
2211 user and group ids 0 through 20,000 in the container to the
2212 ids 200,000 through 220,000.
2213 </para>
2214 <variablelist>
2215 <varlistentry>
2216 <term>
2217 <option>lxc.idmap</option>
2218 </term>
2219 <listitem>
2220 <para>
2221 Four values must be provided. First a character, either
2222 'u', or 'g', to specify whether user or group ids are
2223 being mapped. Next is the first userid as seen in the
2224 user namespace of the container. Next is the userid as
2225 seen on the host. Finally, a range indicating the number
2226 of consecutive ids to map.
2227 </para>
2228 </listitem>
2229 </varlistentry>
2230 </variablelist>
2231 </refsect2>
2232
2233 <refsect2>
2234 <title>Container hooks</title>
2235 <para>
2236 Container hooks are programs or scripts which can be executed
2237 at various times in a container's lifetime.
2238 </para>
2239 <para>
2240 When a container hook is executed, additional information is passed
2241 along. The <option>lxc.hook.version</option> argument can be used to
2242 determine if the following arguments are passed as command line
2243 arguments or through environment variables. The arguments are:
2244 <itemizedlist>
2245 <listitem><para> Container name. </para></listitem>
2246 <listitem><para> Section (always 'lxc'). </para></listitem>
2247 <listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem>
2248 <listitem><para> Additional arguments. In the
2249 case of the clone hook, any extra arguments passed will appear as
2250 further arguments to the hook. In the case of the stop hook, paths to
2251 filedescriptors for each of the container's namespaces along with
2252 their types are passed. </para></listitem>
2253 </itemizedlist>
2254 The following environment variables are set:
2255 <itemizedlist>
2256 <listitem><para> LXC_CGNS_AWARE: indicator whether the container is
2257 cgroup namespace aware. </para></listitem>
2258 <listitem><para> LXC_CONFIG_FILE: the path to the container
2259 configuration file. </para></listitem>
2260 <listitem><para> LXC_HOOK_TYPE: the hook type (e.g. 'clone', 'mount',
2261 'pre-mount'). Note that the existence of this environment variable is
2262 conditional on the value of <option>lxc.hook.version</option>. If it
2263 is set to 1 then LXC_HOOK_TYPE will be set.
2264 </para></listitem>
2265 <listitem><para> LXC_HOOK_SECTION: the section type (e.g. 'lxc',
2266 'net'). Note that the existence of this environment variable is
2267 conditional on the value of <option>lxc.hook.version</option>. If it
2268 is set to 1 then LXC_HOOK_SECTION will be set.
2269 </para></listitem>
2270 <listitem><para> LXC_HOOK_VERSION: the version of the hooks. This
2271 value is identical to the value of the container's
2272 <option>lxc.hook.version</option> config item. If it is set to 0 then
2273 old-style hooks are used. If it is set to 1 then new-style hooks are
2274 used. </para></listitem>
2275 <listitem><para> LXC_LOG_LEVEL: the container's log level. </para></listitem>
2276 <listitem><para> LXC_NAME: is the container's name. </para></listitem>
2277 <listitem><para> LXC_[NAMESPACE IDENTIFIER]_NS: path under
2278 /proc/PID/fd/ to a file descriptor referring to the container's
2279 namespace. For each preserved namespace type there will be a separate
2280 environment variable. These environment variables will only be set if
2281 <option>lxc.hook.version</option> is set to 1. </para></listitem>
2282 <listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem>
2283 <listitem><para> LXC_ROOTFS_PATH: this is the lxc.rootfs.path entry
2284 for the container. Note this is likely not where the mounted rootfs is
2285 to be found, use LXC_ROOTFS_MOUNT for that. </para></listitem>
2286 <listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is
2287 the original container's name. </para></listitem>
2288 </itemizedlist>
2289 </para>
2290 <para>
2291 Standard output from the hooks is logged at debug level.
2292 Standard error is not logged, but can be captured by the
2293 hook redirecting its standard error to standard output.
2294 </para>
2295 <variablelist>
2296 <varlistentry>
2297 <term>
2298 <option>lxc.hook.version</option>
2299 </term>
2300 <listitem>
2301 <para>
2302 To pass the arguments in new style via environment variables set to
2303 1 otherwise set to 0 to pass them as arguments.
2304 This setting affects all hooks arguments that were traditionally
2305 passed as arguments to the script. Specifically, it affects the
2306 container name, section (e.g. 'lxc', 'net') and hook type (e.g.
2307 'clone', 'mount', 'pre-mount') arguments. If new-style hooks are
2308 used then the arguments will be available as environment variables.
2309 The container name will be set in LXC_NAME. (This is set
2310 independently of the value used for this config item.) The section
2311 will be set in LXC_HOOK_SECTION and the hook type will be set in
2312 LXC_HOOK_TYPE.
2313 It also affects how the paths to file descriptors referring to the
2314 container's namespaces are passed. If set to 1 then for each
2315 namespace a separate environment variable LXC_[NAMESPACE
2316 IDENTIFIER]_NS will be set. If set to 0 then the paths will be
2317 passed as arguments to the stop hook.
2318 </para>
2319 </listitem>
2320 </varlistentry>
2321 </variablelist>
2322 <variablelist>
2323 <varlistentry>
2324 <term>
2325 <option>lxc.hook.pre-start</option>
2326 </term>
2327 <listitem>
2328 <para>
2329 A hook to be run in the host's namespace before the
2330 container ttys, consoles, or mounts are up.
2331 </para>
2332 </listitem>
2333 </varlistentry>
2334 </variablelist>
2335 <variablelist>
2336 <varlistentry>
2337 <term>
2338 <option>lxc.hook.pre-mount</option>
2339 </term>
2340 <listitem>
2341 <para>
2342 A hook to be run in the container's fs namespace but before
2343 the rootfs has been set up. This allows for manipulation
2344 of the rootfs, i.e. to mount an encrypted filesystem. Mounts
2345 done in this hook will not be reflected on the host (apart from
2346 mounts propagation), so they will be automatically cleaned up
2347 when the container shuts down.
2348 </para>
2349 </listitem>
2350 </varlistentry>
2351 </variablelist>
2352 <variablelist>
2353 <varlistentry>
2354 <term>
2355 <option>lxc.hook.mount</option>
2356 </term>
2357 <listitem>
2358 <para>
2359 A hook to be run in the container's namespace after
2360 mounting has been done, but before the pivot_root.
2361 </para>
2362 </listitem>
2363 </varlistentry>
2364 </variablelist>
2365 <variablelist>
2366 <varlistentry>
2367 <term>
2368 <option>lxc.hook.autodev</option>
2369 </term>
2370 <listitem>
2371 <para>
2372 A hook to be run in the container's namespace after
2373 mounting has been done and after any mount hooks have
2374 run, but before the pivot_root, if
2375 <option>lxc.autodev</option> == 1.
2376 The purpose of this hook is to assist in populating the
2377 /dev directory of the container when using the autodev
2378 option for systemd based containers. The container's /dev
2379 directory is relative to the
2380 ${<option>LXC_ROOTFS_MOUNT</option>} environment
2381 variable available when the hook is run.
2382 </para>
2383 </listitem>
2384 </varlistentry>
2385 </variablelist>
2386 <variablelist>
2387 <varlistentry>
2388 <term>
2389 <option>lxc.hook.start-host</option>
2390 </term>
2391 <listitem>
2392 <para>
2393 A hook to be run in the host's namespace after the
2394 container has been setup, and immediately before starting
2395 the container init.
2396 </para>
2397 </listitem>
2398 </varlistentry>
2399 </variablelist>
2400 <variablelist>
2401 <varlistentry>
2402 <term>
2403 <option>lxc.hook.start</option>
2404 </term>
2405 <listitem>
2406 <para>
2407 A hook to be run in the container's namespace immediately
2408 before executing the container's init. This requires the
2409 program to be available in the container.
2410 </para>
2411 </listitem>
2412 </varlistentry>
2413 </variablelist>
2414 <variablelist>
2415 <varlistentry>
2416 <term>
2417 <option>lxc.hook.stop</option>
2418 </term>
2419 <listitem>
2420 <para>
2421 A hook to be run in the host's namespace with references
2422 to the container's namespaces after the container has been shut
2423 down. For each namespace an extra argument is passed to the hook
2424 containing the namespace's type and a filename that can be used to
2425 obtain a file descriptor to the corresponding namespace, separated
2426 by a colon. The type is the name as it would appear in the
2427 <filename>/proc/PID/ns</filename> directory.
2428 For instance for the mount namespace the argument usually looks
2429 like <filename>mnt:/proc/PID/fd/12</filename>.
2430 </para>
2431 </listitem>
2432 </varlistentry>
2433 </variablelist>
2434 <variablelist>
2435 <varlistentry>
2436 <term>
2437 <option>lxc.hook.post-stop</option>
2438 </term>
2439 <listitem>
2440 <para>
2441 A hook to be run in the host's namespace after the
2442 container has been shut down.
2443 </para>
2444 </listitem>
2445 </varlistentry>
2446 </variablelist>
2447 <variablelist>
2448 <varlistentry>
2449 <term>
2450 <option>lxc.hook.clone</option>
2451 </term>
2452 <listitem>
2453 <para>
2454 A hook to be run when the container is cloned to a new one.
2455 See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
2456 <manvolnum>1</manvolnum></citerefentry> for more information.
2457 </para>
2458 </listitem>
2459 </varlistentry>
2460 </variablelist>
2461 <variablelist>
2462 <varlistentry>
2463 <term>
2464 <option>lxc.hook.destroy</option>
2465 </term>
2466 <listitem>
2467 <para>
2468 A hook to be run when the container is destroyed.
2469 </para>
2470 </listitem>
2471 </varlistentry>
2472 </variablelist>
2473 </refsect2>
2474
2475 <refsect2>
2476 <title>Container hooks Environment Variables</title>
2477 <para>
2478 A number of environment variables are made available to the startup
2479 hooks to provide configuration information and assist in the
2480 functioning of the hooks. Not all variables are valid in all
2481 contexts. In particular, all paths are relative to the host system
2482 and, as such, not valid during the <option>lxc.hook.start</option> hook.
2483 </para>
2484 <variablelist>
2485 <varlistentry>
2486 <term>
2487 <option>LXC_NAME</option>
2488 </term>
2489 <listitem>
2490 <para>
2491 The LXC name of the container. Useful for logging messages
2492 in common log environments. [<option>-n</option>]
2493 </para>
2494 </listitem>
2495 </varlistentry>
2496 </variablelist>
2497 <variablelist>
2498 <varlistentry>
2499 <term>
2500 <option>LXC_CONFIG_FILE</option>
2501 </term>
2502 <listitem>
2503 <para>
2504 Host relative path to the container configuration file. This
2505 gives the container to reference the original, top level,
2506 configuration file for the container in order to locate any
2507 additional configuration information not otherwise made
2508 available. [<option>-f</option>]
2509 </para>
2510 </listitem>
2511 </varlistentry>
2512 </variablelist>
2513 <variablelist>
2514 <varlistentry>
2515 <term>
2516 <option>LXC_CONSOLE</option>
2517 </term>
2518 <listitem>
2519 <para>
2520 The path to the console output of the container if not NULL.
2521 [<option>-c</option>] [<option>lxc.console.path</option>]
2522 </para>
2523 </listitem>
2524 </varlistentry>
2525 </variablelist>
2526 <variablelist>
2527 <varlistentry>
2528 <term>
2529 <option>LXC_CONSOLE_LOGPATH</option>
2530 </term>
2531 <listitem>
2532 <para>
2533 The path to the console log output of the container if not NULL.
2534 [<option>-L</option>]
2535 </para>
2536 </listitem>
2537 </varlistentry>
2538 </variablelist>
2539 <variablelist>
2540 <varlistentry>
2541 <term>
2542 <option>LXC_ROOTFS_MOUNT</option>
2543 </term>
2544 <listitem>
2545 <para>
2546 The mount location to which the container is initially bound.
2547 This will be the host relative path to the container rootfs
2548 for the container instance being started and is where changes
2549 should be made for that instance.
2550 [<option>lxc.rootfs.mount</option>]
2551 </para>
2552 </listitem>
2553 </varlistentry>
2554 </variablelist>
2555 <variablelist>
2556 <varlistentry>
2557 <term>
2558 <option>LXC_ROOTFS_PATH</option>
2559 </term>
2560 <listitem>
2561 <para>
2562 The host relative path to the container root which has been
2563 mounted to the rootfs.mount location.
2564 [<option>lxc.rootfs.path</option>]
2565 </para>
2566 </listitem>
2567 </varlistentry>
2568 </variablelist>
2569 <variablelist>
2570 <varlistentry>
2571 <term>
2572 <option>LXC_SRC_NAME</option>
2573 </term>
2574 <listitem>
2575 <para>
2576 Only for the clone hook. Is set to the original container name.
2577 </para>
2578 </listitem>
2579 </varlistentry>
2580 </variablelist>
2581 <variablelist>
2582 <varlistentry>
2583 <term>
2584 <option>LXC_TARGET</option>
2585 </term>
2586 <listitem>
2587 <para>
2588 Only for the stop hook. Is set to "stop" for a container
2589 shutdown or "reboot" for a container reboot.
2590 </para>
2591 </listitem>
2592 </varlistentry>
2593 </variablelist>
2594 <variablelist>
2595 <varlistentry>
2596 <term>
2597 <option>LXC_CGNS_AWARE</option>
2598 </term>
2599 <listitem>
2600 <para>
2601 If unset, then this version of lxc is not aware of cgroup
2602 namespaces. If set, it will be set to 1, and lxc is aware
2603 of cgroup namespaces. Note this does not guarantee that
2604 cgroup namespaces are enabled in the kernel. This is used
2605 by the lxcfs mount hook.
2606 </para>
2607 </listitem>
2608 </varlistentry>
2609 </variablelist>
2610 </refsect2>
2611 <refsect2>
2612 <title>Logging</title>
2613 <para>
2614 Logging can be configured on a per-container basis. By default,
2615 depending upon how the lxc package was compiled, container startup
2616 is logged only at the ERROR level, and logged to a file named after
2617 the container (with '.log' appended) either under the container path,
2618 or under @LOGPATH@.
2619 </para>
2620 <para>
2621 Both the default log level and the log file can be specified in the
2622 container configuration file, overriding the default behavior. Note
2623 that the configuration file entries can in turn be overridden by the
2624 command line options to <command>lxc-start</command>.
2625 </para>
2626 <variablelist>
2627 <varlistentry>
2628 <term>
2629 <option>lxc.log.level</option>
2630 </term>
2631 <listitem>
2632 <para>
2633 The level at which to log. The log level is an integer in
2634 the range of 0..8 inclusive, where a lower number means more
2635 verbose debugging. In particular 0 = trace, 1 = debug, 2 =
2636 info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 =
2637 alert, and 8 = fatal. If unspecified, the level defaults
2638 to 5 (error), so that only errors and above are logged.
2639 </para>
2640 <para>
2641 Note that when a script (such as either a hook script or a
2642 network interface up or down script) is called, the script's
2643 standard output is logged at level 1, debug.
2644 </para>
2645 </listitem>
2646 </varlistentry>
2647 <varlistentry>
2648 <term>
2649 <option>lxc.log.file</option>
2650 </term>
2651 <listitem>
2652 <para>
2653 The file to which logging info should be written.
2654 </para>
2655 </listitem>
2656 </varlistentry>
2657 <varlistentry>
2658 <term>
2659 <option>lxc.log.syslog</option>
2660 </term>
2661 <listitem>
2662 <para>
2663 Send logging info to syslog. It respects the log level defined in
2664 <command>lxc.log.level</command>. The argument should be the syslog
2665 facility to use, valid ones are: daemon, local0, local1, local2,
2666 local3, local4, local5, local5, local6, local7.
2667 </para>
2668 </listitem>
2669 </varlistentry>
2670 </variablelist>
2671 </refsect2>
2672
2673 <refsect2>
2674 <title>Autostart</title>
2675 <para>
2676 The autostart options support marking which containers should be
2677 auto-started and in what order. These options may be used by LXC tools
2678 directly or by external tooling provided by the distributions.
2679 </para>
2680
2681 <variablelist>
2682 <varlistentry>
2683 <term>
2684 <option>lxc.start.auto</option>
2685 </term>
2686 <listitem>
2687 <para>
2688 Whether the container should be auto-started.
2689 Valid values are 0 (off) and 1 (on).
2690 </para>
2691 </listitem>
2692 </varlistentry>
2693 <varlistentry>
2694 <term>
2695 <option>lxc.start.delay</option>
2696 </term>
2697 <listitem>
2698 <para>
2699 How long to wait (in seconds) after the container is
2700 started before starting the next one.
2701 </para>
2702 </listitem>
2703 </varlistentry>
2704 <varlistentry>
2705 <term>
2706 <option>lxc.start.order</option>
2707 </term>
2708 <listitem>
2709 <para>
2710 An integer used to sort the containers when auto-starting
2711 a series of containers at once. A lower value means an
2712 earlier start.
2713 </para>
2714 </listitem>
2715 </varlistentry>
2716 <varlistentry>
2717 <term>
2718 <option>lxc.monitor.unshare</option>
2719 </term>
2720 <listitem>
2721 <para>
2722 If not zero the mount namespace will be unshared from the host
2723 before initializing the container (before running any pre-start
2724 hooks). This requires the CAP_SYS_ADMIN capability at startup.
2725 Default is 0.
2726 </para>
2727 </listitem>
2728 </varlistentry>
2729 <varlistentry>
2730 <term>
2731 <option>lxc.monitor.signal.pdeath</option>
2732 </term>
2733 <listitem>
2734 <para>
2735 Set the signal to be sent to the container's init when the lxc
2736 monitor exits. By default it is set to SIGKILL which will cause
2737 all container processes to be killed when the lxc monitor process
2738 dies.
2739 To ensure that containers stay alive even if lxc monitor dies set
2740 this to 0.
2741 </para>
2742 </listitem>
2743 </varlistentry>
2744 <varlistentry>
2745 <term>
2746 <option>lxc.group</option>
2747 </term>
2748 <listitem>
2749 <para>
2750 A multi-value key (can be used multiple times) to put the
2751 container in a container group. Those groups can then be
2752 used (amongst other things) to start a series of related
2753 containers.
2754 </para>
2755 </listitem>
2756 </varlistentry>
2757 </variablelist>
2758 </refsect2>
2759
2760 <refsect2>
2761 <title>Autostart and System Boot</title>
2762 <para>
2763 Each container can be part of any number of groups or no group at all.
2764 Two groups are special. One is the NULL group, i.e. the container does
2765 not belong to any group. The other group is the "onboot" group.
2766 </para>
2767
2768 <para>
2769 When the system boots with the LXC service enabled, it will first
2770 attempt to boot any containers with lxc.start.auto == 1 that is a member
2771 of the "onboot" group. The startup will be in order of lxc.start.order.
2772 If an lxc.start.delay has been specified, that delay will be honored
2773 before attempting to start the next container to give the current
2774 container time to begin initialization and reduce overloading the host
2775 system. After starting the members of the "onboot" group, the LXC system
2776 will proceed to boot containers with lxc.start.auto == 1 which are not
2777 members of any group (the NULL group) and proceed as with the onboot
2778 group.
2779 </para>
2780
2781 </refsect2>
2782
2783 <refsect2>
2784 <title>Container Environment</title>
2785 <para>
2786 If you want to pass environment variables into the container (that
2787 is, environment variables which will be available to init and all of
2788 its descendents), you can use <command>lxc.environment</command>
2789 parameters to do so. Be careful that you do not pass in anything
2790 sensitive; any process in the container which doesn't have its
2791 environment scrubbed will have these variables available to it, and
2792 environment variables are always available via
2793 <command>/proc/PID/environ</command>.
2794 </para>
2795
2796 <para>
2797 This configuration parameter can be specified multiple times; once
2798 for each environment variable you wish to configure.
2799 </para>
2800
2801 <variablelist>
2802 <varlistentry>
2803 <term>
2804 <option>lxc.environment</option>
2805 </term>
2806 <listitem>
2807 <para>
2808 Specify an environment variable to pass into the container.
2809 Example:
2810 </para>
2811 <programlisting>
2812 lxc.environment = APP_ENV=production
2813 lxc.environment = SYSLOG_SERVER=192.0.2.42
2814 </programlisting>
2815 <para>
2816 It is possible to inherit host environment variables by setting the
2817 name of the variable without a "=" sign. For example:
2818 </para>
2819 <programlisting>
2820 lxc.environment = PATH
2821 </programlisting>
2822 </listitem>
2823 </varlistentry>
2824 </variablelist>
2825 </refsect2>
2826
2827 </refsect1>
2828
2829 <refsect1>
2830 <title>Examples</title>
2831 <para>
2832 In addition to the few examples given below, you will find
2833 some other examples of configuration file in @DOCDIR@/examples
2834 </para>
2835 <refsect2>
2836 <title>Network</title>
2837 <para>This configuration sets up a container to use a veth pair
2838 device with one side plugged to a bridge br0 (which has been
2839 configured before on the system by the administrator). The
2840 virtual network device visible in the container is renamed to
2841 eth0.</para>
2842 <programlisting>
2843 lxc.uts.name = myhostname
2844 lxc.net.0.type = veth
2845 lxc.net.0.flags = up
2846 lxc.net.0.link = br0
2847 lxc.net.0.name = eth0
2848 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
2849 lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255
2850 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
2851 </programlisting>
2852 </refsect2>
2853
2854 <refsect2>
2855 <title>UID/GID mapping</title>
2856 <para>This configuration will map both user and group ids in the
2857 range 0-9999 in the container to the ids 100000-109999 on the host.
2858 </para>
2859 <programlisting>
2860 lxc.idmap = u 0 100000 10000
2861 lxc.idmap = g 0 100000 10000
2862 </programlisting>
2863 </refsect2>
2864
2865 <refsect2>
2866 <title>Control group</title>
2867 <para>This configuration will setup several control groups for
2868 the application, cpuset.cpus restricts usage of the defined cpu,
2869 cpus.share prioritize the control group, devices.allow makes
2870 usable the specified devices.</para>
2871 <programlisting>
2872 lxc.cgroup.cpuset.cpus = 0,1
2873 lxc.cgroup.cpu.shares = 1234
2874 lxc.cgroup.devices.deny = a
2875 lxc.cgroup.devices.allow = c 1:3 rw
2876 lxc.cgroup.devices.allow = b 8:0 rw
2877 </programlisting>
2878 </refsect2>
2879
2880 <refsect2>
2881 <title>Complex configuration</title>
2882 <para>This example show a complex configuration making a complex
2883 network stack, using the control groups, setting a new hostname,
2884 mounting some locations and a changing root file system.</para>
2885 <programlisting>
2886 lxc.uts.name = complex
2887 lxc.net.0.type = veth
2888 lxc.net.0.flags = up
2889 lxc.net.0.link = br0
2890 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
2891 lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255
2892 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
2893 lxc.net.0.ipv6.address = 2003:db8:1:0:214:5432:feab:3588
2894 lxc.net.1.type = macvlan
2895 lxc.net.1.flags = up
2896 lxc.net.1.link = eth0
2897 lxc.net.1.hwaddr = 4a:49:43:49:79:bd
2898 lxc.net.1.ipv4.address = 10.2.3.4/24
2899 lxc.net.1.ipv4.address = 192.168.10.125/24
2900 lxc.net.1.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596
2901 lxc.net.2.type = phys
2902 lxc.net.2.flags = up
2903 lxc.net.2.link = dummy0
2904 lxc.net.2.hwaddr = 4a:49:43:49:79:ff
2905 lxc.net.2.ipv4.address = 10.2.3.6/24
2906 lxc.net.2.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297
2907 lxc.cgroup.cpuset.cpus = 0,1
2908 lxc.cgroup.cpu.shares = 1234
2909 lxc.cgroup.devices.deny = a
2910 lxc.cgroup.devices.allow = c 1:3 rw
2911 lxc.cgroup.devices.allow = b 8:0 rw
2912 lxc.mount.fstab = /etc/fstab.complex
2913 lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
2914 lxc.rootfs.path = dir:/mnt/rootfs.complex
2915 lxc.cap.drop = sys_module mknod setuid net_raw
2916 lxc.cap.drop = mac_override
2917 </programlisting>
2918 </refsect2>
2919
2920 </refsect1>
2921
2922 <refsect1>
2923 <title>See Also</title>
2924 <simpara>
2925 <citerefentry>
2926 <refentrytitle><command>chroot</command></refentrytitle>
2927 <manvolnum>1</manvolnum>
2928 </citerefentry>,
2929
2930 <citerefentry>
2931 <refentrytitle><command>pivot_root</command></refentrytitle>
2932 <manvolnum>8</manvolnum>
2933 </citerefentry>,
2934
2935 <citerefentry>
2936 <refentrytitle><filename>fstab</filename></refentrytitle>
2937 <manvolnum>5</manvolnum>
2938 </citerefentry>,
2939
2940 <citerefentry>
2941 <refentrytitle><filename>capabilities</filename></refentrytitle>
2942 <manvolnum>7</manvolnum>
2943 </citerefentry>
2944 </simpara>
2945 </refsect1>
2946
2947 &seealso;
2948
2949 <refsect1>
2950 <title>Author</title>
2951 <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
2952 </refsect1>
2953
2954 </refentry>
2955
2956 <!-- Keep this comment at the end of the file
2957 Local variables:
2958 mode: sgml
2959 sgml-omittag:t
2960 sgml-shorttag:t
2961 sgml-minimize-attributes:nil
2962 sgml-always-quote-attributes:t
2963 sgml-indent-step:2
2964 sgml-indent-data:t
2965 sgml-parent-document:nil
2966 sgml-default-dtd-file:nil
2967 sgml-exposed-tags:nil
2968 sgml-local-catalogs:nil
2969 sgml-local-ecat-files:nil
2970 End:
2971 -->