Debian Codegraph @

doc/ja/lxc.container.conf.sgml.in

raw
1 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
2
3 <!DOCTYPE refentry PUBLIC @docdtd@ [
4
5 <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
6 ]>
7
8 <refentry>
9
10 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
11
12 <refmeta>
13 <refentrytitle>lxc.container.conf</refentrytitle>
14 <manvolnum>5</manvolnum>
15 </refmeta>
16
17 <refnamediv>
18 <refname>lxc.container.conf</refname>
19
20 <refpurpose>
21 <!--
22 LXC container configuration file
23 -->
24 LXC コンテナ設定ファイル
25 </refpurpose>
26 </refnamediv>
27
28 <refsect1>
29 <title><!-- Description -->説明</title>
30
31 <para>
32 <!--
33 LXC is the well-known and heavily tested low-level Linux container
34 runtime. It is in active development since 2008 and has proven itself in
35 critical production environments world-wide. Some of its core contributors
36 are the same people that helped to implement various well-known
37 containerization features inside the Linux kernel.
38 -->
39 LXC は良く知られた、多くのテストが行われた Linux コンテナのランタイムです。LXC は、2008 年以来アクティブに開発されており、世界中の重要な本番環境で実証されています。開発への貢献者の中には、Linux カーネル内の良く知られた様々なコンテナ機能の実装に貢献した人と同じ人もいます。
40 </para>
41
42 <para>
43 <!--
44 LXC's main focus is system containers. That is, containers which offer an
45 environment as close as possible as the one you'd get from a VM but
46 without the overhead that comes with running a separate kernel and
47 simulating all the hardware.
48 -->
49 LXC は主にシステムコンテナにフォーカスを当てています。つまり、VM で得られる環境と可能な限り近い環境を提供を提供するにも関わらず、別々のカーネルを実行したり、ハードウェアをすべてシミュレートしたりすることによるオーバーヘッドがないコンテナのことです。
50 </para>
51
52 <para>
53 <!--
54 This is achieved through a combination of kernel security features such as
55 namespaces, mandatory access control and control groups.
56 -->
57 このような環境は、名前空間 (namespace)、強制アクセスコントロール、cgroup といったカーネルのセキュリティ機能の組み合わせで実現しています。
58 </para>
59
60 <para>
61 <!--
62 LXC has supports unprivileged containers. Unprivileged containers are
63 containers that are run without any privilege. This requires support for
64 user namespaces in the kernel that the container is run on. LXC was the
65 first runtime to support unprivileged containers after user namespaces
66 were merged into the mainline kernel.
67 -->
68 LXC は非特権コンテナをサポートしています。非特権コンテナは、いかなる特権も持たずに実行するコンテナです。非特権コンテナの実行には、コンテナを実行しているカーネルにユーザ名前空間 (user namespace) のサポートが必要です。LXC は、ユーザ名前空間がメインラインカーネルにマージされてから、初めて非特権コンテナをサポートしたランタイムです。
69 </para>
70
71 <para>
72 <!--
73 In essence, user namespaces isolate given sets of UIDs and GIDs. This is
74 achieved by establishing a mapping between a range of UIDs and GIDs on the
75 host to a different (unprivileged) range of UIDs and GIDs in the
76 container. The kernel will translate this mapping in such a way that
77 inside the container all UIDs and GIDs appear as you would expect from the
78 host whereas on the host these UIDs and GIDs are in fact unprivileged. For
79 example, a process running as UID and GID 0 inside the container might
80 appear as UID and GID 100000 on the host. The implementation and working
81 details can be gathered from the corresponding user namespace man page.
82 UID and GID mappings can be defined with the <option>lxc.idmap</option>
83 key.
84 -->
85 本質的には、ユーザ名前空間は与えられた UID、GID の組を隔離します。ユーザ名前空間は、ホスト上の UID、GID のある範囲を、それとは異なるコンテナ上の UID、GID の範囲へマッピングすることで実現します。カーネルは、ホスト上では実際には UID、GID は特権を持たないにも関わらず、コンテナ内ではすべての UID、GID が期待されるように見えるように変換を行います。
86 例えば、コンテナ内では UID、GID が 0 として実行中のプロセスは、ホスト上では UID、GID が 100000 として見えるでしょう。実装と動作の詳細は、ユーザ名前空間の man ページから得られます。UID と GID のマッピングは <option>lxc.idmap</option> を使って定義できます。
87 </para>
88
89 <para>
90 <!--
91 Linux containers are defined with a simple configuration file. Each
92 option in the configuration file has the form <command>key =
93 value</command> fitting in one line. The "#" character means the line is a
94 comment. List options, like capabilities and cgroups options, can be used
95 with no value to clear any previously defined values of that option.
96 -->
97 Linux コンテナは、簡単な設定ファイルで定義します。設定ファイル中のオプションは <command>key = value</command> の形で一行で表します。'#' は、その行はコメントであることを示します。ケーパビリティや cgroup のオプションのような、リスト形式で指定するオプションでは、value がない形式で指定でき、そのように使うと、それ以前に定義した値をすべてクリアします。
98 </para>
99
100 <para>
101 <!--
102 LXC namespaces configuration keys by using 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 -->
108 LXC は、シングルドットを使って設定キーの名前空間を表します。<option>lxc.net.0</option> のような複雑な設定キーは、<option>lxc.net.0.type</option>、<option>lxc.net.0.link</option>、<option>lxc.net.0.ipv6.address</option> や、さらに細分化された設定向けの色々なサブキーを持つことを意味します。
109 </para>
110
111 <refsect2>
112 <title><!-- Configuration -->設定</title>
113 <para>
114 <!--
115 In order to ease administration of multiple related containers, it is
116 possible to have a container configuration file cause another file to be
117 loaded. For instance, network configuration can be defined in one common
118 file which is included by multiple containers. Then, if the containers
119 are moved to another host, only one file may need to be updated.
120 -->
121 複数の関係するコンテナの管理を容易にするために、コンテナの設定ファイルに別のファイルをロードすることが可能です。
122 例えば、ネットワークの設定を、複数のコンテナから include させるように 1 つのファイルに定義することが可能です。
123 その場合、コンテナが他のホストに移動すると、そのファイルだけを更新する必要があるかもしれません。
124 </para>
125
126 <variablelist>
127 <varlistentry>
128 <term>
129 <option>lxc.include</option>
130 </term>
131 <listitem>
132 <para>
133 <!--
134 Specify the file to be included. The included file must be
135 in the same valid lxc configuration file format.
136 -->
137 include させたいファイルを指定します。
138 include するファイルは、lxc 設定ファイルのフォーマットとして有効でなければいけません。
139 </para>
140 </listitem>
141 </varlistentry>
142 </variablelist>
143 </refsect2>
144
145 <refsect2>
146 <title><!-- Architecture -->アーキテクチャ</title>
147 <para>
148 <!--
149 Allows one to set the architecture for the container. For example, set a
150 32bits architecture for a container running 32bits binaries on a 64bits
151 host. This fixes the container scripts which rely on the architecture to
152 do some work like downloading the packages.
153 -->
154 コンテナに対してアーキテクチャを設定することが可能です。
155 例えば、64 ビットのホスト上で 32 ビットのバイナリを動かすために 32 ビットアーキテクチャを設定することが可能です。
156 この設定を行うことにより、パッケージのダウンロードを行うなどの作業のうち、アーキテクチャ名に依存するような作業を行うコンテナスクリプトの修正を行います。
157 </para>
158
159 <variablelist>
160 <varlistentry>
161 <term>
162 <option>lxc.arch</option>
163 </term>
164 <listitem>
165 <para>
166 <!--
167 Specify the architecture for the container.
168 -->
169 コンテナに設定するアーキテクチャを指定します。
170 </para>
171 <para>
172 <!--
173 Some valid options are
174 <option>x86</option>,
175 <option>i686</option>,
176 <option>x86_64</option>,
177 <option>amd64</option>
178 -->
179 有効なオプションには以下のようなものがあります。
180 <option>x86</option>,
181 <option>i686</option>,
182 <option>x86_64</option>,
183 <option>amd64</option>
184 </para>
185 </listitem>
186 </varlistentry>
187 </variablelist>
188
189 </refsect2>
190
191 <refsect2>
192 <title><!-- Hostname -->ホスト名</title>
193 <para>
194 <!--
195 The utsname section defines the hostname to be set for the container.
196 That means the container can set its own hostname without changing the
197 one from the system. That makes the hostname private for the container.
198 -->
199 utsname セクションは、コンテナに設定されるホスト名を定義します。
200 コンテナは、システムのホスト名を変えることなく、自身のホスト名を持つ事が可能です。
201 このことにより、ホスト名はコンテナ専用となります。
202 </para>
203 <variablelist>
204 <varlistentry>
205 <term>
206 <option>lxc.uts.name</option>
207 </term>
208 <listitem>
209 <para>
210 <!--
211 specify the hostname for the container
212 -->
213 コンテナのホスト名を指定します。
214 </para>
215 </listitem>
216 </varlistentry>
217 </variablelist>
218 </refsect2>
219
220 <refsect2>
221 <title><!-- Halt signal -->クリーンなシャットダウン時のシグナル</title>
222 <para>
223 <!--
224 Allows one to specify signal name or number sent to the container's
225 init process to cleanly shutdown the container. Different init systems
226 could use different signals to perform clean shutdown sequence. This
227 option allows the signal to be specified in kill(1) fashion, e.g.
228 SIGPWR, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal is
229 SIGPWR.
230 -->
231 コンテナをクリーンにシャットダウンするためにコンテナの init プロセスに送るシグナル名か番号を指定できます。init システムによって、クリーンなシャットダウンを行うために使うシグナルは異なります。このオプションではシグナルとして kill(1) で使う形式を指定できます。
232 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGPWR です。
233 </para>
234 <variablelist>
235 <varlistentry>
236 <term>
237 <option>lxc.signal.halt</option>
238 </term>
239 <listitem>
240 <para>
241 <!--
242 specify the signal used to halt the container
243 -->
244 コンテナをシャットダウンするために使うシグナルを指定します。
245 </para>
246 </listitem>
247 </varlistentry>
248 </variablelist>
249 </refsect2>
250
251 <refsect2>
252 <title>リブート時のシグナル <!-- Reboot signal --></title>
253 <para>
254 <!--
255 Allows one to specify signal name or number to reboot the container.
256 This option allows signal to be specified in kill(1) fashion, e.g.
257 SIGTERM, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal
258 is SIGINT.
259 -->
260 コンテナをリブートするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。
261 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGINT です。
262 </para>
263 <variablelist>
264 <varlistentry>
265 <term>
266 <option>lxc.signal.reboot</option>
267 </term>
268 <listitem>
269 <para>
270 <!--
271 specify the signal used to reboot the container
272 -->
273 コンテナをリブートするために使うシグナルを指定します。
274 </para>
275 </listitem>
276 </varlistentry>
277 </variablelist>
278 </refsect2>
279
280 <refsect2>
281 <title><!-- Stop signal -->強制停止時のシグナル</title>
282 <para>
283 <!--
284 Allows one to specify signal name or number to forcibly shutdown the
285 container. This option allows signal to be specified in kill(1) fashion,
286 e.g. SIGKILL, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default
287 signal is SIGKILL.
288 -->
289 コンテナを強制的にシャットダウンするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。
290 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGKILL です。
291 </para>
292 <variablelist>
293 <varlistentry>
294 <term>
295 <option>lxc.signal.stop</option>
296 </term>
297 <listitem>
298 <para>
299 <!--
300 specify the signal used to stop the container
301 -->
302 コンテナを停止するのに使用するシグナルを指定します。
303 </para>
304 </listitem>
305 </varlistentry>
306 </variablelist>
307 </refsect2>
308
309 <refsect2>
310 <title><!-- Init command -->Init コマンド</title>
311 <para>
312 <!--
313 Sets the command to use as the init system for the containers.
314 -->
315 コンテナの init として使うコマンドを設定します。
316 </para>
317 <variablelist>
318 <varlistentry>
319 <term>
320 <option>lxc.execute.cmd</option>
321 </term>
322 <listitem>
323 <para>
324 <!--
325 Absolute path from container rootfs to the binary to run by default. This
326 mostly makes sense for lxc-execute.
327 -->
328 デフォルトで実行するバイナリのコンテナの root からの絶対パスを指定します。これは <command>lxc-execute</command> のための設定です。
329 </para>
330 </listitem>
331 </varlistentry>
332 </variablelist>
333 <variablelist>
334 <varlistentry>
335 <term>
336 <option>lxc.init.cmd</option>
337 </term>
338 <listitem>
339 <para>
340 <!--
341 Absolute path from container rootfs to the binary to use as init. This
342 mostly makes sense for lxc-start. Default is /sbin/init.
343 -->
344 init として使うバイナリの、コンテナの root からの絶対パスを指定します。これは <command>lxc-start</command> のための設定です。デフォルトは <command>/sbin/init</command> です。
345 </para>
346 </listitem>
347 </varlistentry>
348 </variablelist>
349 </refsect2>
350
351 <refsect2>
352 <title>Init のワーキングディレクトリ <!-- Init working directory --></title>
353 <para>
354 <!--
355 Sets the absolute path inside the container as the working directory for the containers.
356 LXC will switch to this directory before executing init.
357 -->
358 コンテナのワーキングディレクトリとして、コンテナ内の絶対パスを設定します。LXC は init を実行する前に、このディレクトリに移動します。
359 </para>
360 <variablelist>
361 <varlistentry>
362 <term>
363 <option>lxc.init.cwd</option>
364 </term>
365 <listitem>
366 <para>
367 <!--
368 Absolute path inside the container to use as the working directory.
369 -->
370 ワーキングディレクトリとして使うコンテナ内の絶対パス
371 </para>
372 </listitem>
373 </varlistentry>
374 </variablelist>
375 </refsect2>
376
377 <refsect2>
378 <title><!-- Init ID -->Init が使う ID</title>
379 <para>
380 <!--
381 Sets the UID/GID to use for the init system, and subsequent commands.
382 Note that using a non-root uid when booting a system container will
383 likely not work due to missing privileges. Setting the UID/GID is mostly
384 useful when running application container.
385
386 Defaults to: UID(0), GID(0)
387 -->
388 init と後続のコマンドが使う UID/GID を設定します。システムコンテナを起動するのに非 root な UID を使うと、特権がないために動作しないでしょう。UID/GID の指定は、通常はアプリケーションコンテナの動作の際に役に立ちます。
389
390 デフォルト値: UID(0)、GID(0)
391 </para>
392 <variablelist>
393 <varlistentry>
394 <term>
395 <option>lxc.init.uid</option>
396 </term>
397 <listitem>
398 <para>
399 <!--
400 UID to use for init.
401 -->
402 init が使う UID です。
403 </para>
404 </listitem>
405 </varlistentry>
406 <varlistentry>
407 <term>
408 <option>lxc.init.gid</option>
409 </term>
410 <listitem>
411 <para>
412 <!--
413 GID to use for init.
414 -->
415 init が使う GID です。
416 </para>
417 </listitem>
418 </varlistentry>
419 </variablelist>
420 </refsect2>
421
422 <refsect2>
423 <title><!-- Core Scheduling -->コアスケジューリング</title>
424 <para>
425 <!--
426 Core scheduling defines if the container payload
427 is marked as being schedulable on the same core. Doing so will cause
428 the kernel scheduler to ensure that tasks that are not in the same
429 group never run simultaneously on a core. This can serve as an extra
430 security measure to prevent the container payload from using
431 cross hyper thread attacks.
432 -->
433 コアスケジューリングは、コンテナのペイロードが同じコアでスケジュール可能であるとマークするかどうかを指定します。
434 これによりカーネルスケジューラーは、同じグループに属さないタスクが同一コア上で同時に実行されないようにします。
435 これは、コンテナペイロードがクロスハイパースレッド攻撃を受けることを防ぐための、追加のセキュリティ対策として機能させることができます。
436 </para>
437 <variablelist>
438 <varlistentry>
439 <term>
440 <option>lxc.sched.core</option>
441 </term>
442 <listitem>
443 <para>
444 <!--
445 The only allowed values are 0 and 1. Set this to 1 to create a
446 core scheduling domain for the container or 0 to not create one.
447 If not set explicitly no core scheduling domain will be created
448 for the container.
449 -->
450 0 または 1 のみ指定できます。1 を設定すると、コンテナに対するコアスケジューリングドメインを作成し、0 を設定すると作成しません。
451 明示的に指定していない場合は、コンテナに対するコアスケジューリングドメインは作成されません。
452 </para>
453 </listitem>
454 </varlistentry>
455 </variablelist>
456 </refsect2>
457
458 <refsect2>
459 <title>Proc</title>
460 <para>
461 <!--
462 Configure proc filesystem for the container.
463 -->
464 コンテナ内の proc ファイルシステムで設定できるパラメータを設定します。
465 </para>
466 <variablelist>
467 <varlistentry>
468 <term>
469 <option>lxc.proc.[proc file name]</option>
470 </term>
471 <listitem>
472 <para>
473 <!--
474 Specify the proc file name to be set. The file name available
475 are those listed under /proc/PID/.
476 Example:
477 -->
478 設定したい proc ファイルシステムのファイル名を指定します。指定できるファイル名は /proc/PID/ 以下に存在するものです。
479 例:
480 </para>
481 <programlisting>
482 lxc.proc.oom_score_adj = 10
483 </programlisting>
484 </listitem>
485 </varlistentry>
486 </variablelist>
487 </refsect2>
488
489 <refsect2>
490 <title><!-- Ephemeral -->一時的なコンテナ</title>
491 <para>
492 <!--
493 Allows one to specify whether a container will be destroyed on shutdown.
494 -->
495 シャットダウン後にコンテナを削除するかどうかを指定できます。
496 </para>
497 <variablelist>
498 <varlistentry>
499 <term>
500 <option>lxc.ephemeral</option>
501 </term>
502 <listitem>
503 <para>
504 <!--
505 The only allowed values are 0 and 1. Set this to 1 to destroy a
506 container on shutdown.
507 -->
508 指定できる値は 0 または 1 のみです。この値を 1 に設定すると、シャットダウン後にコンテナを削除します。
509 </para>
510 </listitem>
511 </varlistentry>
512 </variablelist>
513 </refsect2>
514
515 <refsect2>
516 <title><!-- Network -->ネットワーク</title>
517 <para>
518 <!--
519 The network section defines how the network is virtualized in
520 the container. The network virtualization acts at layer
521 two. In order to use the network virtualization, parameters
522 must be specified to define the network interfaces of the
523 container. Several virtual interfaces can be assigned and used
524 in a container even if the system has only one physical
525 network interface.
526 -->
527 ネットワークセクションは、コンテナ内でどのようにネットワークを仮想化するかを定義します。
528 ネットワークの仮想化はレイヤー 2 で作動します。
529 ネットワークの仮想化を使用するためには、コンテナのネットワークインターフェースを定義しなければなりません。
530 いくつかの仮想インターフェースをアサインすることができます。
531 そして、仮に物理ネットワークインターフェースが一つしかなくても、コンテナ内でいくつもの仮想インターフェースを使うことができます。
532 </para>
533 <variablelist>
534 <varlistentry>
535 <term>
536 <option>lxc.net</option>
537 </term>
538 <listitem>
539 <para>
540 <!--
541 may be used without a value to clear all previous network options.
542 -->
543 値を指定せずに使い、それ以前に定義されたすべてのネットワークオプションをクリアできます。
544 </para>
545 </listitem>
546 </varlistentry>
547 <varlistentry>
548 <term>
549 <option>lxc.net.[i].type</option>
550 </term>
551 <listitem>
552 <para>
553 <!--
554 specify what kind of network virtualization to be used
555 for the container.
556 Must be specified before any other option(s) on the net device.
557 Multiple networks can be specified by using an additional index
558 <option>i</option>
559 after all <option>lxc.net.*</option> keys. For example,
560 <option>lxc.net.0.type = veth</option> and
561 <option>lxc.net.1.type = veth</option> specify two different
562 networks of the same type. All keys sharing the same index
563 <option>i</option> will be treated as belonging to the same
564 network. For example, <option>lxc.net.0.link = br0</option>
565 will belong to <option>lxc.net.0.type</option>.
566 Currently, the different virtualization types can be:
567 -->
568 コンテナがどの種類のネットワーク仮想化を使うかを指定します。ネットワークデバイスの他のオプションを設定する前に指定しなければいけません。
569 すべての <option>lxc.net.*</option> キーに、追加のインデックス <option>i</option> を使うと、複数のネットワークを指定できます。例えば、<option>lxc.net.0.type = veth</option> と <option>lxc.net.1.type = veth</option> は、同じタイプの異なるネットワークを 2 つ指定します。
570 同じインデックスを指定したキーはすべて同じネットワークの指定になります。例えば、<option>lxc.net.0.link = br0</option> は <option>lxc.net.0.type</option> と同じネットワークの設定になります。
571 現時点では、以下のネットワーク仮想化のタイプが使えます:
572 </para>
573
574 <para>
575 <!--
576 <option>empty:</option> will create only the loopback
577 interface.
578 -->
579 <option>empty:</option> ループバックインターフェースだけを作成します。
580 </para>
581
582 <para>
583 <!--
584 <option>veth:</option> a virtual ethernet pair
585 device is created with one side assigned to the container
586 and the other side on the host.
587 <option>lxc.net.[i].veth.mode</option> specifies the
588 mode the veth parent will use on the host.
589 The accepted modes are <option>bridge</option> and <option>router</option>.
590 The mode defaults to bridge if not specified.
591 In <option>bridge</option> mode the host side is attached to a bridge specified by
592 the <option>lxc.net.[i].link</option> option.
593 If the bridge link is not specified, then the veth pair device
594 will be created but not attached to any bridge.
595 Otherwise, the bridge has to be created on the system
596 before starting the container.
597 <command>lxc</command> won't handle any
598 configuration outside of the container.
599 In <option>router</option> mode static routes are created on the host for the
600 container's IP addresses pointing to the host side veth interface.
601 Additionally Proxy ARP and Proxy NDP entries are added on the host side veth interface
602 for the gateway IPs defined in the container to allow the container to reach the host.
603 By default, <command>lxc</command> chooses a name for the
604 network device belonging to the outside of the
605 container, but if you wish to handle
606 this name yourselves, you can tell <command>lxc</command>
607 to set a specific name with
608 the <option>lxc.net.[i].veth.pair</option> option (except for
609 unprivileged containers where this option is ignored for security
610 reasons).
611
612 Static routes can be added on the host pointing to the container using the
613 <option>lxc.net.[i].veth.ipv4.route</option> and
614 <option>lxc.net.[i].veth.ipv6.route</option> options.
615 Several lines specify several routes.
616 The route is in format x.y.z.t/m, eg. 192.168.1.0/24.
617
618 In <option>bridge</option> mode untagged VLAN membership can be set with the
619 <option>lxc.net.[i].veth.vlan.id</option> option. It accepts a special value of 'none' indicating
620 that the container port should be removed from the bridge's default untagged VLAN.
621 The <option>lxc.net.[i].veth.vlan.tagged.id</option> option can be specified multiple times to set
622 the container's bridge port membership to one or more tagged VLANs.
623 -->
624 <option>veth:</option> 一方がコンテナに、もう一方がホストに接続されるペアの仮想イーサネットデバイスを作成します。
625 <option>lxc.net.[i].veth.mode</option> は、veth の親(ホスト側)がホスト上で使うモードを指定します。
626 指定できるモードは <option>bridge</option> と <option>router</option> です。
627 指定しない場合のデフォルトのモードは bridge です。
628 <option>bridge</option> モードでは、ホスト側は、<option>lxc.net.[i].link</option> オプションで指定したブリッジに接続されます。
629 もし、ブリッジが指定されていない場合、veth ペアデバイスは作成されますが、ブリッジには接続されません。
630 ブリッジはコンテナが開始する前にシステムで事前に設定しておく必要があります。
631 <command>lxc</command> はコンテナ外の設定を扱うことはありません。
632 <option>router</option> モードでは、ホスト側の veth インターフェースを指すコンテナの IP アドレスに対して、ホスト上でスタティックルートが作成されます。
633 加えて、コンテナがホストに到達できるために、コンテナ内で定義されたゲートウェイの IP アドレスに対して、Proxy ARP と Proxy NDP エントリがホスト側の veth インターフェースに追加されます。
634 デフォルトでは、<command>lxc</command> がコンテナの外部に属するネットワークデバイスに対する名前を決定します。
635 しかし、もしこの名前を自分で指定したい場合、<option>lxc.net.[i].veth.pair</option> オプションを使って名前を設定し、lxc に対して指定をすることができます (非特権コンテナの場合をのぞきます。セキュリティ上の理由からこのオプションは無視されます)。
636
637 <option>lxc.net.[i].veth.ipv4.route</option>、<option>lxc.net.[i].veth.ipv6.route</option> オプションを使って、静的ルーティングをコンテナを指し示すホスト上に追加できます。
638 複数のルートがある場合は複数の設定を指定します。
639 ルートは x.y.z.t/m の形式です。例: 192.168.1.0/24
640
641 <option>bridge</option> モードでは、タグなし VLAN は <option>lxc.net.[i].veth.vlan.id</option> で設定できます。このオプションでは、コンテナポートをブリッジのデフォルトのタグなし VLAN から削除するための特別な値 'none' が指定できます。コンテナのブリッジポートを複数のタグ付き VLAN に所属させるために、<option>lxc.net.[i].veth.vlan.tagged.id</option> を複数回指定できます。
642 </para>
643
644 <para>
645 <!--
646 <option>vlan:</option> a vlan interface is linked with
647 the interface specified by
648 the <option>lxc.net.[i].link</option> and assigned to
649 the container. The vlan identifier is specified with the
650 option <option>lxc.net.[i].vlan.id</option>.
651 -->
652 <option>vlan:</option> vlan インターフェースは <option>lxc.net.[i].link</option> で指定されたインターフェースとリンクし、コンテナに割り当てられます。
653 vlan の指定は <option>lxc.net.[i].vlan.id</option> オプションで指定します。
654 </para>
655
656 <para>
657 <!--
658 <option>macvlan:</option> a macvlan interface is linked
659 with the interface specified by
660 the <option>lxc.net.[i].link</option> and assigned to
661 the container.
662 <option>lxc.net.[i].macvlan.mode</option> specifies the
663 mode the macvlan will use to communicate between
664 different macvlan on the same upper device. The accepted
665 modes are <option>private</option>, <option>vepa</option>,
666 <option>bridge</option> and <option>passthru</option>.
667 In <option>private</option> mode, the device never
668 communicates with any other device on the same upper_dev (default).
669 In <option>vepa</option> mode, the new Virtual Ethernet Port
670 Aggregator (VEPA) mode, it assumes that the adjacent
671 bridge returns all frames where both source and
672 destination are local to the macvlan port, i.e. the
673 bridge is set up as a reflective relay. Broadcast
674 frames coming in from the upper_dev get flooded to all
675 macvlan interfaces in VEPA mode, local frames are not
676 delivered locally. In <option>bridge</option> mode, it
677 provides the behavior of a simple bridge between
678 different macvlan interfaces on the same port. Frames
679 from one interface to another one get delivered directly
680 and are not sent out externally. Broadcast frames get
681 flooded to all other bridge ports and to the external
682 interface, but when they come back from a reflective
683 relay, we don't deliver them again. Since we know all
684 the MAC addresses, the macvlan bridge mode does not
685 require learning or STP like the bridge module does. In
686 <option>passthru</option> mode, all frames received by
687 the physical interface are forwarded to the macvlan
688 interface. Only one macvlan interface in <option>passthru</option>
689 mode is possible for one physical interface.
690 -->
691 <option>macvlan:</option> macvlan インターフェースは <option>lxc.net.[i].link</option> により指定されるインターフェースとリンクし、コンテナに割り当てられます。
692 <option>lxc.net.[i].macvlan.mode</option> でモードを指定すると、その macvlan の指定を、同じ上位デバイスで異なる macvlan 間の通信をする時に使います。
693 指定できるモードは <option>private</option>、<option>vepa</option>、<option>bridge</option>、<option>passthru</option> のいずれかです。
694 <option>private</option> モードの場合、デバイスは同じ上位デバイスの他のデバイスとの通信を行いません (デフォルト)。
695 新しい仮想イーサネットポート集約モード (Virtual Ethernet Port Aggregator (VEPA)) である <option>vepa</option> モードの場合、隣接したポートが、ソースとデスティネーションの両方が macvlan ポートに対してローカルであるフレームを全て返すと仮定します。
696 すなわち、ブリッジが reflective relay として設定されているということです。
697 上位デバイスから入ってくるブロードキャストフレームは、VEPA モードである全ての macvlan インターフェースに送りつけられます。
698 ローカルのフレームはローカルには配送されません。
699 <option>bridge</option> モードの場合、同じポートの異なる macvlan インターフェースの間のシンプルなブリッジとして動作します。
700 あるインターフェースから他のインターフェースへのフレームは、直接配送され、外部には送出されません。
701 ブロードキャストフレームは、全ての他のブリッジと外部のインターフェースに対して送られます。
702 しかし、reflective relay からフレームが返ってきたときは、再度それを配送することはしません。
703 全ての MAC アドレスを知っているので、ブリッジモジュールのように、macvlan ブリッジモードは学習や STP の必要はありません。
704 <option>passthru</option> モードの場合、物理インターフェースで受け取った全てのフレームは macvlan インターフェースに転送されます。<option>passthru</option> モードの場合、ひとつの macvlan インターフェースだけが、ひとつの物理インターフェースに対して設定できます。
705 </para>
706
707 <para>
708 <!--
709 <option>ipvlan:</option> an ipvlan interface is linked
710 with the interface specified by
711 the <option>lxc.net.[i].link</option> and assigned to
712 the container.
713 <option>lxc.net.[i].ipvlan.mode</option> specifies the
714 mode the ipvlan will use to communicate between
715 different ipvlan on the same upper device. The accepted
716 modes are <option>l3</option>, <option>l3s</option> and
717 <option>l2</option>. It defaults to <option>l3</option> mode.
718 In <option>l3</option> mode TX processing up to L3 happens on the stack instance
719 attached to the dependent device and packets are switched to the stack instance of the
720 parent device for the L2 processing and routing from that instance will be
721 used before packets are queued on the outbound device. In this mode the dependent devices
722 will not receive nor can send multicast / broadcast traffic.
723 In <option>l3s</option> mode TX processing is very similar to the L3 mode except that
724 iptables (conn-tracking) works in this mode and hence it is L3-symmetric (L3s).
725 This will have slightly less performance but that shouldn't matter since you are
726 choosing this mode over plain-L3 mode to make conn-tracking work.
727 In <option>l2</option> mode TX processing happens on the stack instance attached to
728 the dependent device and packets are switched and queued to the parent device to send
729 out. In this mode the dependent devices will RX/TX multicast and broadcast (if applicable) as well.
730 <option>lxc.net.[i].ipvlan.isolation</option> specifies the isolation mode.
731 The accepted isolation values are <option>bridge</option>,
732 <option>private</option> and <option>vepa</option>.
733 It defaults to <option>bridge</option>.
734 In <option>bridge</option> isolation mode dependent devices can cross-talk among themselves
735 apart from talking through the parent device.
736 In <option>private</option> isolation mode the port is set in private mode.
737 i.e. port won't allow cross communication between dependent devices.
738 In <option>vepa</option> isolation mode the port is set in VEPA mode.
739 i.e. port will offload switching functionality to the external entity as
740 described in 802.1Qbg.
741 -->
742 <option>ipvlan:</option> ipvlan インターフェースは <option>lxc.net.[i].link</option> により指定されるインターフェースとリンクし、コンテナに割り当てられます。
743 <option>lxc.net.[i].ipvlan.mode</option> でモードを指定すると、その ipvlan の指定を、同じ上位デバイスで異なる ipvlan 間の通信をする時に使います。
744 指定できるモードは <option>l3</option>、<option>l3s</option>、<option>l2</option> で、デフォルトは <option>l3</option> モードです。
745 <option>l3</option> モードでは、L3 までの TX (送信) 処理はスレーブデバイスにアタッチされたスタックインスタンス上で行われます。
746 そしてパケットは、L2 処理のためにマスターデバイスのスタックインスタンスにスイッチされます。このインスタンスからのルーティングは、発信デバイス上でキューに入る前に使われます。
747 このモードでは、スレーブはマルチキャスト・ブロードキャストのトラフィックを受信しませんし、送信もできません。
748 <option>l3s</option> モードは、TX (送信) 処理は L3 モードと非常に似ていますが、iptables (conn-tracking) がこのモードで動作します。
749 それゆえに L3対称 (symmetric) (L3s) です。このモードは若干パフォーマンスが低下しますが、conn-tracking (接続追跡) が動作するように、普通の L3 モードの代わりにこのモードを選んでいるので問題にはならないはずです。
750 <option>l2</option> モードでは、TX (送信) 処理はスレーブデバイスにアタッチされたスタックインスンタンス上で行われます。
751 パケットは送信のため、マスターデバイスにスイッチされ、マスターデバイス上でキューに入ります。このモードでは、スレーブはマルチキャストも(該当する場合)ブロードキャストも RX/TX (送受信) 処理します。
752
753 <option>lxc.net.[i].ipvlan.isolation</option> は隔離モードを指定します。隔離モードには <option>bridge</option>、<option>private</option>、<option>vepa</option> が指定できます。デフォルトは <option>bridge</option> モードです。
754 <option>bridge</option> 隔離モードでは、スレーブはマスターデバイス経由の通信とは別に、スレーブ同士で通信できます。
755 <option>private</option> 隔離モードでは、ポートはプライベートに設定されます。つまり、スレーブ間の通信はできません。
756 <option>vepa</option> 隔離モードでは、ポートは VEPA モードに設定されます。つまり、802.1Qbg で説明されているように、ポートはスイッチング機能を外部エンティティにオフロードします。
757 </para>
758
759 <para>
760 <!--
761 <option>phys:</option> an already existing interface
762 specified by the <option>lxc.net.[i].link</option> is
763 assigned to the container.
764 -->
765 <option>phys:</option> <option>lxc.net.[i].link</option> で指定された、すでに存在しているインターフェースがコンテナに割り当てられます。
766 </para>
767 </listitem>
768 </varlistentry>
769
770 <varlistentry>
771 <term>
772 <option>lxc.net.[i].flags</option>
773 </term>
774 <listitem>
775 <para>
776 <!--
777 Specify an action to do for the network.
778 -->
779 ネットワークに対して行うアクションを指定します。
780 </para>
781
782 <para>
783 <!--
784 <option>up:</option> activates the interface.
785 -->
786 <option>up:</option> インターフェースを起動させます。
787 </para>
788 </listitem>
789 </varlistentry>
790
791 <varlistentry>
792 <term>
793 <option>lxc.net.[i].link</option>
794 </term>
795 <listitem>
796 <para>
797 <!--
798 Specify the interface to be used for real network traffic.
799 -->
800 実際のネットワークトラフィックに使うインターフェースを指定します。
801 </para>
802 </listitem>
803 </varlistentry>
804
805 <varlistentry>
806 <term>
807 <option>lxc.net.[i].l2proxy</option>
808 </term>
809 <listitem>
810 <para>
811 <!--
812 Controls whether layer 2 IP neighbour proxy entries will be added to the
813 lxc.net.[i].link interface for the IP addresses of the container.
814 Can be set to 0 or 1. Defaults to 0.
815 When used with IPv4 addresses, the following sysctl values need to be set:
816 net.ipv4.conf.[link].forwarding=1
817 When used with IPv6 addresses, the following sysctl values need to be set:
818 net.ipv6.conf.[link].proxy_ndp=1
819 net.ipv6.conf.[link].forwarding=1
820 -->
821 レイヤ 2 IP 近隣プロキシエントリを、コンテナの IP アドレスに対応する lxc.net.[i].link インターフェースに追加するかどうかを制御します。0 か 1 が設定でき、デフォルトは 0 です。
822 IPv4 アドレスで使う場合は、次の sysctl 設定が必要です:
823 net.ipv4.conf.[link].forwarding=1
824 IPv6 アドレスで使う場合は、次の sysctl 設定が必要です:
825 net.ipv6.conf.[link].proxy_ndp=1
826 net.ipv6.conf.[link].forwarding=1
827 </para>
828 </listitem>
829 </varlistentry>
830
831 <varlistentry>
832 <term>
833 <option>lxc.net.[i].mtu</option>
834 </term>
835 <listitem>
836 <para>
837 <!--
838 Specify the maximum transfer unit for this interface.
839 -->
840 インターフェースに対する MTU を指定します。
841 </para>
842 </listitem>
843 </varlistentry>
844
845 <varlistentry>
846 <term>
847 <option>lxc.net.[i].name</option>
848 </term>
849 <listitem>
850 <para>
851 <!--
852 The interface name is dynamically allocated, but if another name
853 is needed because the configuration files being used by the
854 container use a generic name, eg. eth0, this option will rename
855 the interface in the container.
856 -->
857 インターフェース名は動的に割り当てられます。しかし、もしコンテナが使用する設定ファイルが一般的な名前を使用するために、他の特定の名前が必要であれば (例えば eth0 など)、コンテナ内のインターフェースは、このオプションで指定した名前にリネームされます。
858 </para>
859 </listitem>
860 </varlistentry>
861
862 <varlistentry>
863 <term>
864 <option>lxc.net.[i].hwaddr</option>
865 </term>
866 <listitem>
867 <para>
868 <!--
869 The interface mac address is dynamically allocated by default to
870 the virtual interface, but in some cases, this is needed to
871 resolve a mac address conflict or to always have the same
872 link-local ipv6 address. Any "x" in address will be replaced by
873 random value, this allows setting hwaddr templates.
874 -->
875 仮想インターフェースの MAC アドレスは、デフォルトでは動的に割り当てられます。しかし、MAC アドレスの衝突や、リンクローカルIPv6 アドレスを常に同じにした場合などは、このオプションが必要です。アドレス中の "x" という文字は、ランダムな値に置き換えられます。これによりテンプレートに hwaddr を設定することが可能になります。
876 </para>
877 </listitem>
878 </varlistentry>
879
880 <varlistentry>
881 <term>
882 <option>lxc.net.[i].ipv4.address</option>
883 </term>
884 <listitem>
885 <para>
886 <!--
887 Specify the ipv4 address to assign to the virtualized interface.
888 Several lines specify several ipv4 addresses. The address is in
889 format x.y.z.t/m, eg. 192.168.1.123/24.
890 You can optionally specify the broadcast address after the IP adress,
891 e.g. 192.168.1.123/24 255.255.255.255.
892 Otherwise it is automatically calculated from the IP address.
893 -->
894 仮想インターフェースに割り当てる ipv4 アドレスを指定します。複数行により複数の ipv4 アドレスを指定します。このアドレスは x.y.z.t/m というフォーマットで指定します。例) 192.168.1.123/24
895 IP アドレスのあとにオプションでブロードキャストアドレスを指定できます。例)192.168.1.123/24 255.255.255.255
896 指定しなければ IP アドレスから自動的に計算されます。
897 </para>
898 </listitem>
899 </varlistentry>
900
901 <varlistentry>
902 <term>
903 <option>lxc.net.[i].ipv4.gateway</option>
904 </term>
905 <listitem>
906 <para>
907 <!--
908 specify the ipv4 address to use as the gateway inside the
909 container. The address is in format x.y.z.t, eg. 192.168.1.123.
910
911 Can also have the special value <option>auto</option>,
912 which means to take the primary address from the bridge
913 interface (as specified by the
914 <option>lxc.net.[i].link</option> option) and use that as
915 the gateway. <option>auto</option> is only available when
916 using the <option>veth</option>,
917 <option>macvlan</option> and <option>ipvlan</option> network types.
918 Can also have the special value of <option>dev</option>,
919 which means to set the default gateway as a device route.
920 This is primarily for use with layer 3 network modes, such as IPVLAN.
921 -->
922 コンテナでゲートウェイとして使う IPv4 アドレスを指定します。アドレスは x.y.z.t というフォーマットです。例) 192.168.1.123
923 <option>auto</option> という特別な値を指定できます。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option>、<option>macvlan</option>、<option>ipvlan</option> を指定している時だけ有効となります。
924 特別な値である <option>dev</option> も設定できます。これはデバイスのルートとしてデフォルトゲートウェイを設定するという意味です。これは主に、IPVLAN のようなレイヤ 3 のネットワークモードで使用します。
925 </para>
926 </listitem>
927 </varlistentry>
928
929
930 <varlistentry>
931 <term>
932 <option>lxc.net.[i].ipv6.address</option>
933 </term>
934 <listitem>
935 <para>
936 <!--
937 Specify the ipv6 address to assign to the virtualized
938 interface. Several lines specify several ipv6 addresses. The
939 address is in format x::y/m, eg.
940 2003:db8:1:0:214:1234:fe0b:3596/64
941 -->
942 仮想インターフェースに割り当てる ipv6 アドレスを指定します。複数行により複数の ipv6 アドレスを指定します。このアドレスは x::y/m というフォーマットで指定します。例) 2003:db8:1:0:214:1234:fe0b:3596/64
943 </para>
944 </listitem>
945 </varlistentry>
946
947 <varlistentry>
948 <term>
949 <option>lxc.net.[i].ipv6.gateway</option>
950 </term>
951 <listitem>
952 <para>
953 <!--
954 Specify the ipv6 address to use as the gateway inside the
955 container. The address is in format x::y, eg. 2003:db8:1:0::1
956
957 Can also have the special value <option>auto</option>,
958 which means to take the primary address from the bridge
959 interface (as specified by the
960 <option>lxc.net.[i].link</option> option) and use that as
961 the gateway. <option>auto</option> is only available when
962 using the <option>veth</option>,
963 <option>macvlan</option> and <option>ipvlan</option> network types.
964 Can also have the special value of <option>dev</option>,
965 which means to set the default gateway as a device route.
966 This is primarily for use with layer 3 network modes, such as IPVLAN.
967 -->
968 コンテナでゲートウェイとして使う IPv6 アドレスを指定します。アドレスは x::y というフォーマットです。例) 2003:db8:1:0::1
969 <option>auto</option> という特別な値を記述する事も可能です。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option>、<option>macvlan</option>、<option>ipvlan</option> を指定している時だけ有効となります。
970 特別な値である <option>dev</option> も設定できます。これはデバイスのルートとしてデフォルトゲートウェイを設定するという意味です。これは主に、IPVLAN のようなレイヤ 3 のネットワークモードで使用します。
971 </para>
972 </listitem>
973 </varlistentry>
974
975 <varlistentry>
976 <term>
977 <option>lxc.net.[i].script.up</option>
978 </term>
979 <listitem>
980 <para>
981 <!--
982 Add a configuration option to specify a script to be
983 executed after creating and configuring the network used
984 from the host side.
985 -->
986 ホスト側から使われる、ネットワークの作成と設定が済んだ後に実行するスクリプトを指定します。
987 </para>
988
989 <para>
990 <!--
991 In addition to the information available to all hooks. The
992 following information is provided to the script:
993 -->
994 すべてのフックで追加の情報が使えます。以下の情報がスクリプトに提供されます:
995 <itemizedlist>
996 <listitem>
997 <para>
998 LXC_HOOK_TYPE: フックタイプ。'up' か 'down' のいずれかです <!-- the hook type. This is either 'up' or 'down'. -->
999 </para>
1000 </listitem>
1001
1002 <listitem>
1003 <para>
1004 LXC_HOOK_SECTION: セクションタイプとして 'net' が設定されます<!-- the section type 'net'. -->
1005 </para>
1006 </listitem>
1007
1008 <listitem>
1009 <para>
1010 LXC_NET_TYPE: ネットワークタイプ。有効なネットワークタイプのうちのひとつです (例: 'vlan', 'macvlan', 'ipvlan', 'veth') <!-- the network type. This is one of the valid
1011 network types listed here (e.g. 'vlan', 'macvlan', 'ipvlan', 'veth'). -->
1012 </para>
1013 </listitem>
1014
1015 <listitem>
1016 <para>
1017 LXC_NET_PARENT: ホスト上の親デバイス名。これはネットワークタイプが 'macvlan'、'veth'、'phys' のどれかのときだけ設定されます <!-- the parent device on the host. This is only
1018 set for network types 'mavclan', 'veth', 'phys'. -->
1019 </para>
1020 </listitem>
1021
1022 <listitem>
1023 <para>
1024 LXC_NET_PEER: ホスト上のピアデバイス名。これはネットワークタイプが 'veth' の場合のみ設定されます。この情報は <option>lxc.hook.version</option> が 1 に設定されている場合のみ設定されます
1025 <!-- the name of the peer device on the host. This is
1026 only set for 'veth' network types. Note that this information
1027 is only available when <option>lxc.hook.version</option> is set
1028 to 1. -->
1029 </para>
1030 </listitem>
1031 </itemizedlist>
1032
1033 <!--
1034 Whether this information is provided in the form of environment
1035 variables or as arguments to the script depends on the value of
1036 <option>lxc.hook.version</option>. If set to 1 then information is
1037 provided in the form of environment variables. If set to 0
1038 information is provided as arguments to the script.
1039 -->
1040 この情報が環境変数の形で提供されるか、スクリプトへの引数の形で提供されるかは <option>lxc.hook.version</option> の値によって決まります。もし <option>lxc.hook.version</option> が 1 に設定されている場合は、環境変数の形で提供されます。もし 0 が設定されている場合は、スクリプトへの引数として提供されます。
1041 </para>
1042
1043 <para>
1044 <!--
1045 Standard output from the script is logged at debug level.
1046 Standard error is not logged, but can be captured by the
1047 hook redirecting its standard error to standard output.
1048 -->
1049 スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
1050 </para>
1051 </listitem>
1052 </varlistentry>
1053
1054 <varlistentry>
1055 <term>
1056 <option>lxc.net.[i].script.down</option>
1057 </term>
1058 <listitem>
1059 <para>
1060 <!--
1061 Add a configuration option to specify a script to be
1062 executed before destroying the network used from the
1063 host side.
1064 -->
1065 ホスト側から使われる、ネットワークを破壊する前に実行するスクリプトを指定します。
1066 </para>
1067
1068 <para>
1069 <!--
1070 In addition to the information available to all hooks. The
1071 following information is provided to the script:
1072 -->
1073 すべてのフックで追加の情報が使えます。以下の情報がスクリプトに提供されます:
1074 <itemizedlist>
1075 <listitem>
1076 <para>
1077 LXC_HOOK_TYPE: フックタイプ。'up' か 'down' のいずれかです <!-- the hook type. This is either 'up' or 'down'. -->
1078 </para>
1079 </listitem>
1080
1081 <listitem>
1082 <para>
1083 LXC_HOOK_SECTION: セクションタイプとして 'net' が設定されます<!-- the section type 'net'. -->
1084 </para>
1085 </listitem>
1086
1087 <listitem>
1088 <para>
1089 LXC_NET_TYPE: ネットワークタイプ。有効なネットワークタイプのうちのひとつです (例: 'vlan', 'macvlan', 'ipvlan', 'veth') <!-- the network type. This is one of the valid
1090 network types listed here (e.g. 'vlan', 'macvlan', 'ipvlan', 'veth'). -->
1091 </para>
1092 </listitem>
1093
1094 <listitem>
1095 <para>
1096 LXC_NET_PARENT: ホスト上の親デバイス名。これはネットワークタイプが 'macvlan'、'veth'、'phys' のどれかのときだけ設定されます <!-- the parent device on the host. This is only
1097 set for network types 'mavclan', 'veth', 'phys'. -->
1098 </para>
1099 </listitem>
1100
1101 <listitem>
1102 <para>
1103 LXC_NET_PEER: ホスト上のピアデバイス名。これはネットワークタイプが 'veth' の場合のみ設定されます。この情報は <option>lxc.hook.version</option> が 1 に設定されている場合のみ設定されます
1104 <!-- the name of the peer device on the host. This is
1105 only set for 'veth' network types. Note that this information
1106 is only available when <option>lxc.hook.version</option> is set
1107 to 1. -->
1108 </para>
1109 </listitem>
1110 </itemizedlist>
1111
1112 <!--
1113 Whether this information is provided in the form of environment
1114 variables or as arguments to the script depends on the value of
1115 <option>lxc.hook.version</option>. If set to 1 then information is
1116 provided in the form of environment variables. If set to 0
1117 information is provided as arguments to the script.
1118 -->
1119 この情報が環境変数の形で提供されるか、スクリプトへの引数の形で提供されるかは <option>lxc.hook.version</option> の値によって決まります。もし <option>lxc.hook.version</option> が 1 に設定されている場合は、環境変数の形で提供されます。もし 0 が設定されている場合は、スクリプトへの引数として提供されます。
1120 </para>
1121
1122 <para>
1123 <!--
1124 Standard output from the script is logged at debug level.
1125 Standard error is not logged, but can be captured by the
1126 hook redirecting its standard error to standard output.
1127 -->
1128 スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
1129 </para>
1130 </listitem>
1131 </varlistentry>
1132 </variablelist>
1133
1134 </refsect2>
1135
1136 <refsect2>
1137 <title><!-- New pseudo tty instance (devpts) -->新しい擬似端末のインスタンス (devpts)</title>
1138 <para>
1139 <!--
1140 For stricter isolation the container can have its own private
1141 instance of the pseudo tty.
1142 -->
1143 さらに厳しい隔離のために、コンテナは自身のプライベートな pseudo tty (擬似端末) を持つことが可能です。
1144 </para>
1145 <variablelist>
1146 <varlistentry>
1147 <term>
1148 <option>lxc.pty.max</option>
1149 </term>
1150 <listitem>
1151 <para>
1152 <!--
1153 If set, the container will have a new pseudo tty
1154 instance, making this private to it. The value specifies
1155 the maximum number of pseudo ttys allowed for a pty
1156 instance (this limitation is not implemented yet).
1157 -->
1158 もし設定された場合、コンテナは新しい pseudo tty インスタンスを持ち、それを自身のプライベートとします。
1159 この値は pty インスタンスに許可される pseudo tty の最大数を指定します (この制限はまだ実装されていません)。
1160 </para>
1161 </listitem>
1162 </varlistentry>
1163 </variablelist>
1164 </refsect2>
1165
1166 <refsect2>
1167 <title><!-- Container system console -->コンテナのシステムコンソール</title>
1168 <para>
1169 <!--
1170 If the container is configured with a root filesystem and the
1171 inittab file is setup to use the console, you may want to specify
1172 where the output of this console goes.
1173 -->
1174 コンテナでルートファイルシステムを持つように設定されており、inittab ファイルでコンソールの使用が設定されている場合、このコンソールの出力がどこになされるのかを指定したいと思うでしょう。
1175 </para>
1176 <variablelist>
1177
1178 <varlistentry>
1179 <term>
1180 <option>lxc.console.buffer.size</option>
1181 </term>
1182 <listitem>
1183 <para>
1184 <!--
1185 Setting this option instructs liblxc to allocate an in-memory
1186 ringbuffer. The container's console output will be written to the
1187 ringbuffer. Note that ringbuffer must be at least as big as a
1188 standard page size. When passed a value smaller than a single page
1189 size liblxc will allocate a ringbuffer of a single page size. A page
1190 size is usually 4KB.
1191 -->
1192 このオプションを設定すると、liblxc はインメモリのリングバッファを割り当てます。コンテナのコンソールはリングバッファに出力されます。リングバッファは少なくとも標準ページサイズの大きさでなければなりません。ページサイズより小さい値を与えた場合は、liblxc はページサイズのリングバッファを割り当てます。ページサイズは通常は 4KB です。
1193
1194 <!--
1195 The keyword 'auto' will cause liblxc to allocate a ringbuffer of
1196 128KB.
1197 -->
1198 'auto' を指定すると、liblxc は 128KB のリングバッファを割り当てます。
1199
1200 <!--
1201 When manually specifying a size for the ringbuffer the value should
1202 be a power of 2 when converted to bytes. Valid size prefixes are
1203 'KB', 'MB', 'GB'. (Note that all conversions are based on multiples
1204 of 1024. That means 'Kb' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.
1205 Additionally, the case of the suffix is ignored, i.e. 'kB', 'KB' and
1206 'Kb' are treated equally.)
1207 -->
1208 リングバッファサイズを数値指定する場合、値がバイトに変換されるときに 2 の累乗になります。サイズ接頭辞付きの単位として 'KB'、'MB'、'GB' が使えます。(この場合の変換は 1024 の倍数に基づいています。つまり 'KB' == 'KiB'、'MB' == 'MiB'、'GB' == 'GiB' という意味です。加えて、単位の大文字小文字は無視されます。すなわち 'kB'、'KB'、'Kb' は同一に扱われます。)
1209 </para>
1210 </listitem>
1211 </varlistentry>
1212
1213 <varlistentry>
1214 <term>
1215 <option>lxc.console.size</option>
1216 </term>
1217 <listitem>
1218 <para>
1219 <!--
1220 Setting this option instructs liblxc to place a limit on the size of
1221 the console log file specified in
1222 <option>lxc.console.logfile</option>. Note that size of the log file
1223 must be at least as big as a standard page size. When passed a value
1224 smaller than a single page size liblxc will set the size of log file
1225 to a single page size. A page size is usually 4KB.
1226 -->
1227 liblxc は <option>lxc.console.logfile</option> で指定したコンソールログのサイズを、このオプションで設定した値に制限します。ログファイルのサイズは少なくとも標準ページサイズでなければなりません。ページサイズ以下の値を設定した場合は、liblxc はログファイルのサイズをページサイズに設定します。ページサイズは通常は 4KB です。
1228
1229 <!--
1230 The keyword 'auto' will cause liblxc to place a limit of 128KB on
1231 the log file.
1232 -->
1233 'auto' を指定すると、liblxc はログファイルのサイズを 128KB に制限します。
1234
1235 <!--
1236 When manually specifying a size for the log file the value should
1237 be a power of 2 when converted to bytes. Valid size prefixes are
1238 'KB', 'MB', 'GB'. (Note that all conversions are based on multiples
1239 of 1024. That means 'KB' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.
1240 Additionally, the case of the suffix is ignored, i.e. 'kB', 'KB' and
1241 'Kb' are treated equally.)
1242 -->
1243 ログファイルサイズの値を数値指定する場合、値がバイトに変換されるときに 2 の累乗になります。サイズ接頭辞付きの単位として 'kB'、'MB'、'GB' が使えます。(この場合の変換は 1024 の倍数に基づいています。つまり 'kB' == 'KiB'、'MB' == 'MiB'、'GB' == 'GiB' という意味です。加えて、単位の大文字小文字は無視されます。すなわち 'kB'、'KB'、'Kb' は同一に扱われます。)
1244
1245 <!--
1246 If users want to mirror the console ringbuffer on disk they should set
1247 <option>lxc.console.size</option> equal to
1248 <option>lxc.console.buffer.size</option>.
1249 -->
1250 ディスク上のコンソールリングバッファとミラーになるようにしたい場合は、<option>lxc.console.size</option> と <option>lxc.console.buffer.size</option> の値を同じ値に設定します。
1251 </para>
1252 </listitem>
1253 </varlistentry>
1254
1255 <varlistentry>
1256 <term>
1257 <option>lxc.console.logfile</option>
1258 </term>
1259 <listitem>
1260 <para>
1261 <!--
1262 Specify a path to a file where the console output will be written.
1263 Note that in contrast to the on-disk ringbuffer logfile this file
1264 will keep growing potentially filling up the users disks if not
1265 rotated and deleted. This problem can also be avoided by using the
1266 in-memory ringbuffer options
1267 <option>lxc.console.buffer.size</option> and
1268 <option>lxc.console.buffer.logfile</option>.
1269 -->
1270 コンソール出力を書き込むファイルのパスを指定します。ディスクに保存されるリングバッファログと異なり、このファイルはサイズが大きくなり続けるので、ファイルがローテートや削除されない限りは、ユーザのディスクをいっぱいにしてしまう可能性があります。この問題は、インメモリのリングバッファオプションである、<option>lxc.console.buffer.size</option> と <option>lxc.console.buffer.logfile</option> を使うことでも回避できます。
1271 </para>
1272 </listitem>
1273 </varlistentry>
1274
1275 <varlistentry>
1276 <term>
1277 <option>lxc.console.rotate</option>
1278 </term>
1279 <listitem>
1280 <para>
1281 <!--
1282 Whether to rotate the console logfile specified in
1283 <option>lxc.console.logfile</option>. Users can send an API
1284 request to rotate the logfile. Note that the old logfile will have
1285 the same name as the original with the suffix ".1" appended.
1286 -->
1287 <option>lxc.console.logfile</option> で指定したコンソールログファイルをローテートするかどうかを指定します。ユーザはログファイルをローテートするように API リクエストを送ることができます。古いログファイルは、元のファイル名と同じ名前のファイルに ".1" というサフィックスが付け加わります。
1288
1289 <!--
1290 Users wishing to prevent the console log file from filling the
1291 disk should rotate the logfile and delete it if unneeded. This
1292 problem can also be avoided by using the in-memory ringbuffer
1293 options <option>lxc.console.buffer.size</option> and
1294 <option>lxc.console.buffer.logfile</option>.
1295 -->
1296 ユーザがコンソールログでディスクがいっぱいになるのを防ぐには、ログファイルをローテートし、不要なログファイルを削除してください。この問題はインメモリのリングバッファオプションである <option>lxc.console.buffer.size</option> と <option>lxc.console.buffer.logfile</option> を使うことでも防げます。
1297 </para>
1298 </listitem>
1299 </varlistentry>
1300
1301 <varlistentry>
1302 <term>
1303 <option>lxc.console.path</option>
1304 </term>
1305 <listitem>
1306 <para>
1307 <!--
1308 Specify a path to a device to which the console will be
1309 attached. The keyword 'none' will simply disable the
1310 console. Note, when specifying 'none' and creating a device node
1311 for the console in the container at /dev/console or bind-mounting
1312 the hosts's /dev/console into the container at /dev/console the
1313 container will have direct access to the hosts's /dev/console.
1314 This is dangerous when the container has write access to the
1315 device and should thus be used with caution.
1316 -->
1317 コンソールを割り当てるデバイスのパスを指定します。'none' というキーワードは、単純にコンソールを無効にします。
1318 'none' を指定し、コンテナ内のコンソールに対するデバイスノードを /dev/console に作成するか、もしくはホストの /dev/console をコンテナ内の /dev/console に bind mount する場合、そのコンテナはホストの /dev/console へ直接アクセスを行うことに注意が必要です。
1319 そのコンテナがデバイスへの書き込み権を持っている場合は危険ですので、注意してこの指定を使用する必要があります。
1320 </para>
1321 </listitem>
1322 </varlistentry>
1323 </variablelist>
1324 </refsect2>
1325
1326 <refsect2>
1327 <title><!-- Console through the ttys -->tty を通したコンソール</title>
1328 <para>
1329 <!--
1330 This option is useful if the container is configured with a root
1331 filesystem and the inittab file is setup to launch a getty on the
1332 ttys. The option specifies the number of ttys to be available for
1333 the container. The number of gettys in the inittab file of the
1334 container should not be greater than the number of ttys specified
1335 in this option, otherwise the excess getty sessions will die and
1336 respawn indefinitely giving annoying messages on the console or in
1337 <filename>/var/log/messages</filename>.
1338 -->
1339 このオプションはコンテナが root ファイルシステムを持つように設定されており、inittab ファイルで tty 上に getty の起動が設定されている場合に役に立ちます。
1340 このオプションはコンテナで利用できる tty の数を指定します。
1341 inittab ファイルに設定する getty の数は、このオプションの指定する tty の数より大きくしてはいけません。
1342 さもなければ、超過した分の getty セッションはコンソールか /var/log/messages にうっとうしいメッセージを生死を表示しながら、永久に生死を繰り返すでしょう。
1343 </para>
1344 <variablelist>
1345 <varlistentry>
1346 <term>
1347 <option>lxc.tty.max</option>
1348 </term>
1349 <listitem>
1350 <para>
1351 <!--
1352 Specify the number of tty to make available to the
1353 container.
1354 -->
1355 コンテナに作成出来る tty の数を指定します。
1356 </para>
1357 </listitem>
1358 </varlistentry>
1359 </variablelist>
1360 </refsect2>
1361
1362 <refsect2>
1363 <title><!-- Console devices location -->コンソールデバイスの位置</title>
1364 <para>
1365 <!--
1366 LXC consoles are provided through Unix98 PTYs created on the
1367 host and bind-mounted over the expected devices in the container.
1368 By default, they are bind-mounted over <filename>/dev/console</filename>
1369 and <filename>/dev/ttyN</filename>. This can prevent package upgrades
1370 in the guest. Therefore you can specify a directory location (under
1371 <filename>/dev</filename> under which LXC will create the files and
1372 bind-mount over them. These will then be symbolically linked to
1373 <filename>/dev/console</filename> and <filename>/dev/ttyN</filename>.
1374 A package upgrade can then succeed as it is able to remove and replace
1375 the symbolic links.
1376 -->
1377 LXC のコンソールはホストによって作られ、コンテナ内で要求されたデバイスに bind マウントされた Unix98 PTY 経由で提供されます。
1378 デフォルトでは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> に bind マウントされます。
1379 これはゲスト内でのパッケージのアップグレードを妨げる可能性があります。
1380 なので <filename>/dev</filename> 以下のディレクトリを指定することができます。
1381 LXC はこのディレクトリ以下にファイルを作成し、これらのファイルを bind マウントします。
1382 そして、これらの (作成された) ファイルは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> にシンボリックリンクされます。
1383 シンボリックリンクを消去したり置き換えたりすることは可能ですから、パッケージのアップグレードは成功します。
1384 </para>
1385 <variablelist>
1386 <varlistentry>
1387 <term>
1388 <option>lxc.tty.dir</option>
1389 </term>
1390 <listitem>
1391 <para>
1392 <!--
1393 Specify a directory under <filename>/dev</filename>
1394 under which to create the container console devices. Note that LXC
1395 will move any bind-mounts or device nodes for /dev/console into
1396 this directory.
1397 -->
1398 コンテナのコンソールデバイスを作成するための <filename>/dev</filename> 以下のディレクトリを指定します。
1399 LXC は /dev/console に対する bind mount や /dev/console デバイスノードをこのディレクトリ以下に移動することに注意が必要です。
1400 </para>
1401 </listitem>
1402 </varlistentry>
1403 </variablelist>
1404 </refsect2>
1405
1406 <refsect2>
1407 <title><!-- /dev directory -->/dev ディレクトリ</title>
1408 <para>
1409 <!--
1410 By default, lxc creates a few symbolic links (fd,stdin,stdout,stderr)
1411 in the container's <filename>/dev</filename> directory but does not
1412 automatically create device node entries. This allows the container's
1413 <filename>/dev</filename> to be set up as needed in the container
1414 rootfs. If lxc.autodev is set to 1, then after mounting the container's
1415 rootfs LXC will mount a fresh tmpfs under <filename>/dev</filename>
1416 (limited to 500K by default, unless defined in lxc.autodev.tmpfs.size)
1417 and fill in a minimal set of initial devices.
1418 This is generally required when starting a container containing
1419 a "systemd" based "init" but may be optional at other times. Additional
1420 devices in the containers /dev directory may be created through the
1421 use of the <option>lxc.hook.autodev</option> hook.
1422 -->
1423 デフォルトでは、lxc はコンテナの <filename>/dev</filename> 以下に fd, stdin, stdout, stderr のシンボリックリンクを作成しますが、自動的にはデバイスノードのエントリは作成しません。
1424 これは、コンテナの rootfs で必要な設定を行えるようにするものです。
1425 lxc.autodev が 1 に設定されている場合、コンテナの rootfs をマウントした後、LXC は新しい tmpfs を <filename>/dev</filename> 以下にマウントします (デフォルトでは 500k 制限でマウント、lxc.autodev.tmpfs.size で指定可能)。
1426 そして初期デバイスの最小限のセットを作成します。
1427 これは、"systemd" ベースの "init" 環境のコンテナを起動する時に通常必要ですが、他の環境の場合はオプショナルなものです。
1428 コンテナの /dev ディレクトリ内の追加デバイスは <option>lxc.hook.autodev</option> フックを使用して作成されます。
1429 </para>
1430 <variablelist>
1431 <varlistentry>
1432 <term>
1433 <option>lxc.autodev</option>
1434 </term>
1435 <listitem>
1436 <para>
1437 <!--
1438 Set this to 0 to stop LXC from mounting and populating a minimal
1439 <filename>/dev</filename> when starting the container.
1440 -->
1441 コンテナの起動時に LXC が /dev をマウントして最小限の /dev を作成するのを止めるには、この値を 0 に設定してください。
1442 </para>
1443 </listitem>
1444 </varlistentry>
1445
1446 <varlistentry>
1447 <term>
1448 <option>lxc.autodev.tmpfs.size</option>
1449 </term>
1450 <listitem>
1451 <para>
1452 <!--
1453 Set this to define the size of the /dev tmpfs.
1454 The default value is 500000 (500K). If the parameter is used
1455 but without value, the default value is used.
1456 -->
1457 この設定で /dev tmpfs のサイズを指定します。
1458 デフォルト値は 500000 (500K) です。このパラメータを値なしで使うと、デフォルト値が使われます。
1459 </para>
1460 </listitem>
1461 </varlistentry>
1462 </variablelist>
1463 </refsect2>
1464
1465 <refsect2>
1466 <title><!-- Mount points -->マウントポイント</title>
1467 <para>
1468 <!--
1469 The mount points section specifies the different places to be
1470 mounted. These mount points will be private to the container
1471 and won't be visible by the processes running outside of the
1472 container. This is useful to mount /etc, /var or /home for
1473 examples.
1474 -->
1475 マウントポイントセクションは、マウントするための区別された場所を指定します。
1476 これらのマウントポイントは、コンテナだけに見え、コンテナ外で実行されるプロセスから見えることはありません。
1477 例えば、/etc や /var や /home をマウントするときに役に立つでしょう。
1478 </para>
1479 <para>
1480 <!--
1481 NOTE - LXC will generally ensure that mount targets and relative
1482 bind-mount sources are properly confined under the container
1483 root, to avoid attacks involving over-mounting host directories
1484 and files. (Symbolic links in absolute mount sources are ignored)
1485 However, if the container configuration first mounts a directory which
1486 is under the control of the container user, such as /home/joe, into
1487 the container at some <filename>path</filename>, and then mounts
1488 under <filename>path</filename>, then a TOCTTOU attack would be
1489 possible where the container user modifies a symbolic link under
1490 their home directory at just the right time.
1491 -->
1492 注意: 通常 LXC は、マウント対象と相対パス指定のバインドマウントを、適切にコンテナルート以下に閉じ込めます。
1493 これは、ホストのディレクトリやファイルに対して重ね合わせを行うようなマウントによる攻撃を防ぎます。(絶対パス指定のマウントソース中の各パスがシンボリックリンクである場合は無視されます。)
1494 しかし、もしコンテナの設定が最初に、/home/joe のようなコンテナユーザのコントロール配下にあるディレクトリを、コンテナ中のある <filename>path</filename> にマウントし、その後 <filename>path</filename> 以下でマウントが行われるような場合、コンテナユーザがタイミングを見計らって自身のホームディレクトリ以下でシンボリックリンクを操作するような TOCTTOU 攻撃が成立する可能性があります。
1495 </para>
1496 <variablelist>
1497 <varlistentry>
1498 <term>
1499 <option>lxc.mount.fstab</option>
1500 </term>
1501 <listitem>
1502 <para>
1503 <!--
1504 specify a file location in
1505 the <filename>fstab</filename> format, containing the
1506 mount information. The mount target location can and in
1507 most cases should be a relative path, which will become
1508 relative to the mounted container root. For instance,
1509 -->
1510 マウント情報の書かれた <filename>fstab</filename> フォーマットで書かれたファイルの場所を指定します。
1511 マウントする場所は相対バスで書くことができます。そして、ほとんどの場合にコンテナの root からの相対パスとなるはずです。例えば、以下のように書きます。
1512 </para>
1513 <programlisting>
1514 proc proc proc nodev,noexec,nosuid 0 0
1515 </programlisting>
1516 <para>
1517 <!--
1518 Will mount a proc filesystem under the container's /proc,
1519 regardless of where the root filesystem comes from. This
1520 is resilient to block device backed filesystems as well as
1521 container cloning.
1522 -->
1523 この例は、root ファイルシステムがどこにあっても、コンテナの /proc 以下に proc ファイルシステムをマウントします。これは、ブロックデバイスがバックエンドのファイルシステムだけでなく、コンテナのクローンにも柔軟に対応できます。
1524 </para>
1525 <para>
1526 <!--
1527 Note that when mounting a filesystem from an
1528 image file or block device the third field (fs_vfstype)
1529 cannot be auto as with
1530 <citerefentry>
1531 <refentrytitle>mount</refentrytitle>
1532 <manvolnum>8</manvolnum>
1533 </citerefentry>
1534 but must be explicitly specified.
1535 -->
1536 ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合、3 つ目のフィールド (fs_vfstype) は
1537 <citerefentry>
1538 <refentrytitle>mount</refentrytitle>
1539 <manvolnum>8</manvolnum>
1540 </citerefentry>
1541 のように auto を指定することはできず、明確に指定しなければいけません。
1542 </para>
1543 </listitem>
1544 </varlistentry>
1545
1546 <varlistentry>
1547 <term>
1548 <option>lxc.mount.entry</option>
1549 </term>
1550 <listitem>
1551 <para>
1552 <!--
1553 Specify a mount point corresponding to a line in the
1554 fstab format.
1555 -->
1556 fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします。
1557
1558 <!--
1559 Moreover lxc supports mount propagation, such as rshared or
1560 rprivate, and adds three additional mount options.
1561 <option>optional</option> don't fail if mount does not work.
1562 <option>create=dir</option> or <option>create=file</option>
1563 to create dir (or file) when the point will be mounted.
1564 <option>relative</option> source path is taken to be relative to
1565 the mounted container root. For instance,
1566 -->
1567 加えて、LXC では rshared や rprivate といったマウント・プロパゲーションオプションと、独自の 3 つのマウントオプションが使えます。
1568 <option>optional</option> は、マウントが失敗しても失敗を返さずに無視します。
1569 <option>create=dir</option> と <option>create=file</option> は、マウントポイントをマウントする際にディレクトリもしくはファイルを作成します。
1570 <option>relative</option> を指定すると、マウントされたコンテナルートからの相対パスとして取得されます。
1571 </para>
1572 <programlisting>
1573 dev/null proc/kcore none bind,relative 0 0
1574 </programlisting>
1575 <para>
1576 <!--
1577 Will expand dev/null to ${<option>LXC_ROOTFS_MOUNT</option>}/dev/null,
1578 and mount it to proc/kcore inside the container.
1579 -->
1580 は dev/null を ${<option>LXC_ROOTFS_MOUNT</option>}/dev/null と展開し、コンテナ内の proc/kcore にマウントします。
1581 </para>
1582 </listitem>
1583 </varlistentry>
1584
1585 <varlistentry>
1586 <term>
1587 <option>lxc.mount.auto</option>
1588 </term>
1589 <listitem>
1590 <para>
1591 <!--
1592 specify which standard kernel file systems should be
1593 automatically mounted. This may dramatically simplify
1594 the configuration. The file systems are:
1595 -->
1596 標準のカーネルファイルシステムで自動的にマウントするものを指定します。
1597 これは劇的に設定を容易にする可能性があります。
1598 </para>
1599 <itemizedlist>
1600 <listitem>
1601 <para>
1602 <option>proc:mixed</option> (or <option>proc</option>):
1603 <!--
1604 mount <filename>/proc</filename> as read-write, but
1605 remount <filename>/proc/sys</filename> and
1606 <filename>/proc/sysrq-trigger</filename> read-only
1607 for security / container isolation purposes.
1608 -->
1609 <filename>/proc</filename> を読み書き可能でマウントします。
1610 ただし、<filename>/proc/sys</filename> と <filename>/proc/sysrq-trigger</filename> は、セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます。
1611 </para>
1612 </listitem>
1613 <listitem>
1614 <para>
1615 <option>proc:rw</option>:
1616 <!--
1617 <filename>/proc</filename> as read-write
1618 -->
1619 <filename>/proc</filename> を読み書き可能でマウントします。
1620 </para>
1621 </listitem>
1622 <listitem>
1623 <para>
1624 <option>sys:mixed</option> (or <option>sys</option>):
1625 <!--
1626 mount <filename>/sys</filename> as read-only but with
1627 /sys/devices/virtual/net writable.
1628 -->
1629 /sys/devices/virtual/net のみ書き込み可能で、その他の <filename>/sys</filename> はリードオンリーでマウントします。
1630 </para>
1631 </listitem>
1632 <listitem>
1633 <para>
1634 <option>sys:ro</option>:
1635 <!--
1636 mount <filename>/sys</filename> as read-only
1637 for security / container isolation purposes.
1638 -->
1639 <filename>/sys</filename> を、セキュリティとコンテナの隔離の目的でリードオンリーでマウントします。
1640 </para>
1641 </listitem>
1642 <listitem>
1643 <para>
1644 <option>sys:rw</option>:
1645 <!--
1646 <filename>/sys</filename> as read-write
1647 -->
1648 <filename>/sys</filename> を読み書き可能でマウントします。
1649 </para>
1650 </listitem>
1651 <listitem>
1652 <para>
1653 <option>cgroup:mixed</option>:
1654 <!--
1655 Mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1656 create directories for all hierarchies to which the container
1657 is added, create subdirectories in those hierarchies with the
1658 name of the cgroup, and bind-mount the container's own cgroup
1659 into that directory. The container will be able to write to
1660 its own cgroup directory, but not the parents, since they will
1661 be remounted read-only.
1662 -->
1663 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層に対するディレクトリを作成し、それらの階層内に cgroup 名でサブディレクトリを作成し、そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします。コンテナは自身の cgroup ディレクトリに書き込みが可能ですが、親ディレクトリはリードオンリーで再マウントされているため書き込めません。
1664 </para>
1665 </listitem>
1666
1667 <listitem>
1668 <para>
1669 <option>cgroup:mixed:force</option>:
1670 <!--
1671 The <option>force</option> option will cause LXC to perform
1672 the cgroup mounts for the container under all circumstances.
1673 Otherwise it is similar to <option>cgroup:mixed</option>.
1674 This is mainly useful when the cgroup namespaces are enabled
1675 where LXC will normally leave mounting cgroups to the init
1676 binary of the container since it is perfectly safe to do so.
1677 -->
1678 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup:mixed</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1679 </para>
1680 </listitem>
1681
1682 <listitem>
1683 <para>
1684 <option>cgroup:ro</option>:
1685 <!--
1686 <option>cgroup:mixed</option>, but everything will
1687 be mounted read-only.
1688 -->
1689 <option>cgroup:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
1690 </para>
1691 </listitem>
1692
1693 <listitem>
1694 <para>
1695 <option>cgroup:ro:force</option>:
1696 <!--
1697 The <option>force</option> option will cause LXC to perform
1698 the cgroup mounts for the container under all circumstances.
1699 Otherwise it is similar to <option>cgroup:ro</option>.
1700 This is mainly useful when the cgroup namespaces are enabled
1701 where LXC will normally leave mounting cgroups to the init
1702 binary of the container since it is perfectly safe to do so.
1703 -->
1704 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup:ro</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1705 </para>
1706 </listitem>
1707
1708 <listitem>
1709 <para>
1710 <option>cgroup:rw</option>:
1711 <!--
1712 <option>cgroup:mixed</option>, but everything will be mounted
1713 read-write. Note that the paths leading up to the container's
1714 own cgroup will be writable, but will not be a cgroup
1715 filesystem but just part of the tmpfs of
1716 <filename>/sys/fs/cgroup</filename>
1717 -->
1718 <option>cgroup:mixed</option> と同様にマウントされますが、全て読み書き可能でマウントされます。
1719 コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが、cgroup ファイルシステムにはならず、
1720 <filename>/sys/fs/cgroup</filename> の tmpfs の一部分になるでしょう。
1721 </para>
1722 </listitem>
1723
1724 <listitem>
1725 <para>
1726 <option>cgroup:rw:force</option>:
1727 <!--
1728 The <option>force</option> option will cause LXC to perform
1729 the cgroup mounts for the container under all circumstances.
1730 Otherwise it is similar to <option>cgroup:rw</option>.
1731 This is mainly useful when the cgroup namespaces are enabled
1732 where LXC will normally leave mounting cgroups to the init
1733 binary of the container since it is perfectly safe to do so.
1734 -->
1735 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup:rw</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1736 </para>
1737 </listitem>
1738
1739 <listitem>
1740 <para>
1741 <option>cgroup</option> (マウントオプションなしの場合):
1742 <!--
1743 defaults to <option>cgroup:rw</option> if the
1744 container retains the CAP_SYS_ADMIN capability,
1745 <option>cgroup:mixed</option> otherwise.
1746 -->
1747 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup:rw</option> となります。保持していない場合、<option>cgroup:mixed</option> となります。
1748 </para>
1749 </listitem>
1750
1751 <listitem>
1752 <para>
1753 <option>cgroup-full:mixed</option>:
1754 <!--
1755 mount a tmpfs to <filename>/sys/fs/cgroup</filename>,
1756 create directories for all hierarchies to which
1757 the container is added, bind-mount the hierarchies
1758 from the host to the container and make everything
1759 read-only except the container's own cgroup. Note
1760 that compared to <option>cgroup</option>, where
1761 all paths leading up to the container's own cgroup
1762 are just simple directories in the underlying
1763 tmpfs, here
1764 <filename>/sys/fs/cgroup/$hierarchy</filename>
1765 will contain the host's full cgroup hierarchy,
1766 albeit read-only outside the container's own cgroup.
1767 This may leak quite a bit of information into the
1768 container.
1769 -->
1770 <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、ホストからコンテナまでの階層構造を全てバインドマウントし、コンテナ自身の cgroup を除いてリードオンリーにします。
1771 <option>cgroup</option> と比べると、コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり、コンテナ自身の cgroup の外ではリードオンリーになりますが、<filename>/sys/fs/cgroup/$hierarchy</filename> はホストの全ての cgroup 階層構造を含みます。
1772 これにより、コンテナにはかなりの情報が漏洩します。
1773 </para>
1774 </listitem>
1775
1776 <listitem>
1777 <para>
1778 <option>cgroup-full:mixed:force</option>:
1779 <!--
1780 The <option>force</option> option will cause LXC to perform
1781 the cgroup mounts for the container under all circumstances.
1782 Otherwise it is similar to <option>cgroup-full:mixed</option>.
1783 This is mainly useful when the cgroup namespaces are enabled
1784 where LXC will normally leave mounting cgroups to the init
1785 binary of the container since it is perfectly safe to do so.
1786 -->
1787 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup-full:mixed</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1788 </para>
1789 </listitem>
1790
1791 <listitem>
1792 <para>
1793 <option>cgroup-full:ro</option>:
1794 <!--
1795 similar to
1796 <option>cgroup-full:mixed</option>, but everything
1797 will be mounted read-only.
1798 -->
1799 <option>cgroup-full:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。
1800 </para>
1801 </listitem>
1802
1803 <listitem>
1804 <para>
1805 <option>cgroup-full:ro:force</option>:
1806 <!--
1807 The <option>force</option> option will cause LXC to perform
1808 the cgroup mounts for the container under all circumstances.
1809 Otherwise it is similar to <option>cgroup-full:ro</option>.
1810 This is mainly useful when the cgroup namespaces are enabled
1811 where LXC will normally leave mounting cgroups to the init
1812 binary of the container since it is perfectly safe to do so.
1813 -->
1814 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup-full:ro</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1815 </para>
1816 </listitem>
1817
1818 <listitem>
1819 <para>
1820 <option>cgroup-full:rw</option>:
1821 <!--
1822 similar to
1823 <option>cgroup-full:mixed</option>, but everything
1824 will be mounted read-write. Note that in this case,
1825 the container may escape its own cgroup. (Note also
1826 that if the container has CAP_SYS_ADMIN support
1827 and can mount the cgroup filesystem itself, it may
1828 do so anyway.)
1829 -->
1830 <option>cgroup-full:mixed</option>と同様にマウントされますが、全て読み書き可能でマウントされます。
1831 この場合、コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち、自身で cgroup ファイルシステムをマウント可能なら、いずれにせよそのようにするかもしれないことにも注意してください)。
1832 </para>
1833 </listitem>
1834
1835 <listitem>
1836 <para>
1837 <option>cgroup-full:rw:force</option>:
1838 <!--
1839 The <option>force</option> option will cause LXC to perform
1840 the cgroup mounts for the container under all circumstances.
1841 Otherwise it is similar to <option>cgroup-full:rw</option>.
1842 This is mainly useful when the cgroup namespaces are enabled
1843 where LXC will normally leave mounting cgroups to the init
1844 binary of the container since it is perfectly safe to do so.
1845 -->
1846 <option>force</option> を指定すると、LXC はあらゆる状況でコンテナのための cgroup マウントを実行します。それ以外は <option>cgroup-full:rw</option> と同様です。これは主に cgroup 名前空間が有効な場合に便利です。この場合は完全に安全ですので、LXC は通常コンテナの init バイナリが cgroup をマウントしたままの状態にしておきます。
1847 </para>
1848 </listitem>
1849
1850 <listitem>
1851 <para>
1852 <!--
1853 <option>cgroup-full</option> (without specifier):
1854 defaults to <option>cgroup-full:rw</option> if the
1855 container retains the CAP_SYS_ADMIN capability,
1856 <option>cgroup-full:mixed</option> otherwise.
1857 -->
1858 <option>cgroup-full</option> (マウントオプションなしの場合):
1859 コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup-full:rw</option> となります。保持していない場合、<option>cgroup-full:mixed</option> となります。
1860 </para>
1861 </listitem>
1862
1863 </itemizedlist>
1864 <para>
1865 <!--
1866 If cgroup namespaces are enabled, then any <option>cgroup</option>
1867 auto-mounting request will be ignored, since the container can
1868 mount the filesystems itself, and automounting can confuse the
1869 container init.
1870 -->
1871 cgroup 名前空間が有効の場合、<option>cgroup</option> の自動マウントの指定はどれも無視されます。これは、コンテナが自身でファイルシステムをマウントするため、自動マウントがコンテナの init を混乱させる可能性があるためです。
1872 </para>
1873 <para>
1874 <!--
1875 Note that if automatic mounting of the cgroup filesystem
1876 is enabled, the tmpfs under
1877 <filename>/sys/fs/cgroup</filename> will always be
1878 mounted read-write (but for the <option>:mixed</option>
1879 and <option>:ro</option> cases, the individual
1880 hierarchies,
1881 <filename>/sys/fs/cgroup/$hierarchy</filename>, will be
1882 read-only). This is in order to work around a quirk in
1883 Ubuntu's
1884 <citerefentry>
1885 <refentrytitle>mountall</refentrytitle>
1886 <manvolnum>8</manvolnum>
1887 </citerefentry>
1888 command that will cause containers to wait for user
1889 input at boot if
1890 <filename>/sys/fs/cgroup</filename> is mounted read-only
1891 and the container can't remount it read-write due to a
1892 lack of CAP_SYS_ADMIN.
1893 -->
1894 cgroup ファイルシステムの自動マウントが有効の場合、<filename>/sys/fs/cgroup</filename> 以下の tmpfs は常に読み書き可能でマウントされることに注意が必要です (しかし <option>:mixed</option> と <option>:ro</option> の場合は、個々の階層の <filename>/sys/fs/cgroup/$hierarchy</filename> は読み込み専用となるでしょう)。これは Ubuntu の
1895 <citerefentry>
1896 <refentrytitle>mountall</refentrytitle>
1897 <manvolnum>8</manvolnum>
1898 </citerefentry>
1899 コマンドの特異な動きに対処するためのものです。特異な動きとは、<filename>/sys/fs/cgroup</filename> が読み込み専用でマウントされた状態で、コンテナが CAP_SYS_ADMIN を持たない場合、/sys/fs/cgroup を読み書き可能で再マウントしようとしてできないため、コンテナのブート時にユーザからの入力を待ってしまうというものです。
1900 </para>
1901 <para>
1902 <!--
1903 Examples:
1904 -->
1905 例:
1906 </para>
1907 <programlisting>
1908 lxc.mount.auto = proc sys cgroup
1909 lxc.mount.auto = proc:rw sys:rw cgroup-full:rw
1910 </programlisting>
1911 </listitem>
1912 </varlistentry>
1913
1914 </variablelist>
1915 </refsect2>
1916
1917 <refsect2>
1918 <title><!-- Root file system -->ルートファイルシステム</title>
1919 <para>
1920 <!--
1921 The root file system of the container can be different than that
1922 of the host system.
1923 -->
1924 コンテナのルートファイルシステムは、ホストのルートファイルシステムと異なるようにすることも可能です。
1925 </para>
1926 <variablelist>
1927 <varlistentry>
1928 <term>
1929 <option>lxc.rootfs.path</option>
1930 </term>
1931 <listitem>
1932 <para>
1933 <!--
1934 specify the root file system for the container. It can
1935 be an image file, a directory or a block device. If not
1936 specified, the container shares its root file system
1937 with the host.
1938 -->
1939 コンテナのルートファイルシステムを指定します。
1940 この値はイメージファイル、ディレクトリ、ブロックデバイスのどれかを取ることができます。
1941 もし指定されない場合、コンテナはホストとルートファイルシステムを共有します。
1942 </para>
1943 <para>
1944 <!--
1945 For directory or simple block-device backed containers,
1946 a pathname can be used. If the rootfs is backed by a nbd
1947 device, then <filename>nbd:file:1</filename> specifies that
1948 <filename>file</filename> should be attached to a nbd device,
1949 and partition 1 should be mounted as the rootfs.
1950 <filename>nbd:file</filename> specifies that the nbd device
1951 itself should be mounted. <filename>overlayfs:/lower:/upper</filename>
1952 specifies that the rootfs should be an overlay with <filename>/upper</filename>
1953 being mounted read-write over a read-only mount of <filename>/lower</filename>.
1954 For <filename>overlayfs</filename> multiple <filename>/lower</filename>
1955 directories can be specified. <filename>loop:/file</filename> tells lxc to attach
1956 <filename>/file</filename> to a loop device and mount the loop device.
1957 -->
1958 ディレクトリ、単純なブロックデバイスのバックエンドを持つコンテナの場合、パス名を使うことができます。
1959 もし rootfs が nbd デバイスの場合、<filename>nbd:file:1</filename> という指定は <filename>file</filename> を nbd デバイスとして使用し、その 1 番目のパーティションが rootfs としてマウントされます。
1960 <filename>nbd:file</filename> という指定は、nbd デバイス自身をマウントします。
1961 <filename>overlayfs:/lower:/upper</filename> という指定は、rootfs は <filename>/lower</filename> という読み込み専用でマウントされるディレクトリの上に、<filename>/upper</filename> というディレクトリを読み書き可能で重ね合わせてマウントします。
1962 <filename>overlayfs</filename> は、複数の <filename>/lower</filename> ディレクトリを指定できます。
1963 <filename>loop:/file</filename> は <filename>/file</filename> を loop デバイスとして使用し、loop デバイスをマウントします。
1964 </para>
1965 </listitem>
1966 </varlistentry>
1967
1968 <varlistentry>
1969 <term>
1970 <option>lxc.rootfs.mount</option>
1971 </term>
1972 <listitem>
1973 <para>
1974 <!--
1975 where to recursively bind <option>lxc.rootfs.path</option>
1976 before pivoting. This is to ensure success of the
1977 <citerefentry>
1978 <refentrytitle><command>pivot_root</command></refentrytitle>
1979 <manvolnum>8</manvolnum>
1980 </citerefentry>
1981 syscall. Any directory suffices, the default should
1982 generally work.
1983 -->
1984 root ファイルシステムの変更の前に、<option>lxc.rootfs.path</option> を再帰的にどこにバインドするのかを指定します。これは
1985 <citerefentry>
1986 <refentrytitle><command>pivot_root</command></refentrytitle>
1987 <manvolnum>8</manvolnum>
1988 </citerefentry>
1989 システムコールが確実に成功する事を保証します。
1990 どんなディレクトリでも良く、デフォルトでも通常は動くはずです。
1991 </para>
1992 </listitem>
1993 </varlistentry>
1994
1995 <varlistentry>
1996 <term>
1997 <option>lxc.rootfs.options</option>
1998 </term>
1999 <listitem>
2000 <para>
2001 <!--
2002 Specify extra mount options to use when mounting the rootfs.
2003 The format of the mount options corresponds to the
2004 format used in fstab. In addition, LXC supports the custom
2005 <option>idmap=</option> mount option. This option can be used
2006 to tell LXC to create an idmapped mount for the container's
2007 rootfs. This is useful when the user doesn't want to recursively
2008 chown the rootfs of the container to match the idmapping of the
2009 user namespace the container is going to use. Instead an
2010 idmapped mount can be used to handle this.
2011 The argument for
2012 <option>idmap=</option>
2013 can either be a path pointing to a user namespace file that
2014 LXC will open and use to idmap the rootfs or the special value
2015 "container" which will instruct LXC to use
2016 the container's user namespace to idmap the rootfs.
2017 -->
2018 rootfs をマウントするときに使うマウントオプション。マウントオプションのフォーマットは fstab で使うフォーマットと同じです。
2019 加えて、LXC では独自の <option>idmap=</option> マウントオプションが使えます。このオプションを使うと、LXC に対してコンテナの rootfs を idmapped マウントするように指示できます。
2020 これは、コンテナが使うユーザー名前空間の ID マッピングと一致させるために、コンテナの rootfs を再帰的に chown したくない場合に役に立ちます。代わりに idmapped マウントが使えます。
2021 <option>idmap=</option> の引数は、LXC が開いて rootfs を idmap するのに使うユーザー名前空間ファイルを指すパス、もしくは "container" という特別な値のどちらかです。"container" という値は、コンテナのユーザー名前空間を使って rootfs を idmap するように LXC に指示します。
2022 </para>
2023 </listitem>
2024 </varlistentry>
2025
2026 <varlistentry>
2027 <term>
2028 <option>lxc.rootfs.managed</option>
2029 </term>
2030 <listitem>
2031 <para>
2032 <!--
2033 Set this to 0 to indicate that LXC is not managing the
2034 container storage, then LXC will not modify the
2035 container storage. The default is 1.
2036 -->
2037 LXC がコンテナのストレージを管理していない場合は、この値を 0 に設定します。
2038 0 に設定すると、LXC はコンテナのストレージを変更しません。デフォルト値は 1 です。
2039 </para>
2040 </listitem>
2041 </varlistentry>
2042
2043 </variablelist>
2044 </refsect2>
2045
2046 <refsect2>
2047 <title>Control group ("cgroup")</title>
2048 <para>
2049 <!--
2050 The control group section contains the configuration for the
2051 different subsystem. <command>lxc</command> does not check the
2052 correctness of the subsystem name. This has the disadvantage
2053 of not detecting configuration errors until the container is
2054 started, but has the advantage of permitting any future
2055 subsystem.
2056 -->
2057 CONTROL GROUP セクションは、(lxc とは) 別のサブシステムの設定を含みます。
2058 <command>lxc</command> は、このサブシステム名の正しさはチェックしません。
2059 実行時のエラーを検出するのに不便ですが、別の将来のサブシステムをサポート出来るという有利な点もあります。
2060 </para>
2061
2062 <para>
2063 <!--
2064 The kernel implementation of cgroups has changed significantly over the
2065 years. With Linux 4.5 support for a new cgroup filesystem was added
2066 usually referred to as "cgroup2" or "unified hierarchy". Since then the
2067 old cgroup filesystem is usually referred to as "cgroup1" or the
2068 "legacy hierarchies". Please see the cgroups manual page for a detailed
2069 explanation of the differences between the two versions.
2070 -->
2071 カーネルにおける cgroup 実装は長年にわたって大きく変化してきました。
2072 Linux 4.5 で新しい cgroup ファイルシステムのサポートが追加されました。通常は "cgroup2" や "unified hierarchy"(単一階層構造) と呼ばれています。
2073 それ以来、通常は古い cgroup ファイルシステムは "cgroup1" や "legacy hierarchies"(レガシー階層構造)と呼ばれています。
2074 この 2 つのバージョンの違いについての詳細な説明は、cgroup のマニュアルページをご覧ください。
2075 </para>
2076
2077 <para>
2078 <!--
2079 LXC distinguishes settings for the legacy and the unified hierarchy by
2080 using different configuration key prefixes. To alter settings for
2081 controllers in a legacy hierarchy the key prefix
2082 <option>lxc.cgroup.</option> must be used and in order to alter the
2083 settings for a controller in the unified hierarchy the
2084 <option>lxc.cgroup2.</option> key must be used. Note that LXC will
2085 ignore <option>lxc.cgroup.</option> settings on systems that only use
2086 the unified hierarchy. Conversely, it will ignore
2087 <option>lxc.cgroup2.</option> options on systems that only use legacy
2088 hierarchies.
2089 -->
2090 LXC は cgroup1(レガシー階層構造)と cgroup2(単一階層構造)に対する設定を、異なる設定プレフィックスを使って区別しています。
2091 cgroup1 に対する設定を変更するには <option>lxc.cgroup.</option> というプレフィックスを使う必要があり、cgroup2 の設定を変更するには <option>lxc.cgroup2.</option> を使う必要があります。
2092 LXC は、cgroup2 だけが使われているシステム上の <option>lxc.cgroup.</option> を無視します。逆に cgroup1 だけが使われているシステム上の <option>lxc.cgroup2.</option> を無視します。
2093 </para>
2094
2095 <para>
2096 <!--
2097 At its core a cgroup hierarchy is a way to hierarchically organize
2098 processes. Usually a cgroup hierarchy will have one or more
2099 "controllers" enabled. A "controller" in a cgroup hierarchy is usually
2100 responsible for distributing a specific type of system resource along
2101 the hierarchy. Controllers include the "pids" controller, the "cpu"
2102 controller, the "memory" controller and others. Some controllers
2103 however do not fall into the category of distributing a system
2104 resource, instead they are often referred to as "utility" controllers.
2105 One utility controller is the device controller. Instead of
2106 distributing a system resource it allows one to manage device access.
2107 -->
2108 cgroup 階層の本質は、プロセスを階層的に構造化する方法です。通常は、cgroup 階層では 1 つ以上の「コントローラー」が有効になっています。
2109 通常、cgroup 階層の「コントローラー」は階層に従って特定のタイプのシステムリソースを分配する役割を果たします。
2110 コントローラーには "pids" コントローラー、"cpu" コントローラー、"memory" コントローラーなどがあります。
2111 しかし、システムリソースの分配するという役割に該当しないコントローラーもあります。このようなコントローラーは「ユーティリティー」コントローラーと呼ばれたりします。
2112 ユーティリティーコントローラーの 1 つにデバイスコントローラーがあります。このコントローラーはシステムリソースを分配する代わりにデバイスへのアクセスを管理できます。
2113 </para>
2114
2115 <para>
2116 <!--
2117 In the legacy hierarchy the device controller was implemented like most
2118 other controllers as a set of files that could be written to. These
2119 files where named "devices.allow" and "devices.deny". The legacy device
2120 controller allowed the implementation of both "allowlists" and
2121 "denylists".
2122 -->
2123 cgroup1 では、デバイスコントローラーは他の多くのコントローラーと同様に、書き込みできるファイルのセットとして実装されていました。
2124 これらのファイルは "devices.allow" と "devices.deny" という名前のファイルでした。レガシーデバイスコントローラーは「許可リスト(allowlists)」と「拒否リスト(denylists)」の両方を実装できました。
2125 </para>
2126
2127 <para>
2128 <!--
2129 An allowlist is a device program that by default blocks access to all
2130 devices. In order to access specific devices "allow rules" for
2131 particular devices or device classes must be specified. In contrast, a
2132 denylist is a device program that by default allows access to all
2133 devices. In order to restrict access to specific devices "deny rules"
2134 for particular devices or device classes must be specified.
2135 -->
2136 許可リスト(allowlist)とは、すべてのデバイスへのアクセスをブロックするデバイスプログラムです。特定のデバイスへのアクセスを行うには、特定のデバイスもしくはデバイスクラスに対する「許可ルール(allow rules)」を指定する必要があります。
2137 一方、拒否リスト(denylist)はデフォルトですべてのデバイスへのアクセスを許可するデバイスプログラムです。特定のデバイスへのアクセスを拒否するには、特定のデバイスもしくはデバイスクラスに対する「拒否ルール(deny rules)」を指定する必要があります。
2138 </para>
2139
2140 <para>
2141 <!--
2142 In the unified cgroup hierarchy the implementation of the device
2143 controller has completely changed. Instead of files to read from and
2144 write to a eBPF program of
2145 <option>BPF_PROG_TYPE_CGROUP_DEVICE</option> can be attached to a
2146 cgroup. Even though the kernel implementation has changed completely
2147 LXC tries to allow for the same semantics to be followed in the legacy
2148 device cgroup and the unified eBPF-based device controller. The
2149 following paragraphs explain the semantics for the unified eBPF-based
2150 device controller.
2151 -->
2152 cgroup2 では、デバイスコントローラーの実装が完全に変わりました。読み書きするファイルの代わりに、<option>BPF_PROG_TYPE_CGROUP_DEVICE</option> の eBPF プログラムを cgroup にアタッチできます。
2153 カーネルの実装が完全に変わったのにもかかわらず、LXC は cgroup1 のデバイスコントローラーと cgroup2 の eBPF ベースのデバイスコントローラーで同じセマンティクスに従えるようにしています。
2154 このあとの段落では、cgroup2 の eBPF デバイスコントローラーに対するセマンティクスを説明します。
2155 </para>
2156
2157 <para>
2158 <!--
2159 As mentioned the format for specifying device rules for the unified
2160 eBPF-based device controller is the same as for the legacy cgroup
2161 device controller; only the configuration key prefix has changed.
2162 Specifically, device rules for the legacy cgroup device controller are
2163 specified via <option>lxc.cgroup.devices.allow</option> and
2164 <option>lxc.cgroup.devices.deny</option> whereas for the
2165 cgroup2 eBPF-based device controller
2166 <option>lxc.cgroup2.devices.allow</option> and
2167 <option>lxc.cgroup2.devices.deny</option> must be used.
2168 -->
2169 先に述べたように、cgroup2 の eBPF ベースのデバイスコントローラーに対するデバイスルールを指定するフォーマットは、cgroup1 のデバイスコントローラーと同じです。ただし、設定キーのプレフィックスは変更されています。
2170 具体的には、cgroup1 のデバイスコントローラーに対するデバイスルールは <option>lxc.cgroup.devices.allow</option> と <option>lxc.cgroup.devices.deny</option> を使って指定します。一方、cgroup2 の eBPF ベースのコントローラーでは <option>lxc.cgroup2.devices.allow</option> と <option>lxc.cgroup2.devices.deny</option> を使わなければなりません。
2171 </para>
2172 <para>
2173 <itemizedlist>
2174 <listitem>
2175 <para>
2176 <!--
2177 A denylist device rule
2178 <programlisting>
2179 lxc.cgroup2.devices.deny = a
2180 </programlisting>
2181 will cause LXC to instruct the kernel to block access to all
2182 devices by default. To grant access to devices allow device rules
2183 must be added via the <option>lxc.cgroup2.devices.allow</option>
2184 key. This is referred to as a "allowlist" device program.
2185 -->
2186 拒否リスト(denylist)のデバイスルール
2187 <programlisting>
2188 lxc.cgroup2.devices.deny = a
2189 </programlisting>
2190 は、カーネルに対してデフォルトですべてのデバイスへのアクセスをブロックするように LXC が指示します。
2191 デバイスへのアクセスを許可するには、デバイスに対する許可ルールを <option>lxc.cgroup2.devices.allow</option> を使って追加する必要があります。これは「許可リスト」デバイスプログラムとして参照されます。
2192 </para>
2193 </listitem>
2194
2195 <listitem>
2196 <para>
2197 <!--
2198 An allowlist device rule
2199 <programlisting>
2200 lxc.cgroup2.devices.allow = a
2201 </programlisting>
2202 will cause LXC to instruct the kernel to allow access to all
2203 devices by default. To deny access to devices deny device rules
2204 must be added via <option>lxc.cgroup2.devices.deny</option> key.
2205 This is referred to as a "denylist" device program.
2206 -->
2207 許可リスト(allowlist)のデバイスルール
2208 <programlisting>
2209 lxc.cgroup2.devices.allow = a
2210 </programlisting>
2211 は、カーネルに対してすべてのデバイスへのアクセスをデフォルトで許可するように LXC が指示します。
2212 デバイスへのアクセスを拒否するには、デバイスに対する拒否ルールを <option>lxc.cgroup2.devices.deny</option> を使って追加する必要があります。これは「拒否リスト」デバイスプログラムとして参照されます。
2213 </para>
2214 </listitem>
2215
2216 <listitem>
2217 <para>
2218 <!--
2219 Specifying any of the aforementioned two rules will cause all
2220 previous rules to be cleared, i.e. the device list will be reset.
2221 -->
2222 前述の 2 つのルールのいずれかを指定すると、それ以前に指定していたルールがすべてクリアされます。つまり、デバイスリストがリセットされます。
2223 </para>
2224 </listitem>
2225
2226 <listitem>
2227 <para>
2228 <!--
2229 When an allowlist program is requested, i.e. access to all devices
2230 is blocked by default, specific deny rules for individual devices
2231 or device classes are ignored.
2232 -->
2233 許可リストプログラムが要求される場合、つまりデフォルトですべてのデバイスへのアクセスがブロックされている場合、個別のデバイスやデバイスクラスへの拒否ルールを指定しても無視されます。
2234 </para>
2235 </listitem>
2236
2237 <listitem>
2238 <para>
2239 <!--
2240 When a denylist program is requested, i.e. access to all devices
2241 is allowed by default, specific allow rules for individual devices
2242 or device classes are ignored.
2243 -->
2244 拒否リストプログラムが要求される場合、つまりデフォルトですべてのデバイスへのアクセスが許可されている場合、個別のデバイスやデバイスクラスへの許可ルールを指定しても無視されます。
2245 </para>
2246 </listitem>
2247 </itemizedlist>
2248 </para>
2249
2250 <para>
2251 <!--
2252 For example the set of rules:
2253 -->
2254 例えば、次のようなルールの組
2255 <programlisting>
2256 lxc.cgroup2.devices.deny = a
2257 lxc.cgroup2.devices.allow = c *:* m
2258 lxc.cgroup2.devices.allow = b *:* m
2259 lxc.cgroup2.devices.allow = c 1:3 rwm
2260 </programlisting>
2261 <!--
2262 implements an allowlist device program, i.e. the kernel will block
2263 access to all devices not specifically allowed in this list. This
2264 particular program states that all character and block devices may be
2265 created but only /dev/null might be read or written.
2266 -->
2267 は、許可リスト(allowlist)デバイスプログラムを実装します。つまり、カーネルはこのリストで許可されるように設定されていないすべてのデバイスへのアクセスをブロックします。
2268 このプログラムでは、すべてのキャラクターデバイスとブロックデバイスが作成できますが、読み書きは /dev/null に対してしか行なえません。
2269 </para>
2270
2271 <para>
2272 <!--
2273 If we instead switch to the following set of rules:
2274 -->
2275 代わりに先のルールから次のようなルールの組に変更したとすると、
2276 <programlisting>
2277 lxc.cgroup2.devices.allow = a
2278 lxc.cgroup2.devices.deny = c *:* m
2279 lxc.cgroup2.devices.deny = b *:* m
2280 lxc.cgroup2.devices.deny = c 1:3 rwm
2281 </programlisting>
2282 <!--
2283 then LXC would instruct the kernel to implement a denylist, i.e. the
2284 kernel will allow access to all devices not specifically denied in
2285 this list. This particular program states that no character devices or
2286 block devices might be created and that /dev/null is not allow allowed
2287 to be read, written, or created.
2288 -->
2289 LXC はカーネルに拒否リスト(denylist)の実装を指示します。つまりカーネルはこのリストで拒否を指定していないすべてのデバイスへのアクセスを許可します。
2290 このプログラムでは、キャラクターデバイスとブロックデバイスは作成できません。そして /dev/null の読み書きと作成は許可されません。
2291 </para>
2292
2293 <para>
2294 <!--
2295 Now consider the same program but followed by a "global rule"
2296 which determines the type of device program (allowlist or
2297 denylist) as explained above:
2298 -->
2299 ここで、同じプログラムでも、前述のようにデバイスのプログラムタイプを決定するような「グローバルルール」が続いている場合を考えてみましょう。
2300 <programlisting>
2301 lxc.cgroup2.devices.allow = a
2302 lxc.cgroup2.devices.deny = c *:* m
2303 lxc.cgroup2.devices.deny = b *:* m
2304 lxc.cgroup2.devices.deny = c 1:3 rwm
2305 lxc.cgroup2.devices.allow = a
2306 </programlisting>
2307 <!--
2308 The last line will cause LXC to reset the device list without changing
2309 the type of device program.
2310 -->
2311 最後の行は、デバイスプログラムのタイプを変更せずに、LXC がデバイスリストをリセットしてしまいます。
2312 </para>
2313
2314 <para>
2315 <!--
2316 If we specify:
2317 -->
2318 次のように指定した場合、
2319 <programlisting>
2320 lxc.cgroup2.devices.allow = a
2321 lxc.cgroup2.devices.deny = c *:* m
2322 lxc.cgroup2.devices.deny = b *:* m
2323 lxc.cgroup2.devices.deny = c 1:3 rwm
2324 lxc.cgroup2.devices.deny = a
2325 </programlisting>
2326 <!--
2327 instead then the last line will cause LXC to reset the device list and
2328 switch from an allowlist program to a denylist program.
2329 -->
2330 前の例と違って最後の行によって、LXC はデバイスリストをリセットし、許可リスト(allowlist)から拒否リスト(denylist)にプログラムを変更してしまいます。
2331 </para>
2332 <variablelist>
2333 <varlistentry>
2334 <term>
2335 <option>lxc.cgroup.[control name].[controller file]</option>
2336 </term>
2337 <listitem>
2338 <para>
2339 <!--
2340 Specify the control group value to be set on a legacy cgroup
2341 hierarchy. The controller name is the literal name of the control
2342 group. The permitted names and the syntax of their values is not
2343 dictated by LXC, instead it depends on the features of the Linux
2344 kernel running at the time the container is started, eg.
2345 <option>lxc.cgroup.cpuset.cpus</option>
2346 -->
2347 レガシー cgroup 階層 (cgroup v1) に設定する値を指定します。コントローラー名は control group そのままの名前です。
2348 許される名前や値の書式は LXC が指定することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。
2349 例えば <option>lxc.cgroup.cpuset.cpus</option> のようになります。
2350 </para>
2351 </listitem>
2352 </varlistentry>
2353 <varlistentry>
2354 <term>
2355 <option>lxc.cgroup2.[controller name].[controller file]</option>
2356 </term>
2357 <listitem>
2358 <para>
2359 <!--
2360 Specify the control group value to be set on the unified cgroup
2361 hierarchy. The controller name is the literal name of the control
2362 group. The permitted names and the syntax of their values is not
2363 dictated by LXC, instead it depends on the features of the Linux
2364 kernel running at the time the container is started, eg.
2365 <option>lxc.cgroup2.memory.high</option>
2366 -->
2367 単一の cgroup 階層 (cgroup v2) に設定する値を指定します。
2368 許される名前や値の書式は LXC が指定することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。
2369 例えば <option>lxc.cgroup2.memory.high</option> のようになります。
2370 </para>
2371 </listitem>
2372 </varlistentry>
2373 <varlistentry>
2374 <term>
2375 <option>lxc.cgroup.dir</option>
2376 </term>
2377 <listitem>
2378 <para>
2379 <!--
2380 specify a directory or path in which the container's cgroup will
2381 be created. For example, setting
2382 <option>lxc.cgroup.dir = my-cgroup/first</option> for a container
2383 named "c1" will create the container's cgroup as a sub-cgroup of
2384 "my-cgroup". For example, if the user's current cgroup "my-user"
2385 is located in the root cgroup of the cpuset controllerin in a
2386 cgroup v1 hierarchy this would create the cgroup
2387 "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" for the
2388 container. Any missing cgroups will be created by LXC. This
2389 presupposes that the user has write access to its current cgroup.
2390 -->
2391 コンテナの cgroup を作成するパスやディレクトリを指定します。
2392 例えば、"c1" という名前のコンテナで <option>lxc.cgroup.dir = my-cgroup/first</option> のように設定すると、"my-cgroup" のサブ cgroup のようにコンテナの cgroup を作成します。
2393 例えば、ユーザのカレントの cgroup である "my-user" が cgroup v1 階層にある cpuset コントローラの root cgroup 内に存在する場合、この設定は "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" という cgroup をこのコンテナ向けに作成します。
2394 存在しない cgroup は LXC が作成しますが、ユーザがカレントの cgroup に書き込み権を持っていることが前提となります。
2395 </para>
2396 </listitem>
2397 </varlistentry>
2398 <varlistentry>
2399 <term>
2400 <option>lxc.cgroup.dir.container</option>
2401 </term>
2402 <listitem>
2403 <para>
2404 <!--
2405 This is similar to <option>lxc.cgroup.dir</option>, but must be
2406 used together with <option>lxc.cgroup.dir.monitor</option> and
2407 affects only the container's cgroup path. This option is mutually
2408 exclusive with <option>lxc.cgroup.dir</option>.
2409 Note that the final path the container attaches to may be
2410 extended further by the
2411 <option>lxc.cgroup.dir.container.inner</option> option.
2412 -->
2413 これは <option>lxc.cgroup.dir</option> と同様の設定ですが、かならず <option>lxc.cgroup.dir.monitor</option> と同時に使わなければなりません。そして、設定はコンテナの cgroup パスにのみ影響を与えます。このオプションは <option>lxc.cgroup.dir</option> と同時に設定できません。コンテナがアタッチされる最終的なパスは <option>lxc.cgroup.dir.container.inner</option> オプションによりさらに変更される可能性があります。
2414 </para>
2415 </listitem>
2416 </varlistentry>
2417 <varlistentry>
2418 <term>
2419 <option>lxc.cgroup.dir.monitor</option>
2420 </term>
2421 <listitem>
2422 <para>
2423 <!--
2424 This is the monitor process counterpart to
2425 <option>lxc.cgroup.dir.container</option>.
2426 -->
2427 このオプションは、モニタプロセスに対して<option>lxc.cgroup.dir.container</option> と同様の働きをします。
2428 </para>
2429 </listitem>
2430 </varlistentry>
2431 <varlistentry>
2432 <term>
2433 <option>lxc.cgroup.dir.monitor.pivot</option>
2434 </term>
2435 <listitem>
2436 <para>
2437 <!--
2438 On container termination the PID of the monitor process is attached to this cgroup.
2439 This path should not be a subpath of any other configured cgroup dir to ensure
2440 proper removal of other cgroup paths on container termination.
2441 -->
2442 コンテナ終了時に、モニタープロセスの PID がここで指定した cgroup にアタッチされます。
2443 コンテナ終了時に、他の cgroup パスが確実に適切に削除されるように、ここに設定するパスは他で設定した cgroup ディレクトリのサブパスにすべきではありません。
2444 </para>
2445 </listitem>
2446 </varlistentry>
2447 <varlistentry>
2448 <term>
2449 <option>lxc.cgroup.dir.container.inner</option>
2450 </term>
2451 <listitem>
2452 <para>
2453 <!--
2454 Specify an additional subdirectory where the cgroup namespace
2455 will be created. With this option, the cgroup limits will be
2456 applied to the outer path specified in
2457 <option>lxc.cgroup.dir.container</option>, which is not accessible
2458 from within the container, making it possible to better enforce
2459 limits for privileged containers in a way they cannot override
2460 them.
2461 This only works in conjunction with the
2462 <option>lxc.cgroup.dir.container</option> and
2463 <option>lxc.cgroup.dir.monitor</option> options and has otherwise
2464 no effect.
2465 -->
2466 cgroup 名前空間が作られる追加のサブディレクトリを指定します。このオプションを使うと、cgroup の制限は <option>lxc.cgroup.dir.container</option> で指定した外部パスに適用されます。<option>lxc.cgroup.dir.container</option> はコンテナ内部からアクセスできないため、特権コンテナに対する制限を上書きできない方法でよりよい方法で強制できます。
2467 このオプションは <option>lxc.cgroup.dir.container</option> と <option>lxc.cgroup.dir.monitor</option> と同時に指定したときのみ機能し、それ以外の場合は効果がありません。
2468 </para>
2469 </listitem>
2470 </varlistentry>
2471 <varlistentry>
2472 <term>
2473 <option>lxc.cgroup.relative</option>
2474 </term>
2475 <listitem>
2476 <para>
2477 <!--
2478 Set this to 1 to instruct LXC to never escape to the
2479 root cgroup. This makes it easy for users to adhere to
2480 restrictions enforced by cgroup2 and
2481 systemd. Specifically, this makes it possible to run LXC
2482 containers as systemd services.
2483 -->
2484 LXC に root cgroup へのエスケープを行わないように指示するには、この値を 1 に設定してください。
2485 これにより、ユーザは cgroup2 と systemd が強制する制限を遵守するのが容易になります。
2486 具体的には、これにより LXC コンテナを systemd のサービスとして実行できます。
2487 </para>
2488 </listitem>
2489 </varlistentry>
2490 </variablelist>
2491 </refsect2>
2492
2493 <refsect2>
2494 <title><!-- Capabilities -->ケーパビリティ</title>
2495 <para>
2496 <!--
2497 The capabilities can be dropped in the container if this one
2498 is run as root.
2499 -->
2500 コンテナが root 権限で実行されていても、コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です。
2501 </para>
2502 <variablelist>
2503 <varlistentry>
2504 <term>
2505 <option>lxc.cap.drop</option>
2506 </term>
2507 <listitem>
2508 <para>
2509 <!--
2510 Specify the capability to be dropped in the container. A
2511 single line defining several capabilities with a space
2512 separation is allowed. The format is the lower case of
2513 the capability definition without the "CAP_" prefix,
2514 eg. CAP_SYS_MODULE should be specified as
2515 sys_module. See
2516 <citerefentry>
2517 <refentrytitle><command>capabilities</command></refentrytitle>
2518 <manvolnum>7</manvolnum>
2519 </citerefentry>,
2520 If used with no value, lxc will clear any drop capabilities
2521 specified up to this point.
2522 -->
2523 コンテナ内で削除するケーパビリティ (capability) を指定します。
2524 一行でスペース区切りで複数のケーパビリティを指定することも可能です。
2525 指定は、"CAP_" というプレフィックスなしで、小文字でケーパビリティを指定します。
2526 例えば、CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります。
2527 詳しくは以下を参照してください。
2528 <citerefentry>
2529 <refentrytitle><command>capabilities</command></refentrytitle>
2530 <manvolnum>7</manvolnum>
2531 </citerefentry>
2532 この設定を、値を指定しない状態で使った場合、それ以前に指定された削除対象のケーパビリティの指定をすべてクリアします (lxc.cap.drop に何も指定しない状態になります)。
2533 </para>
2534 </listitem>
2535 </varlistentry>
2536 <varlistentry>
2537 <term>
2538 <option>lxc.cap.keep</option>
2539 </term>
2540 <listitem>
2541 <para>
2542 <!--
2543 Specify the capability to be kept in the container. All other
2544 capabilities will be dropped. When a special value of "none" is
2545 encountered, lxc will clear any keep capabilities specified up
2546 to this point. A value of "none" alone can be used to drop all
2547 capabilities.
2548 -->
2549 コンテナ内で維持するケーパビリティを指定します。指定した以外の全てのケーパビリティはドロップされます。
2550 特別な値 "none" が指定されている時点で、lxc はこの時点で保持することになっている全てのケーパビリティをクリアします。"none" を単独で使用するとすべてのケーパビリティを削除できます。
2551 </para>
2552 </listitem>
2553 </varlistentry>
2554 </variablelist>
2555 </refsect2>
2556
2557 <refsect2>
2558 <title>名前空間 <!-- Namespace --></title>
2559 <para>
2560 <!--
2561 A namespace can be cloned (<option>lxc.namespace.clone</option>),
2562 kept (<option>lxc.namespace.keep</option>) or shared
2563 (<option>lxc.namespace.share.[namespace identifier]</option>).
2564 -->
2565 名前空間は clone したり (<option>lxc.namespace.clone</option>)、keep したり (<option>lxc.namespace.keep</option>)、share したり (<option>lxc.namespace.share.[namespace identifier]</option>) できます。
2566 </para>
2567 <variablelist>
2568 <varlistentry>
2569 <term>
2570 <option>lxc.namespace.clone</option>
2571 </term>
2572 <listitem>
2573 <para>
2574 <!--
2575 Specify namespaces which the container is supposed to be created
2576 with. The namespaces to create are specified as a space separated
2577 list. Each namespace must correspond to one of the standard
2578 namespace identifiers as seen in the
2579 <filename>/proc/PID/ns</filename> directory.
2580 When <option>lxc.namespace.clone</option> is not explicitly set all
2581 namespaces supported by the kernel and the current configuration
2582 will be used.
2583 -->
2584 コンテナ作成時に作成する名前空間を指定します。作成する名前空間はスペース区切りのリストで指定します。指定する名前空間名は、<filename>/proc/PID/ns</filename> ディレクトリ内に存在する標準の名前空間指示子でなければなりません。
2585 <option>lxc.namespace.clone</option> を明示的に設定していない場合は、カーネルがサポートするすべての名前空間と現在の設定が使われます。
2586 </para>
2587
2588 <para>
2589 <!--
2590 To create a new mount, net and ipc namespace set
2591 <option>lxc.namespace.clone=mount net ipc</option>.
2592 -->
2593 新しいマウント、ネット、IPC 名前空間を作る場合は <option>lxc.namespace.clone=mount net ipc</option> と指定します。
2594 </para>
2595 </listitem>
2596 </varlistentry>
2597
2598 <varlistentry>
2599 <term>
2600 <option>lxc.namespace.keep</option>
2601 </term>
2602 <listitem>
2603 <para>
2604 <!--
2605 Specify namespaces which the container is supposed to inherit from
2606 the process that created it. The namespaces to keep are specified as
2607 a space separated list. Each namespace must correspond to one of the
2608 standard namespace identifiers as seen in the
2609 <filename>/proc/PID/ns</filename> directory.
2610 The <option>lxc.namespace.keep</option> is a
2611 denylist option, i.e. it is useful when enforcing that containers
2612 must keep a specific set of namespaces.
2613 -->
2614 コンテナが、作成元のプロセスから継承する (新しい名前空間を作らずに元のプロセスの名前空間のまま実行する) 名前空間を指定します。継承する名前空間はスペース区切りのリストで指定します。指定する名前空間名は、<filename>/proc/PID/ns</filename> ディレクトリ内に存在する標準の名前空間指示子でなければなりません。<option>lxc.namespace.keep</option> はブラックリストを指定するオプションです。つまり、コンテナに特定の名前空間を使い続けることを強制したい場合に便利です。
2615 </para>
2616
2617 <para>
2618 <!--
2619 To keep the network, user and ipc namespace set
2620 <option>lxc.namespace.keep=user net ipc</option>.
2621 -->
2622 ネットワーク、ユーザ、IPC 名前空間を元のプロセスの名前空間のままで実行したい場合は <option>lxc.namespace.keep=user net ipc</option> と指定します。
2623 </para>
2624
2625 <para>
2626 <!--
2627 Note that sharing pid namespaces will likely not work with most init
2628 systems.
2629 -->
2630 PID 名前空間を共有すると、ほとんどの init で動作しない可能性があることに注意してください。
2631 </para>
2632
2633 <para>
2634 <!--
2635 Note that if the container requests a new user namespace and the
2636 container wants to inherit the network namespace it needs to inherit
2637 the user namespace as well.
2638 -->
2639 コンテナが新しいユーザ名前空間をリクエストし、そのコンテナがネットワーク名前空間は継承したい場合は、ユーザ名前空間も同様に継承する必要があることに注意してください。
2640 </para>
2641 </listitem>
2642 </varlistentry>
2643
2644 <varlistentry>
2645 <term>
2646 <option>lxc.namespace.share.[namespace identifier]</option>
2647 </term>
2648 <listitem>
2649 <para>
2650 <!--
2651 Specify a namespace to inherit from another container or process.
2652 The <option>[namespace identifier]</option> suffix needs to be
2653 replaced with one of the namespaces that appear in the
2654 <filename>/proc/PID/ns</filename> directory.
2655 -->
2656 他のコンテナやプロセスから継承する名前空間を指定します。<option>[namespace identifier]</option> には、<filename>/proc/PID/ns</filename> ディレクトリ内に現れる名前空間のひとつが入ります。
2657 </para>
2658
2659 <para>
2660 <!--
2661 To inherit the namespace from another process set the
2662 <option>lxc.namespace.share.[namespace identifier]</option> to the PID of
2663 the process, e.g. <option>lxc.namespace.share.net=42</option>.
2664 -->
2665 他のプロセスから名前空間を継承するには、<option>lxc.namespace.share.[namespace identifier]</option> の値をプロセスの PID に設定します。例えば <option>lxc.namespace.share.net=42</option> のようになります。
2666 </para>
2667
2668 <para>
2669 <!--
2670 To inherit the namespace from another container set the
2671 <option>lxc.namespace.share.[namespace identifier]</option> to the name of
2672 the container, e.g. <option>lxc.namespace.share.pid=c3</option>.
2673 -->
2674 他のコンテナから名前空間を継承するには、<option>lxc.namespace.share.[namespace identifier]</option> の値をコンテナ名に設定します。例えば <option>lxc.namespace.share.pid=c3</option> のようになります。
2675 </para>
2676
2677 <para>
2678 <!--
2679 To inherit the namespace from another container located in a
2680 different path than the standard liblxc path set the
2681 <option>lxc.namespace.share.[namespace identifier]</option> to the full
2682 path to the container, e.g.
2683 <option>lxc.namespace.share.user=/opt/c3</option>.
2684 -->
2685 標準の liblxc のパスとは異なるコンテナパスに存在する他のコンテナから名前空間を継承するには、<option>lxc.namespace.share.[namespace identifier]</option> をそのコンテナのフルパスで指定します。例えば <option>lxc.namespace.share.user=/opt/c3</option> のようになります。
2686 </para>
2687
2688 <para>
2689 <!--
2690 In order to inherit namespaces the caller needs to have sufficient
2691 privilege over the process or container.
2692 -->
2693 名前空間を継承するためには、呼び出し元が継承元のプロセスまたはコンテナに対して十分な権限を持っている必要があります。
2694 </para>
2695
2696 <para>
2697 <!--
2698 Note that sharing pid namespaces between system containers will
2699 likely not work with most init systems.
2700 -->
2701 システムコンテナ間での PID 名前空間の共有は、ほとんどの init システムではうまく動作しない可能性があることに注意が必要です。
2702 </para>
2703
2704 <para>
2705 <!--
2706 Note that if two processes are in different user namespaces and one
2707 process wants to inherit the other's network namespace it usually
2708 needs to inherit the user namespace as well.
2709 -->
2710 ふたつのプロセスが異なるユーザ名前空間に存在し、そのうちのひとつが他のネットワーク名前空間を継承したい場合、通常はユーザ名前空間も同様に継承する必要があることに注意が必要です。
2711 </para>
2712
2713 <para>
2714 <!--
2715 Note that without careful additional configuration of an LSM,
2716 sharing user+pid namespaces with a task may allow that task to
2717 escalate privileges to that of the task calling liblxc.
2718 -->
2719 LSM で慎重に設定を追加しないで、タスクでユーザ + PID 名前空間を共有すると、そのタスクは liblxc を呼び出したタスクの権限に昇格できることに注意が必要です。
2720 </para>
2721
2722 </listitem>
2723 </varlistentry>
2724
2725 <varlistentry>
2726 <term>
2727 <option>lxc.time.offset.boot</option>
2728 </term>
2729 <listitem>
2730 <para>
2731 <!--
2732 Specify a positive or negative offset for the boottime clock. The
2733 format accepts hours (h), minutes (m), seconds (s),
2734 milliseconds (ms), microseconds (us), and nanoseconds (ns).
2735 -->
2736 ブートタイム(boottime)クロックの正または負のオフセット値を指定します。フォーマットは、時(h)、分(m)、秒(s)、ミリ秒(ms)、マイクロ秒(us)、ナノ秒(ns)を指定できます。
2737 </para>
2738 </listitem>
2739 </varlistentry>
2740
2741 <varlistentry>
2742 <term>
2743 <option>lxc.time.offset.monotonic</option>
2744 </term>
2745 <listitem>
2746 <para>
2747 <!--
2748 Specify a positive or negative offset for the montonic clock. The
2749 format accepts hours (h), minutes (m), seconds (s),
2750 milliseconds (ms), microseconds (us), and nanoseconds (ns).
2751 -->
2752 monotonicクロックの正または負のオフセット値を指定します。フォーマットは、時(h)、分(m)、秒(s)、ミリ秒(ms)、マイクロ秒(us)、ナノ秒(ns)を指定できます。
2753 </para>
2754 </listitem>
2755 </varlistentry>
2756
2757 </variablelist>
2758 </refsect2>
2759
2760 <refsect2>
2761 <title>リソース制限 <!-- Resource limits --></title>
2762 <para>
2763 <!--
2764 The soft and hard resource limits for the container can be changed.
2765 Unprivileged containers can only lower them. Resources which are not
2766 explicitly specified will be inherited.
2767 -->
2768 コンテナに対するソフトもしくはハードリミットを変更できます。非特権コンテナでは、制限を下げることしかできません。明示的に指定されていないリソースは継承されます。
2769 </para>
2770 <variablelist>
2771 <varlistentry>
2772 <term>
2773 <option>lxc.prlimit.[limit name]</option>
2774 </term>
2775 <listitem>
2776 <para>
2777 <!--
2778 Specify the resource limit to be set. A limit is specified as two
2779 colon separated values which are either numeric or the word
2780 'unlimited'. A single value can be used as a shortcut to set both
2781 soft and hard limit to the same value. The permitted names the
2782 "RLIMIT_" resource names in lowercase without the "RLIMIT_"
2783 prefix, eg. RLIMIT_NOFILE should be specified as "nofile". See
2784 <citerefentry>
2785 <refentrytitle><command>setrlimit</command></refentrytitle>
2786 <manvolnum>2</manvolnum>
2787 </citerefentry>.
2788 If used with no value, lxc will clear the resource limit
2789 specified up to this point. A resource with no explicitly
2790 configured limitation will be inherited from the process starting
2791 up the container.
2792 -->
2793 設定したいリソースと制限値を指定します。制限値はコロンで区切られた 2 つの値で指定します。値は数値もしくは 'unlimited' で指定します。ソフトもハードも同じ値を指定する場合は単一の値を指定できます。指定できる名前は、"RLIMIT_" 接頭辞がなく小文字で書かれた、"RLIMIT_" リソース名です。例えば、RLIMIT_NOFILE は "nofile" と指定します。詳しくは
2794 <citerefentry>
2795 <refentrytitle><command>setrlimit</command></refentrytitle>
2796 <manvolnum>2</manvolnum>
2797 </citerefentry> を参照してください。
2798 値を指定せずに使用した場合、lxc はこの指定以前に設定されたリソース制限をクリアします。明示的に制限が設定されていないリソースについては、コンテナを起動したプロセスから継承します。
2799 </para>
2800 </listitem>
2801 </varlistentry>
2802 </variablelist>
2803 </refsect2>
2804
2805 <refsect2>
2806 <title>Sysctl</title>
2807 <para>
2808 <!--
2809 Configure kernel parameters for the container.
2810 -->
2811 コンテナ用のカーネルパラメータを設定します。
2812 </para>
2813 <variablelist>
2814 <varlistentry>
2815 <term>
2816 <option>lxc.sysctl.[kernel parameters name]</option>
2817 </term>
2818 <listitem>
2819 <para>
2820 <!--
2821 Specify the kernel parameters to be set. The parameters available
2822 are those listed under /proc/sys/.
2823 Note that not all sysctls are namespaced. Changing Non-namespaced
2824 sysctls will cause the system-wide setting to be modified.
2825 -->
2826 設定したいカーネルパラメータを指定します。指定できるパラメータは /proc/sys 以下に存在するものです。
2827 すべての sysctl パラメータが仮想化(名前空間化)されているわけではないことに注意してください。仮想化されていない sysctl を設定すると、システムワイドで設定が変更されてしまいます。
2828 <citerefentry>
2829 <refentrytitle><command>sysctl</command></refentrytitle>
2830 <manvolnum>8</manvolnum>
2831 </citerefentry>.
2832 <!--
2833 If used with no value, lxc will clear the parameters specified up
2834 to this point.
2835 -->
2836 値を指定しないでこの設定を指定した場合は、この設定より前に設定されたパラメータをクリアします。
2837 </para>
2838 </listitem>
2839 </varlistentry>
2840 </variablelist>
2841 </refsect2>
2842
2843 <refsect2>
2844 <title><!-- Apparmor profile -->Apparmor プロファイル</title>
2845 <para>
2846 <!--
2847 If lxc was compiled and installed with apparmor support, and the host
2848 system has apparmor enabled, then the apparmor profile under which the
2849 container should be run can be specified in the container
2850 configuration. The default is <command>lxc-container-default-cgns</command>
2851 if the host kernel is cgroup namespace aware, or
2852 <command>lxc-container-default</command> otherwise.
2853 -->
2854 lxc が apparmor サポートでコンパイルされ、インストールされている場合で、ホストで apparmor が有効な場合、コンテナが従って動くべき apparmor プロファイルは、コンテナの設定で指定することが可能です。
2855 デフォルトは、ホストのカーネルで cgroup 名前空間が使える場合は <command>lxc-container-default-cgns</command>です。使えない場合は <command>lxc-container-default</command> です。
2856 </para>
2857 <variablelist>
2858 <varlistentry>
2859 <term>
2860 <option>lxc.apparmor.profile</option>
2861 </term>
2862 <listitem>
2863 <para>
2864 <!--
2865 Specify the apparmor profile under which the container should
2866 be run. To specify that the container should be unconfined,
2867 use
2868 -->
2869 コンテナが従うべき apparmor プロファイルを指定します。
2870 コンテナが apparmor による制限を受けないように設定するには、以下のように設定します。
2871 </para>
2872 <programlisting>lxc.apparmor.profile = unconfined</programlisting>
2873 <para>
2874 <!--
2875 If the apparmor profile should remain unchanged (i.e. if you
2876 are nesting containers and are already confined), then use
2877 -->
2878 もし apparmor プロファイルが変更されないままでなくてはならない場合 (ネストしたコンテナである場合や、すでに confined されている場合) は以下のように設定します。
2879 </para>
2880 <programlisting>lxc.apparmor.profile = unchanged</programlisting>
2881 <para>
2882 <!--
2883 If you instruct LXC to generate the apparmor profile,
2884 then use
2885 -->
2886 もし LXC に AppArmor プロファイルを生成するように指示するには次のように設定します。
2887 </para>
2888 <programlisting>lxc.apparmor.profile = generated</programlisting>
2889 </listitem>
2890 </varlistentry>
2891 <varlistentry>
2892 <term>
2893 <option>lxc.apparmor.allow_incomplete</option>
2894 </term>
2895 <listitem>
2896 <para>
2897 <!--
2898 Apparmor profiles are pathname based. Therefore many file
2899 restrictions require mount restrictions to be effective against
2900 a determined attacker. However, these mount restrictions are not
2901 yet implemented in the upstream kernel. Without the mount
2902 restrictions, the apparmor profiles still protect against accidental
2903 damager.
2904 -->
2905 apparmor プロファイルはパス名ベースですので、多数のファイルの制限を行う際、執念深い攻撃者に対して効果的であるためにはマウントの制限が必要です。
2906 しかし、これらのマウントの制限は upstream のカーネルではまだ実装されていません。マウントの制限なしでも、apparmor プロファイルによって予想外のダメージに対する保護が可能です。
2907 </para>
2908 <para>
2909 <!--
2910 If this flag is 0 (default), then the container will not be
2911 started if the kernel lacks the apparmor mount features, so that a
2912 regression after a kernel upgrade will be detected. To start the
2913 container under partial apparmor protection, set this flag to 1.
2914 -->
2915 このフラグが 0 の場合 (デフォルト)、カーネルが apparmor のマウント機能をサポートしていない場合にコンテナが起動しません。これはカーネルを更新した後に機能が退行したことが検出できるようにするためです。
2916 不完全な apparmor の保護の下でコンテナを起動するためには、このフラグを 1 に設定してください。
2917 </para>
2918 </listitem>
2919 </varlistentry>
2920
2921 <varlistentry>
2922 <term>
2923 <option>lxc.apparmor.allow_nesting</option>
2924 </term>
2925 <listitem>
2926 <para>
2927 <!--
2928 If set this to 1, causes the following changes. When
2929 generated apparmor profiles are used, they will contain
2930 the necessary changes to allow creating a nested
2931 container. In addition to the usual mount points,
2932 <filename>/dev/.lxc/proc</filename>
2933 and <filename>/dev/.lxc/sys</filename> will contain
2934 procfs and sysfs mount points without the lxcfs
2935 overlays, which, if generated apparmor profiles are
2936 being used, will not be read/writable directly.
2937 -->
2938 1 に設定すると次のような変更が行われます。
2939 generated な AppArmor プロファイルが使われる場合、ネストしたコンテナを使うのに必要な変更が含まれます。通常のマウントポイントに加えて、lxcfs のオーバーレイなしで、<filename>/dev/.lxc/proc</filename> と <filename>/dev/.lxc/sys</filename> が procfs と sysfs のマウントポイントに含まれます。
2940 generated な AppArmor プロファイルが使われている場合は、直接読み書きはできません
2941 </para>
2942 </listitem>
2943 </varlistentry>
2944
2945 <varlistentry>
2946 <term>
2947 <option>lxc.apparmor.raw</option>
2948 </term>
2949 <listitem>
2950 <para>
2951 <!--
2952 A list of raw AppArmor profile lines to append to the
2953 profile. Only valid when using generated profiles.
2954 -->
2955 プロファイルに加える、生の AppArmor プロファイル行のリストです。generated なプロファイルを使っているときのみ有効です。
2956 </para>
2957 </listitem>
2958 </varlistentry>
2959
2960 </variablelist>
2961 </refsect2>
2962
2963 <refsect2>
2964 <title><!-- SELinux context -->SELinux コンテキスト</title>
2965 <para>
2966 <!--
2967 If lxc was compiled and installed with SELinux support, and the host
2968 system has SELinux enabled, then the SELinux context under which the
2969 container should be run can be specified in the container
2970 configuration. The default is <command>unconfined_t</command>,
2971 which means that lxc will not attempt to change contexts.
2972 See @DATADIR@/lxc/selinux/lxc.te for an example policy and more
2973 information.
2974 -->
2975 lxc が SELinux サポートでコンパイルされ、インストールされている場合で、ホストで SELinux が有効な場合、コンテナが従って動くべき SELinux コンテキストは、コンテナの設定で指定することが可能です。
2976 デフォルトは <command>unconfined_t</command> であり、これは lxc がコンテキストを変えないという意味になります。
2977 ポリシーの例と追加の情報は @DATADIR@/lxc/selinux/lxc.te ファイルを参照してください。
2978 </para>
2979 <variablelist>
2980 <varlistentry>
2981 <term>
2982 <option>lxc.selinux.context</option>
2983 </term>
2984 <listitem>
2985 <para>
2986 <!--
2987 Specify the SELinux context under which the container should
2988 be run or <command>unconfined_t</command>. For example
2989 -->
2990 コンテナが従うべき SELinux コンテキストを指定するか、<command>unconfined_t</command> を指定します。例えば以下のように設定します。
2991 </para>
2992 <programlisting>lxc.selinux.context = system_u:system_r:lxc_t:s0:c22</programlisting>
2993 </listitem>
2994 </varlistentry>
2995 <varlistentry>
2996 <term>
2997 <option>lxc.selinux.context.keyring</option>
2998 </term>
2999 <listitem>
3000 <para>
3001 <!--
3002 Specify the SELinux context under which the container's keyring
3003 should be created. By default this the same as lxc.selinux.context, or
3004 the the context lxc is executed under if lxc.selinux.context has not been set.
3005 -->
3006 コンテナのキーリングを作成する SELinux コンテキストを指定します。
3007 デフォルトでは lxc.selinux.context と同じになります。
3008 lxc.selinux.context が設定されていない場合は、LXC のコンテキストで実行されます。
3009 </para>
3010 <programlisting>lxc.selinux.context.keyring = system_u:system_r:lxc_t:s0:c22</programlisting>
3011 </listitem>
3012 </varlistentry>
3013 </variablelist>
3014 </refsect2>
3015
3016 <refsect2>
3017 <title>カーネルキーリング<!-- Kernel Keyring --></title>
3018 <para>
3019 <!--
3020 The Linux Keyring facility is primarily a way for various
3021 kernel components to retain or cache security data, authentication
3022 keys, encryption keys, and other data in the kernel. By default lxc
3023 will create a new session keyring for the started application.
3024 -->
3025 Linux キーリング機能は、さまざまなカーネルコンポーネントが、セキュリティーデータ、認証キー、暗号化キー、その他のデータをカーネルに保持またはキャッシュするための機能です。
3026 デフォルトでは、LXC は開始したアプリケーションのために、新しいセッションキーリングを作成します。
3027 </para>
3028 <variablelist>
3029 <varlistentry>
3030 <term>
3031 <option>lxc.keyring.session</option>
3032 </term>
3033 <listitem>
3034 <para>
3035 <!--
3036 Disable the creation of new session keyring by lxc. The started
3037 application will then inherit the current session keyring.
3038 By default, or when passing the value 1, a new keyring will be created.
3039 -->
3040 LXC による新しいセッションキーリングの作成を無効にできます。その場合、開始したアプリケーションは、その時点のセッションキーリングを継承します。
3041 デフォルトは 1 で、1 の場合は LXC は新しいキーリングを作成します。
3042 </para>
3043 <programlisting>lxc.keyring.session = 0</programlisting>
3044 </listitem>
3045 </varlistentry>
3046 </variablelist>
3047 </refsect2>
3048
3049 <refsect2>
3050 <title><!-- Seccomp configuration -->Seccomp の設定</title>
3051 <para>
3052 <!--
3053 A container can be started with a reduced set of available
3054 system calls by loading a seccomp profile at startup. The
3055 seccomp configuration file must begin with a version number
3056 on the first line, a policy type on the second line, followed
3057 by the configuration.
3058 -->
3059 コンテナは、起動時に seccomp プロファイルをロードすることで、利用可能なシステムコールを減らして起動することが可能です。
3060 seccomp の設定ファイルは、1 行目がバージョン番号、2 行目がポリシーのタイプで始まる必要があり、その後に設定を書きます。
3061 </para>
3062 <para>
3063 <!--
3064 Versions 1 and 2 are currently supported. In version 1, the
3065 policy is a simple allowlist. The second line therefore must
3066 read "allowlist", with the rest of the file containing one (numeric)
3067 syscall number per line. Each syscall number is allowlisted,
3068 while every unlisted number is denylisted for use in the container
3069 -->
3070 現時点では、バージョン番号は 1 と 2 をサポートしています。バージョン 1 では、ポリシーはシンプルなホワイトリストですので、2 行目は "allowlist" でなければなりません。
3071 そして残りの行には 1 行に 1 つずつ、システムコール番号を書きます。各行のシステムコール番号がホワイトリスト化され、リストにない番号は、そのコンテナではブラックリストに入ります。
3072 </para>
3073
3074 <para>
3075 <!--
3076 In version 2, the policy may be denylist or allowlist,
3077 supports per-rule and per-policy default actions, and supports
3078 per-architecture system call resolution from textual names.
3079 -->
3080 バージョン 2 では、ポリシーはブラックリストもしくはホワイトリストで表され、ルールごとのアクションと、ポリシーごとのデフォルトのアクションを設定できます。そして、アーキテクチャごとの設定と、テキストで書かれたシステムコール名での設定が可能です。
3081 </para>
3082 <para>
3083 <!--
3084 An example denylist policy, in which all system calls are
3085 allowed except for mknod, which will simply do nothing and
3086 return 0 (success), looks like:
3087 -->
3088 以下にブラックリストのポリシーの例を示します。これは mknod 以外の全てのシステムコールが許可され、mknod が呼ばれると、何もせずに単に 0(成功) を返します。
3089 </para>
3090
3091 <programlisting>
3092 2
3093 denylist
3094 mknod errno 0
3095 ioctl notify
3096 </programlisting>
3097
3098 <para>
3099 <!--
3100 Specifying "errno" as action will cause LXC to register a seccomp filter
3101 that will cause a specific errno to be returned to the caller. The errno
3102 value can be specified after the "errno" action word.
3103 -->
3104 アクションとして "errno" を指定すると、LXC は seccomp フィルタを登録します。これにより、指定した errno を呼び出し元に返します。
3105 errno の値は "errno" という単語の後に指定します。
3106 </para>
3107
3108 <para>
3109 <!--
3110 Specifying "notify" as action will cause LXC to register a seccomp
3111 listener and retrieve a listener file descriptor from the kernel. When a
3112 syscall is made that is registered as "notify" the kernel will generate a
3113 poll event and send a message over the file descriptor. The caller can
3114 read this message, inspect the syscalls including its arguments. Based on
3115 this information the caller is expected to send back a message informing
3116 the kernel which action to take. Until that message is sent the kernel
3117 will block the calling process. The format of the messages to read and
3118 sent is documented in seccomp itself.
3119 -->
3120 アクションとして "notify" を指定すると、LXC は seccomp リスナーを登録し、カーネルからリスナーのファイルディスクリプタを取得します。
3121 "notify" として指定しているシステムコールが作成されると、カーネルは poll イベントを生成し、ファイルディスクリプタを通してメッセージを送信します。
3122 呼び出し元はこのメッセージを読み、引数を含めてシステムコールを調査できます。
3123 呼び出し元はこの情報に基づき、どのアクションを取るべきかをカーネルに知らせるメッセージを送り返すことが期待されます。
3124 このメッセージが送られるまで、カーネルは呼び出し元のプロセスをブロックします。読み書きするメッセージのフォーマットは seccomp 自身に記述されています。
3125 </para>
3126
3127 <variablelist>
3128 <varlistentry>
3129 <term>
3130 <option>lxc.seccomp.profile</option>
3131 </term>
3132 <listitem>
3133 <para>
3134 <!--
3135 Specify a file containing the seccomp configuration to
3136 load before the container starts.
3137 -->
3138 コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します。
3139 </para>
3140 </listitem>
3141 </varlistentry>
3142 <varlistentry>
3143 <term>
3144 <option>lxc.seccomp.allow_nesting</option>
3145 </term>
3146 <listitem>
3147 <para>
3148 <!--
3149 If this flag is set to 1, then seccomp filters will be stacked
3150 regardless of whether a seccomp profile is already loaded.
3151 This allows nested containers to load their own seccomp profile.
3152 The default setting is 0.
3153 -->
3154 このオプションを 1 に設定すると、すでに seccomp プロファイルがロードされている、いないに関わらず、seccomp フィルタが重ね合わせられます。
3155 これにより、ネストされたコンテナが自身の seccomp プロファイルをロードできます。
3156 デフォルト値は 0 です。
3157 </para>
3158 </listitem>
3159 </varlistentry>
3160 <varlistentry>
3161 <term>
3162 <option>lxc.seccomp.notify.proxy</option>
3163 </term>
3164 <listitem>
3165 <para>
3166 <!--
3167 Specify a unix socket to which LXC will connect and forward
3168 seccomp events to. The path must be in the form
3169 unix:/path/to/socket or unix:@socket. The former specifies a
3170 path-bound unix domain socket while the latter specifies an
3171 abstract unix domain socket.
3172 -->
3173 LXC が接続し、seccomp イベントを転送する UNIX ソケットを指定します。
3174 パスは unix:/path/to/socket もしくは unix:@socket の形式でなければなりません。
3175 前者はパス指定の UNIX ドメインソケットを指定し、後者は抽象 (abstract) UNIX ドメインソケットの指定です。
3176 </para>
3177 </listitem>
3178 </varlistentry>
3179 <varlistentry>
3180 <term>
3181 <option>lxc.seccomp.notify.cookie</option>
3182 </term>
3183 <listitem>
3184 <para>
3185 <!--
3186 An additional string sent along with proxied seccomp notification
3187 requests.
3188 -->
3189 プロキシーされた seccomp 通知リクエストと一緒に送る追加文字列。
3190 </para>
3191 </listitem>
3192 </varlistentry>
3193 </variablelist>
3194 </refsect2>
3195
3196 <refsect2>
3197 <title>PR_SET_NO_NEW_PRIVS</title>
3198 <para>
3199 <!--
3200 With PR_SET_NO_NEW_PRIVS active execve() promises not to grant
3201 privileges to do anything that could not have been done without
3202 the execve() call (for example, rendering the set-user-ID and
3203 set-group-ID mode bits, and file capabilities non-functional).
3204 Once set, this bit cannot be unset. The setting of this bit is
3205 inherited by children created by fork() and clone(), and preserved
3206 across execve().
3207 Note that PR_SET_NO_NEW_PRIVS is applied after the container has
3208 changed into its intended AppArmor profile or SElinux context.
3209 -->
3210 PR_SET_NO_NEW_PRIVS を付与すると、対象の execve() は、execve() の呼び出しなしでは実行できなかったことに対する特権を許可しなくなります (例えば、set-user-ID、set-group-ID 許可ビットや、ファイルケーパビリティが動作しなくなります)。
3211 一度設定されると、このビットは解除できません。このビットの設定は fork() や clone() で生成される子プロセスにも継承され、execve() の前後で保持されます。
3212 PR_SET_NO_NEW_PRIVS は、コンテナに適用しようとする AppArmor プロファイルもしくは SELinux コンテキストへの変更がなされたあとに適用されます。
3213 </para>
3214 <variablelist>
3215 <varlistentry>
3216 <term>
3217 <option>lxc.no_new_privs</option>
3218 </term>
3219 <listitem>
3220 <para>
3221 <!--
3222 Specify whether the PR_SET_NO_NEW_PRIVS flag should be set for the
3223 container. Set to 1 to activate.
3224 -->
3225 コンテナに対して PR_SET_NO_NEW_PRIVS ビットを設定するかどうかを指定します。1 に設定すると有効になります。
3226 </para>
3227 </listitem>
3228 </varlistentry>
3229 </variablelist>
3230 </refsect2>
3231
3232 <refsect2>
3233 <title><!-- UID mappings -->UID のマッピング</title>
3234 <para>
3235 <!--
3236 A container can be started in a private user namespace with
3237 user and group id mappings. For instance, you can map userid
3238 0 in the container to userid 200000 on the host. The root
3239 user in the container will be privileged in the container,
3240 but unprivileged on the host. Normally a system container
3241 will want a range of ids, so you would map, for instance,
3242 user and group ids 0 through 20,000 in the container to the
3243 ids 200,000 through 220,000.
3244 -->
3245 コンテナは、ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です。
3246 たとえば、コンテナ内のユーザ id 0 を、ホストのユーザ id 200000 にマッピングすることが可能です。
3247 コンテナの root ユーザはコンテナ内では特権を持ちますが、ホストでは特権を持ちません。
3248 通常は、システムコンテナは id の範囲を要求し、それをマッピングします。
3249 例えば、コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします。
3250 </para>
3251 <variablelist>
3252 <varlistentry>
3253 <term>
3254 <option>lxc.idmap</option>
3255 </term>
3256 <listitem>
3257 <para>
3258 <!--
3259 Four values must be provided. First a character, either
3260 'u', or 'g', to specify whether user or group ids are
3261 being mapped. Next is the first userid as seen in the
3262 user namespace of the container. Next is the userid as
3263 seen on the host. Finally, a range indicating the number
3264 of consecutive ids to map.
3265 -->
3266 4 つの値を記述する必要があります。
3267 最初の文字は 'u' か 'g' のどちらかで、ユーザかグループの ID のどちらをマッピングするかを指定します。
3268 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です。
3269 その次は、そのユーザ ID のホスト上での値です。
3270 最後は、ID のマッピングをいくつ連続して行うかの数を指定します。
3271 </para>
3272 </listitem>
3273 </varlistentry>
3274 </variablelist>
3275 </refsect2>
3276
3277 <refsect2>
3278 <title><!-- Container hooks -->コンテナのフック</title>
3279 <para>
3280 <!--
3281 Container hooks are programs or scripts which can be executed
3282 at various times in a container's lifetime.
3283 -->
3284 コンテナのフックは、コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです。
3285 </para>
3286 <para>
3287 <!--
3288 When a container hook is executed, additional information is passed
3289 along. The <option>lxc.hook.version</option> argument can be used to
3290 determine if the following arguments are passed as command line
3291 arguments or through environment variables. The arguments are:
3292 -->
3293 コンテナフックが実行されるとき、追加の情報が渡されます。追加の引数がコマンドライン引数で渡されるか、環境変数経由で渡されるかを判断するのに、<option>lxc.hook.version</option> が使えます。引数は:
3294 <itemizedlist>
3295 <listitem><para> コンテナ名 <!-- Container name.--></para></listitem>
3296 <listitem><para> セクション (常に 'lxc') <!-- Section (always 'lxc'). --></para></listitem>
3297 <listitem><para> フックのタイプ ('clone' や 'pre-mount' など) <!-- The hook type (i.e. 'clone' or 'pre-mount'). --></para></listitem>
3298 <listitem><para> 追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。stop フックの場合は、コンテナの名前空間のそれぞれに対するファイルディスクリプタへのパスが、名前空間名とともに渡されます。 <!-- Additional arguments. In the
3299 case of the clone hook, any extra arguments passed to
3300 lxc-clone will appear as further arguments to the hook.
3301 In the case of the stop hook, paths to filedescriptors
3302 for each of the container's namespaces along with their types
3303 are passed. --></para></listitem>
3304 </itemizedlist>
3305 <!--
3306 The following environment variables are set:
3307 -->
3308 次の環境変数がセットされます。
3309 <itemizedlist>
3310 <listitem><para> LXC_CGNS_AWARE: コンテナで cgroup namespace が使えるかどうか <!-- indicator whether the container is
3311 cgroup namespace aware. --></para></listitem>
3312 <listitem><para> LXC_CONFIG_FILE: コンテナの設定ファイルのパス <!-- the path to the container
3313 configuration file. --></para></listitem>
3314 <listitem><para> LXC_HOOK_TYPE: フックのタイプ (例えば 'clone'、'mount'、'pre-mount')。この環境変数が存在するかどうかは <option>lxc.hook.version</option> の値次第です。この値が 1 なら、LXC_HOOK_TYPE が設定されています。
3315 <!-- the hook type (e.g. 'clone', 'mount',
3316 'pre-mount'). Note that the existence of this environment variable is
3317 conditional on the value of <option>lxc.hook.version</option>. If it
3318 is set to 1 then LXC_HOOK_TYPE will be set. -->
3319 </para></listitem>
3320 <listitem><para> LXC_HOOK_SECTION: セクションタイプ (例えば 'lxc'、'net')。この環境変数が存在するかどうかは <option>lxc.hook.version</option> の値次第です。この値が 1 なら、LXC_HOOK_TYPE が設定されています。
3321 <!-- the section type (e.g. 'lxc',
3322 'net'). Note that the existence of this environment variable is
3323 conditional on the value of <option>lxc.hook.version</option>. If it
3324 is set to 1 then LXC_HOOK_SECTION will be set. -->
3325 </para></listitem>
3326 <listitem><para> LXC_HOOK_VERSION: フックのバージョン。この値は、コンテナの <option>lxc.hook.version</option> の値と同じです。もし、この値が 0 に設定されているなら、古いスタイルのフックが使われます。もし 1 に設定されているなら、新しいスタイルのフックが使われます。
3327 <!-- the version of the hooks. This
3328 value is identical to the value of the container's
3329 <option>lxc.hook.version</option> config item. If it is set to 0 then
3330 old-style hooks are used. If it is set to 1 then new-style hooks are
3331 used. --></para></listitem>
3332 <listitem><para> LXC_LOG_LEVEL: コンテナのログレベル <!-- the container's log level. --></para></listitem>
3333 <listitem><para> LXC_NAME: コンテナ名 <!-- is the container's name. --></para></listitem>
3334 <listitem><para> LXC_[NAMESPACE IDENTIFIER]_NS: コンテナの名前空間が参照する /proc/PID/fd/ 以下のファイルディスクリプタのパス。それぞれの名前空間ごとに別々の環境変数になります。これらの環境変数は <option>lxc.hook.version</option> が 1 に設定されてる場合のみ設定されます。
3335 <!-- path under
3336 /proc/PID/fd/ to a file descriptor referring to the container's
3337 namespace. For each preserved namespace type there will be a separate
3338 environment variable. These environment variables will only be set if
3339 <option>lxc.hook.version</option> is set to 1. --></para></listitem>
3340 <listitem><para> LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス <!-- the path to the mounted root filesystem. --></para></listitem>
3341 <listitem><para> LXC_ROOTFS_PATH: コンテナの lxc.rootfs.path エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。 <!-- this is the lxc.rootfs.path entry
3342 for the container. Note this is likely not where the mounted rootfs is
3343 to be found, use LXC_ROOTFS_MOUNT for that. --></para></listitem>
3344 <listitem><para> LXC_SRC_NAME: clone フックの場合、元のコンテナの名前 <!-- in the case of the clone hook, this is
3345 the original container's name. --></para></listitem>
3346 </itemizedlist>
3347 </para>
3348 <para>
3349 <!--
3350 Standard output from the hooks is logged at debug level.
3351 Standard error is not logged, but can be captured by the
3352 hook redirecting its standard error to standard output.
3353 -->
3354 スクリプトからの標準出力は debug レベルでロギングされます。
3355 標準エラー出力はロギングされません。
3356 しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。
3357 </para>
3358 <variablelist>
3359 <varlistentry>
3360 <term>
3361 <option>lxc.hook.version</option>
3362 </term>
3363 <listitem>
3364 <para>
3365 <!--
3366 To pass the arguments in new style via environment variables set to
3367 1 otherwise set to 0 to pass them as arguments.
3368 This setting affects all hooks arguments that were traditionally
3369 passed as arguments to the script. Specifically, it affects the
3370 container name, section (e.g. 'lxc', 'net') and hook type (e.g.
3371 'clone', 'mount', 'pre-mount') arguments. If new-style hooks are
3372 used then the arguments will be available as environment variables.
3373 The container name will be set in LXC_NAME. (This is set
3374 independently of the value used for this config item.) The section
3375 will be set in LXC_HOOK_SECTION and the hook type will be set in
3376 LXC_HOOK_TYPE.
3377 It also affects how the paths to file descriptors referring to the
3378 container's namespaces are passed. If set to 1 then for each
3379 namespace a separate environment variable LXC_[NAMESPACE
3380 IDENTIFIER]_NS will be set. If set to 0 then the paths will be
3381 passed as arguments to the stop hook.
3382 -->
3383 環境変数経由の新しいスタイルで引数を渡すには 1 に設定します。そうでなく、引数として渡すには 0 に設定します。この設定は、古い方法でスクリプトに引数として渡されているすべてのフック引数に影響します。特に、コンテナ名のセクション (例: 'lxc', 'net') とフックタイプ (例: 'clone', 'mount', 'pre-mount') 引数に影響します。新しいスタイルのフックが使われる場合、引数は環境変数として利用できます。
3384 コンテナ名は LXC_NAME に設定されます(これはこの設定項目に設定されている値とは関係なく設定されます)。セクションは LXC_HOOK_SECTION に設定されます。そしてフックタイプは LXC_HOOK_TYPE に設定されます。
3385 この設定は、コンテナの名前空間を参照するファイルディスクリプタのパスをどのように渡すかにも影響します。1 に設定した場合、名前空間ごとに別の環境変数 LXC_[NAMESPACE IDENTIFIER]_NS に設定されます。0 に設定すると、パスは stop フックの引数として渡されます。
3386 </para>
3387 </listitem>
3388 </varlistentry>
3389 </variablelist>
3390 <variablelist>
3391 <varlistentry>
3392 <term>
3393 <option>lxc.hook.pre-start</option>
3394 </term>
3395 <listitem>
3396 <para>
3397 <!--
3398 A hook to be run in the host's namespace before the
3399 container ttys, consoles, or mounts are up.
3400 -->
3401 コンテナの tty、コンソールの作成、マウントが実行される前に、ホストの名前空間内で実行するフック。
3402 </para>
3403 </listitem>
3404 </varlistentry>
3405 </variablelist>
3406 <variablelist>
3407 <varlistentry>
3408 <term>
3409 <option>lxc.hook.pre-mount</option>
3410 </term>
3411 <listitem>
3412 <para>
3413 <!--
3414 A hook to be run in the container's fs namespace but before
3415 the rootfs has been set up. This allows for manipulation
3416 of the rootfs, i.e. to mount an encrypted filesystem. Mounts
3417 done in this hook will not be reflected on the host (apart from
3418 mounts propagation), so they will be automatically cleaned up
3419 when the container shuts down.
3420 -->
3421 コンテナのファイルシステムの名前空間で実行されますが、rootfs が設定される前に実行するフック。
3422 これにより rootfs の操作が可能になります。
3423 例えば、暗号化されたファイルシステムのマウントなどです。
3424 このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて)。
3425 なので、それらはコンテナがシャットダウンする時に自動的にクリーンアップされます。
3426 </para>
3427 </listitem>
3428 </varlistentry>
3429 </variablelist>
3430 <variablelist>
3431 <varlistentry>
3432 <term>
3433 <option>lxc.hook.mount</option>
3434 </term>
3435 <listitem>
3436 <para>
3437 <!--
3438 A hook to be run in the container's namespace after
3439 mounting has been done, but before the pivot_root.
3440 -->
3441 マウントが完了した後ですが、pivot_root の前にコンテナの名前空間で実行されるフック。
3442 </para>
3443 </listitem>
3444 </varlistentry>
3445 </variablelist>
3446 <variablelist>
3447 <varlistentry>
3448 <term>
3449 <option>lxc.hook.autodev</option>
3450 </term>
3451 <listitem>
3452 <para>
3453 <!--
3454 A hook to be run in the container's namespace after
3455 mounting has been done and after any mount hooks have
3456 run, but before the pivot_root, if
3457 <option>lxc.autodev</option> == 1.
3458 The purpose of this hook is to assist in populating the
3459 /dev directory of the container when using the autodev
3460 option for systemd based containers. The container's /dev
3461 directory is relative to the
3462 ${<option>LXC_ROOTFS_MOUNT</option>} environment
3463 variable available when the hook is run.
3464 -->
3465 <option>lxc.autodev</option> == 1 が設定されている場合で、マウントが完了し、マウント時のフックも実行された後ですが、pivot_root の前にコンテナの名前空間で実行するフック。
3466 このフックの目的は、systemd ベースのコンテナ向けの autodev オプションが設定されている時に、コンテナの /dev ディレクトリを設定するのを支援することです。コンテナの /dev ディレクトリは、このフックが実行される時有効な ${<option>LXC_ROOTFS_MOUNT</option>} 環境変数からの相対パスとなります。
3467 </para>
3468 </listitem>
3469 </varlistentry>
3470 </variablelist>
3471 <variablelist>
3472 <varlistentry>
3473 <term>
3474 <option>lxc.hook.start-host</option>
3475 </term>
3476 <listitem>
3477 <para>
3478 <!--
3479 A hook to be run in the host's namespace after the
3480 container has been setup, and immediately before starting
3481 the container init.
3482 -->
3483 コンテナのセットアップが済んだあと、コンテナの init を実行する直前に、ホストの名前空間で実行するためのフックです。
3484 </para>
3485 </listitem>
3486 </varlistentry>
3487 </variablelist>
3488 <variablelist>
3489 <varlistentry>
3490 <term>
3491 <option>lxc.hook.start</option>
3492 </term>
3493 <listitem>
3494 <para>
3495 <!--
3496 A hook to be run in the container's namespace immediately
3497 before executing the container's init. This requires the
3498 program to be available in the container.
3499 -->
3500 コンテナの init が実行される直前にコンテナの名前空間で実行されるフック。
3501 コンテナ内で利用可能なプログラムである必要があります。
3502 </para>
3503 </listitem>
3504 </varlistentry>
3505 </variablelist>
3506 <variablelist>
3507 <varlistentry>
3508 <term>
3509 <option>lxc.hook.stop</option>
3510 </term>
3511 <listitem>
3512 <para>
3513 <!--
3514 A hook to be run in the host's namespace with references
3515 to the container's namespaces after the container has been shut
3516 down. For each namespace an extra argument is passed to the hook
3517 containing the namespace's type and a filename that can be used to
3518 obtain a file descriptor to the corresponding namespace, separated
3519 by a colon. The type is the name as it would appear in the
3520 <filename>/proc/PID/ns</filename> directory.
3521 For instance for the mount namespace the argument usually looks
3522 like <filename>mnt:/proc/PID/fd/12</filename>.
3523 -->
3524 コンテナのシャットダウン後、コンテナの名前空間への参照とともに、ホストの名前空間で実行されるフックです。
3525 それぞれの名前空間に対応する追加の引数がフックに渡されます。その引数にはコロンで区切られた名前空間のタイプ名とファイル名が含まれており、ファイル名は名前空間に対するファイルディスクリプタを取得するのに使えます。
3526 タイプ名は <filename>/proc/PID/ns</filename> ディレクトリ内のファイル名です。
3527 例えば、マウント名前空間に対応する引数は通常は <filename>mnt:/proc/PID/fd/12</filename> のようになります。
3528 </para>
3529 </listitem>
3530 </varlistentry>
3531 </variablelist>
3532 <variablelist>
3533 <varlistentry>
3534 <term>
3535 <option>lxc.hook.post-stop</option>
3536 </term>
3537 <listitem>
3538 <para>
3539 <!--
3540 A hook to be run in the host's namespace after the
3541 container has been shut down.
3542 -->
3543 コンテナがシャットダウンされた後にホストの名前空間で実行するフック。
3544 </para>
3545 </listitem>
3546 </varlistentry>
3547 </variablelist>
3548 <variablelist>
3549 <varlistentry>
3550 <term>
3551 <option>lxc.hook.clone</option>
3552 </term>
3553 <listitem>
3554 <para>
3555 <!--
3556 A hook to be run when the container is cloned to a new one.
3557 See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
3558 <manvolnum>1</manvolnum></citerefentry> for more information.
3559 -->
3560 コンテナが新しいコンテナにクローンされる際に実行されるフック。詳しくは
3561 <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle>
3562 <manvolnum>1</manvolnum></citerefentry>
3563 を参照してください。
3564 </para>
3565 </listitem>
3566 </varlistentry>
3567 </variablelist>
3568 <variablelist>
3569 <varlistentry>
3570 <term>
3571 <option>lxc.hook.destroy</option>
3572 </term>
3573 <listitem>
3574 <para>
3575 <!--
3576 A hook to be run when the container is destroyed.
3577 -->
3578 コンテナを破壊する際に実行されるフックです。
3579 </para>
3580 </listitem>
3581 </varlistentry>
3582 </variablelist>
3583 </refsect2>
3584
3585 <refsect2>
3586 <title><!-- Container hooks Environment Variables -->コンテナのフックで使える環境変数</title>
3587 <para>
3588 <!--
3589 A number of environment variables are made available to the startup
3590 hooks to provide configuration information and assist in the
3591 functioning of the hooks. Not all variables are valid in all
3592 contexts. In particular, all paths are relative to the host system
3593 and, as such, not valid during the <option>lxc.hook.start</option> hook.
3594 -->
3595 起動時のフックに設定情報を提供し、フックの機能を助けるための環境変数がいくつか利用可能です。
3596 全ての変数が全てのコンテキストで利用可能なわけではありません。
3597 具体的には、全てのパスはホストシステム上のパスであり、そのため、<option>lxc.hook.start</option> フックの時点では使用できません。
3598 </para>
3599 <variablelist>
3600 <varlistentry>
3601 <term>
3602 <option>LXC_NAME</option>
3603 </term>
3604 <listitem>
3605 <para>
3606 <!--
3607 The LXC name of the container. Useful for logging messages
3608 in common log environments. [<option>-n</option>]
3609 -->
3610 LXC コンテナの名前。共通のログ環境内でのログメッセージに使うときに便利です。[<option>-n</option>]
3611 </para>
3612 </listitem>
3613 </varlistentry>
3614 </variablelist>
3615 <variablelist>
3616 <varlistentry>
3617 <term>
3618 <option>LXC_CONFIG_FILE</option>
3619 </term>
3620 <listitem>
3621 <para>
3622 <!--
3623 Host relative path to the container configuration file. This
3624 gives the container to reference the original, top level,
3625 configuration file for the container in order to locate any
3626 additional configuration information not otherwise made
3627 available. [<option>-f</option>]
3628 -->
3629 コンテナの設定ファイルのホスト上でのパス。
3630 これは、他の方法では得られない追加の設定情報を見つけるために、コンテナに、元の、トップレベルの設定ファイルの位置を与えるものです。 [<option>-f</option>]
3631 </para>
3632 </listitem>
3633 </varlistentry>
3634 </variablelist>
3635 <variablelist>
3636 <varlistentry>
3637 <term>
3638 <option>LXC_CONSOLE</option>
3639 </term>
3640 <listitem>
3641 <para>
3642 <!--
3643 The path to the console output of the container if not NULL.
3644 [<option>-c</option>] [<option>lxc.console.path</option>]
3645 -->
3646 設定されている場合のコンテナのコンソール出力のパス。
3647 [<option>-c</option>] [<option>lxc.console.path</option>]
3648 </para>
3649 </listitem>
3650 </varlistentry>
3651 </variablelist>
3652 <variablelist>
3653 <varlistentry>
3654 <term>
3655 <option>LXC_CONSOLE_LOGPATH</option>
3656 </term>
3657 <listitem>
3658 <para>
3659 <!--
3660 The path to the console log output of the container if not NULL.
3661 [<option>-L</option>]
3662 -->
3663 設定されている場合のコンテナのコンソールログ出力のパス。
3664 [<option>-L</option>]
3665 </para>
3666 </listitem>
3667 </varlistentry>
3668 </variablelist>
3669 <variablelist>
3670 <varlistentry>
3671 <term>
3672 <option>LXC_ROOTFS_MOUNT</option>
3673 </term>
3674 <listitem>
3675 <para>
3676 <!--
3677 The mount location to which the container is initially bound.
3678 This will be the host relative path to the container rootfs
3679 for the container instance being started and is where changes
3680 should be made for that instance.
3681 [<option>lxc.rootfs.mount</option>]
3682 -->
3683 初期にコンテナがマウントされる場所。
3684 これは、コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり、インスタンスのための移行が行われる場所です。
3685 [<option>lxc.rootfs.mount</option>]
3686 </para>
3687 </listitem>
3688 </varlistentry>
3689 </variablelist>
3690 <variablelist>
3691 <varlistentry>
3692 <term>
3693 <option>LXC_ROOTFS_PATH</option>
3694 </term>
3695 <listitem>
3696 <para>
3697 <!--
3698 The host relative path to the container root which has been
3699 mounted to the rootfs.mount location.
3700 [<option>lxc.rootfs.path</option>]
3701 -->
3702 rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです。
3703 [<option>lxc.rootfs.path</option>]
3704 </para>
3705 </listitem>
3706 </varlistentry>
3707 </variablelist>
3708 <variablelist>
3709 <varlistentry>
3710 <term>
3711 <option>LXC_SRC_NAME</option>
3712 </term>
3713 <listitem>
3714 <para>
3715 <!--
3716 Only for the clone hook. Is set to the original container name.
3717 -->
3718 clone フックの場合のみ使われます。クローン元のコンテナ名が設定されます。
3719 </para>
3720 </listitem>
3721 </varlistentry>
3722 </variablelist>
3723 <variablelist>
3724 <varlistentry>
3725 <term>
3726 <option>LXC_TARGET</option>
3727 </term>
3728 <listitem>
3729 <para>
3730 <!--
3731 Only for the stop hook. Is set to "stop" for a container
3732 shutdown or "reboot" for a container reboot.
3733 -->
3734 stop フックの場合のみ使われます。コンテナのシャットダウンの場合は "stop"、リブートの場合は "reboot" が設定されます。
3735 </para>
3736 </listitem>
3737 </varlistentry>
3738 </variablelist>
3739 <variablelist>
3740 <varlistentry>
3741 <term>
3742 <option>LXC_CGNS_AWARE</option>
3743 </term>
3744 <listitem>
3745 <para>
3746 <!--
3747 If unset, then this version of lxc is not aware of cgroup
3748 namespaces. If set, it will be set to 1, and lxc is aware
3749 of cgroup namespaces. Note this does not guarantee that
3750 cgroup namespaces are enabled in the kernel. This is used
3751 by the lxcfs mount hook.
3752 -->
3753 この変数が設定されていない場合、お使いのバージョンの LXC は cgroup 名前空間を扱えません。設定されている場合、この値は 1 に設定されています。そして、cgroup 名前空間を扱えます。
3754 この変数はカーネルで cgroup 名前空間が有効であることは保証しません。この変数は lxcfs のマウントフックが使います。
3755 </para>
3756 </listitem>
3757 </varlistentry>
3758 </variablelist>
3759 </refsect2>
3760
3761 <refsect2>
3762 <title><!-- Logging -->ロギング</title>
3763 <para>
3764 <!--
3765 Logging can be configured on a per-container basis. By default,
3766 depending upon how the lxc package was compiled, container startup
3767 is logged only at the ERROR level, and logged to a file named after
3768 the container (with '.log' appended) either under the container path,
3769 or under @LOGPATH@.
3770 -->
3771 ロギングはコンテナごとに設定することが可能です。
3772 デフォルトでは、lxc パッケージのコンパイル条件に依存し、コンテナのスタートアップは ERROR レベルでのみロギングされ、コンテナのパス以下か、@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます。
3773 </para>
3774 <para>
3775 <!--
3776 Both the default log level and the log file can be specified in the
3777 container configuration file, overriding the default behavior. Note
3778 that the configuration file entries can in turn be overridden by the
3779 command line options to <command>lxc-start</command>.
3780 -->
3781 デフォルトのログレベルとログファイルは両方とも、コンテナの設定ファイル内で指定され、デフォルトの値を上書きします。
3782 同様に、設定ファイルのエントリは <command>lxc-start</command> のコマンドラインオプションで上書きすることも可能です。
3783 </para>
3784 <variablelist>
3785 <varlistentry>
3786 <term>
3787 <option>lxc.log.level</option>
3788 </term>
3789 <listitem>
3790 <para>
3791 <!--
3792 The level at which to log. The log level is an integer in
3793 the range of 0..8 inclusive, where a lower number means more
3794 verbose debugging. In particular 0 = trace, 1 = debug, 2 =
3795 info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 =
3796 alert, and 8 = fatal. If unspecified, the level defaults
3797 to 5 (error), so that only errors and above are logged.
3798 -->
3799 ログを取得するレベル。
3800 ログレベルは 0..8 の範囲の整数です。
3801 数字が小さいほど冗長なデバッグを意味します。
3802 具体的には、0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です。
3803 指定されない場合、レベルのデフォルトは 5 (error) で、それ以上のエラーがロギングされます。
3804 </para>
3805 <para>
3806 <!--
3807 Note that when a script (such as either a hook script or a
3808 network interface up or down script) is called, the script's
3809 standard output is logged at level 1, debug.
3810 -->
3811 (フックスクリプトやネットワークインターフェースの起動、停止時のスクリプトのような) スクリプトが呼ばれた時、スクリプトの標準出力は level 1 の debug でロギングされます。
3812 </para>
3813 </listitem>
3814 </varlistentry>
3815 <varlistentry>
3816 <term>
3817 <option>lxc.log.file</option>
3818 </term>
3819 <listitem>
3820 <para>
3821 <!--
3822 The file to which logging info should be written.
3823 -->
3824 ログ情報を書き込むファイル。
3825 </para>
3826 </listitem>
3827 </varlistentry>
3828 <varlistentry>
3829 <term>
3830 <option>lxc.log.syslog</option>
3831 </term>
3832 <listitem>
3833 <para>
3834 <!--
3835 Send logging info to syslog. It respects the log level defined in
3836 <command>lxc.log.level</command>. The argument should be the syslog
3837 facility to use, valid ones are: daemon, local0, local1, local2,
3838 local3, local4, local5, local5, local7.
3839 -->
3840 ログ情報を syslog に送ります。ログレベルとして <command>lxc.log.level</command> の値を使用します。指定する値は使用する syslog の facility です。有効な値は daemon, local0, local1, local2, local3, local4, local5, local5, local6, local7 のいずれかです。
3841 </para>
3842 </listitem>
3843 </varlistentry>
3844 </variablelist>
3845 </refsect2>
3846
3847 <refsect2>
3848 <title><!-- Autostart -->自動起動</title>
3849 <para>
3850 <!--
3851 The autostart options support marking which containers should be
3852 auto-started and in what order. These options may be used by LXC tools
3853 directly or by external tooling provided by the distributions.
3854 -->
3855 自動起動オプションでは、自動起動させるコンテナと順番の設定が可能です。
3856 このオプションは LXC ツールが直接使用するか、ディストリビューションが提供する外部ツールが使用するかもしれません。
3857 </para>
3858
3859 <variablelist>
3860 <varlistentry>
3861 <term>
3862 <option>lxc.start.auto</option>
3863 </term>
3864 <listitem>
3865 <para>
3866 <!--
3867 Whether the container should be auto-started.
3868 Valid values are 0 (off) and 1 (on).
3869 -->
3870 コンテナを自動起動させるかどうかを設定します。
3871 有効な値は 0(オフ) か 1(オン) です。
3872 </para>
3873 </listitem>
3874 </varlistentry>
3875 <varlistentry>
3876 <term>
3877 <option>lxc.start.delay</option>
3878 </term>
3879 <listitem>
3880 <para>
3881 <!--
3882 How long to wait (in seconds) after the container is
3883 started before starting the next one.
3884 -->
3885 コンテナを起動させた後、次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します。
3886 </para>
3887 </listitem>
3888 </varlistentry>
3889 <varlistentry>
3890 <term>
3891 <option>lxc.start.order</option>
3892 </term>
3893 <listitem>
3894 <para>
3895 <!--
3896 An integer used to sort the containers when auto-starting
3897 a series of containers at once. A lower value means an
3898 earlier start.
3899 -->
3900 自動起動させるコンテナが多数ある場合のコンテナの起動順を決めるのに使う整数を指定します。
3901 小さい値ほど早く起動します。
3902 </para>
3903 </listitem>
3904 </varlistentry>
3905 <varlistentry>
3906 <term>
3907 <option>lxc.monitor.unshare</option>
3908 </term>
3909 <listitem>
3910 <para>
3911 <!--
3912 If not zero the mount namespace will be unshared from the host
3913 before initializing the container (before running any pre-start
3914 hooks). This requires the CAP_SYS_ADMIN capability at startup.
3915 Default is 0.
3916 -->
3917 この値が 0 でない場合、コンテナが初期化される前 (pre-start フックが実行される前) にマウント名前空間がホストから unshare されます。この機能を使う場合、スタート時に CAP_SYS_ADMIN ケーパビリティが必要です。デフォルト値は 0 です。
3918 </para>
3919 </listitem>
3920 </varlistentry>
3921 <varlistentry>
3922 <term>
3923 <option>lxc.monitor.signal.pdeath</option>
3924 </term>
3925 <listitem>
3926 <para>
3927 <!--
3928 Set the signal to be sent to the container's init when the lxc
3929 monitor exits. By default it is set to SIGKILL which will cause
3930 all container processes to be killed when the lxc monitor process
3931 dies.
3932 To ensure that containers stay alive even if lxc monitor dies set
3933 this to 0.
3934 -->
3935 lxc のモニタプロセスが終了した際に、コンテナの init プロセスに送出するシグナルを指定します。デフォルトでは、lxc のモニタプロセスが終了した場合には、すべてのコンテナ内のプロセスが停止するように SIGKILL が設定されています。
3936 lxc のモニタプロセスが終了しても、コンテナがすべて確実に動作しつづけるようにするには、この値を 0 に設定します。
3937 </para>
3938 </listitem>
3939 </varlistentry>
3940 <varlistentry>
3941 <term>
3942 <option>lxc.group</option>
3943 </term>
3944 <listitem>
3945 <para>
3946 <!--
3947 A multi-value key (can be used multiple times) to put the
3948 container in a container group. Those groups can then be
3949 used (amongst other things) to start a series of related
3950 containers.
3951 -->
3952 コンテナを追加したいコンテナグループ名を指定します。
3953 複数の値を設定でき、複数回指定することもできます。
3954 設定されたグループは、関連する一連のコンテナを起動させるために使われます。
3955 </para>
3956 </listitem>
3957 </varlistentry>
3958 </variablelist>
3959 </refsect2>
3960
3961 <refsect2>
3962 <title><!-- Autostart and System Boot -->自動起動とシステムブート</title>
3963 <para>
3964 <!--
3965 Each container can be part of any number of groups or no group at all.
3966 Two groups are special. One is the NULL group, i.e. the container does
3967 not belong to any group. The other group is the "onboot" group.
3968 -->
3969 コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。
3970 </para>
3971
3972 <para>
3973 <!--
3974 When the system boots with the LXC service enabled, it will first
3975 attempt to boot any containers with lxc.start.auto == 1 that is a member
3976 of the "onboot" group. The startup will be in order of lxc.start.order.
3977 If an lxc.start.delay has been specified, that delay will be honored
3978 before attempting to start the next container to give the current
3979 container time to begin initialization and reduce overloading the host
3980 system. After starting the members of the "onboot" group, the LXC system
3981 will proceed to boot containers with lxc.start.auto == 1 which are not
3982 members of any group (the NULL group) and proceed as with the onboot
3983 group.
3984 -->
3985 LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。
3986 lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。
3987 "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。
3988 </para>
3989
3990 </refsect2>
3991
3992 <refsect2>
3993 <title><!-- Container Environment -->コンテナの環境変数</title>
3994 <para>
3995 <!--
3996 If you want to pass environment variables into the container (that
3997 is, environment variables which will be available to init and all of
3998 its descendents), you can use <command>lxc.environment</command>
3999 parameters to do so. Be careful that you do not pass in anything
4000 sensitive; any process in the container which doesn't have its
4001 environment scrubbed will have these variables available to it, and
4002 environment variables are always available via
4003 <command>/proc/PID/environ</command>.
4004 -->
4005 コンテナに環境変数を渡したい場合 (環境変数はコンテナの init とその子孫全てで利用可能です)、<command>lxc.environment</command> パラメータがその用途に使えます。
4006 機微 (センシティブ) な情報を渡さないように注意が必要です。そのような情報を持たないコンテナ内のプロセスでこれらの環境変数が利用可能になってしまいます。環境変数は常に <command>/proc/PID/environ</command> 経由で利用可能になります。
4007 </para>
4008
4009 <para>
4010 <!--
4011 Subkeys are available to narrow the scope of environment variables:
4012 <command>lxc.environment.runtime</command> applies only to
4013 the container's init process (and all its descendents),
4014 and <command>lxc.environment.hooks</command> applies only to hooks.
4015 -->
4016 サブキーを使用して、環境変数のスコープを絞り込めます:
4017 <command>lxc.environment.runtime</command> は、コンテナの init プロセス(とそのすべての子孫)にのみ適用されます。そして、<command>lxc.environment.hooks</command> はフックにのみ適用されます。
4018 </para>
4019
4020 <para>
4021 <!--
4022 These configuration parameter can be specified multiple times; once
4023 for each environment variable you wish to configure.
4024 -->
4025 これらの設定項目は、設定したい環境変数ごとに 1 度ずつ、何度でも指定できます。
4026 </para>
4027
4028 <variablelist>
4029 <varlistentry>
4030 <term>
4031 <option>lxc.environment</option>
4032 </term>
4033 <listitem>
4034 <para>
4035 <!--
4036 Environment variables applied both to the container init process
4037 and to hooks. Example:
4038 -->
4039 環境変数は、コンテナの init プロセスとフックの両方に適用されます。
4040 例:
4041 </para>
4042 <programlisting>
4043 lxc.environment = APP_ENV=production
4044 lxc.environment = SYSLOG_SERVER=192.0.2.42
4045 </programlisting>
4046 </listitem>
4047 </varlistentry>
4048
4049 <varlistentry>
4050 <term>
4051 <option>lxc.environment.runtime</option>
4052 </term>
4053 <listitem>
4054 <para>
4055 <!--
4056 Environment variables applied only to the container's init
4057 process.
4058 -->
4059 環境変数はコンテナの init プロセスにのみ適用されます。
4060 </para>
4061 </listitem>
4062 </varlistentry>
4063
4064 <varlistentry>
4065 <term>
4066 <option>lxc.environment.hooks</option>
4067 </term>
4068 <listitem>
4069 <para>
4070 <!--
4071 Environment variables applied only to hooks.
4072 -->
4073 環境変数はフックにのみ適用されます。
4074 </para>
4075 </listitem>
4076 </varlistentry>
4077
4078 </variablelist>
4079 </refsect2>
4080
4081 </refsect1>
4082
4083 <refsect1>
4084 <title><!-- Examples -->例</title>
4085 <para>
4086 <!--
4087 In addition to the few examples given below, you will find
4088 some other examples of configuration file in @DOCDIR@/examples
4089 -->
4090 以下に紹介するいくつかの例に加えて、他の設定例が @DOCDIR@/examples にあります。
4091 </para>
4092 <refsect2>
4093 <title><!-- Network -->ネットワーク</title>
4094 <para>
4095 <!--
4096 This configuration sets up a container to use a veth pair
4097 device with one side plugged to a bridge br0 (which has been
4098 configured before on the system by the administrator). The
4099 virtual network device visible in the container is renamed to
4100 eth0.
4101 -->
4102 この設定は、片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります)。
4103 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。
4104 </para>
4105 <programlisting>
4106 lxc.uts.name = myhostname
4107 lxc.net.0.type = veth
4108 lxc.net.0.flags = up
4109 lxc.net.0.link = br0
4110 lxc.net.0.name = eth0
4111 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
4112 lxc.net.0.ipv4.address = 1.2.3.5/24 1.2.3.255
4113 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
4114 </programlisting>
4115 </refsect2>
4116
4117 <refsect2>
4118 <title><!-- UID/GID mapping -->UID/GID のマッピング</title>
4119 <para><!-- This configuration will map both user and group ids in the
4120 range 0-9999 in the container to the ids 100000-109999 on the host. -->
4121 この設定は、コンテナ内のユーザとグループ両方の id 0-9999 の範囲を、ホスト上の 100000-109999 へマッピングします。
4122 </para>
4123 <programlisting>
4124 lxc.idmap = u 0 100000 10000
4125 lxc.idmap = g 0 100000 10000
4126 </programlisting>
4127 </refsect2>
4128
4129 <refsect2>
4130 <title>Control group</title>
4131 <para>
4132 <!-- This configuration will setup several control groups for
4133 the application, cpuset.cpus restricts usage of the defined cpu,
4134 cpus.share prioritize the control group, devices.allow makes
4135 usable the specified devices.-->
4136 この設定は、アプリケーションのための control group をいくつか設定します。
4137 cpuset.cpus は定義された cpu のみ使用できるように制限します。
4138 cpus.share は、control group の (cpu) 優先度を指定します。
4139 devices.allow は、特定のデバイスを使用可能にします。
4140 </para>
4141 <programlisting>
4142 lxc.cgroup.cpuset.cpus = 0,1
4143 lxc.cgroup.cpu.shares = 1234
4144 lxc.cgroup.devices.deny = a
4145 lxc.cgroup.devices.allow = c 1:3 rw
4146 lxc.cgroup.devices.allow = b 8:0 rw
4147 </programlisting>
4148 </refsect2>
4149
4150 <refsect2>
4151 <title><!-- Complex configuration -->複雑な設定</title>
4152 <para>
4153 <!-- This example show a complex configuration making a complex
4154 network stack, using the control groups, setting a new hostname,
4155 mounting some locations and a changing root file system. -->
4156 この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。
4157 </para>
4158 <programlisting>
4159 lxc.uts.name = complex
4160 lxc.net.0.type = veth
4161 lxc.net.0.flags = up
4162 lxc.net.0.link = br0
4163 lxc.net.0.hwaddr = 4a:49:43:49:79:bf
4164 lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255
4165 lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597
4166 lxc.net.0.ipv6.address = 2003:db8:1:0:214:5432:feab:3588
4167 lxc.net.1.type = macvlan
4168 lxc.net.1.flags = up
4169 lxc.net.1.link = eth0
4170 lxc.net.1.hwaddr = 4a:49:43:49:79:bd
4171 lxc.net.1.ipv4.address = 10.2.3.4/24
4172 lxc.net.1.ipv4.address = 192.168.10.125/24
4173 lxc.net.1.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596
4174 lxc.net.2.type = phys
4175 lxc.net.2.flags = up
4176 lxc.net.2.link = random0
4177 lxc.net.2.hwaddr = 4a:49:43:49:79:ff
4178 lxc.net.2.ipv4.address = 10.2.3.6/24
4179 lxc.net.2.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297
4180 lxc.cgroup.cpuset.cpus = 0,1
4181 lxc.cgroup.cpu.shares = 1234
4182 lxc.cgroup.devices.deny = a
4183 lxc.cgroup.devices.allow = c 1:3 rw
4184 lxc.cgroup.devices.allow = b 8:0 rw
4185 lxc.mount.fstab = /etc/fstab.complex
4186 lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
4187 lxc.rootfs.path = dir:/mnt/rootfs.complex
4188 lxc.rootfs.options = idmap=container
4189 lxc.cap.drop = sys_module mknod setuid net_raw
4190 lxc.cap.drop = mac_override
4191 </programlisting>
4192 </refsect2>
4193
4194 </refsect1>
4195
4196 <refsect1>
4197 <title>See Also</title>
4198 <simpara>
4199 <citerefentry>
4200 <refentrytitle><command>chroot</command></refentrytitle>
4201 <manvolnum>1</manvolnum>
4202 </citerefentry>,
4203
4204 <citerefentry>
4205 <refentrytitle><command>pivot_root</command></refentrytitle>
4206 <manvolnum>8</manvolnum>
4207 </citerefentry>,
4208
4209 <citerefentry>
4210 <refentrytitle><filename>fstab</filename></refentrytitle>
4211 <manvolnum>5</manvolnum>
4212 </citerefentry>
4213
4214 <citerefentry>
4215 <refentrytitle><filename>capabilities</filename></refentrytitle>
4216 <manvolnum>7</manvolnum>
4217 </citerefentry>
4218
4219 </simpara>
4220 </refsect1>
4221
4222 &seealso;
4223
4224 </refentry>
4225
4226 <!-- Keep this comment at the end of the file
4227 Local variables:
4228 mode: sgml
4229 sgml-omittag:t
4230 sgml-shorttag:t
4231 sgml-minimize-attributes:nil
4232 sgml-always-quote-attributes:t
4233 sgml-indent-step:2
4234 sgml-indent-data:t
4235 sgml-parent-document:nil
4236 sgml-default-dtd-file:nil
4237 sgml-exposed-tags:nil
4238 sgml-local-catalogs:nil
4239 sgml-local-ecat-files:nil
4240 End:
4241 -->