~ubuntu-branches/ubuntu/quantal/lxc/quantal-201208301614

« back to all changes in this revision

Viewing changes to doc/lxc.conf.sgml.in

  • Committer: Bazaar Package Importer
  • Author(s): Guido Trotter
  • Date: 2010-06-28 10:15:48 UTC
  • mfrom: (1.1.4 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100628101548-3m2wszl7kdo32u2n
Tags: 0.7.1-1
* New upstream version
* Convert to quilt format
* Use pristine-tar option in git-buildpackage
* lxc-$distro scripts (debian, fedora, sshd, ubuntu, busybox) are now
  shipped under /usr/lib/lxc/lxc/templates/
* Bump up standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
306
306
    </refsect2>
307
307
 
308
308
    <refsect2>
 
309
      <title>Container system console</title>
 
310
      <para>
 
311
        If the container is configured with a root filesystem and the
 
312
        inittab file is setup to use the console, you may want to specify
 
313
        where goes the output of this console.
 
314
      </para>
 
315
      <variablelist>
 
316
        <varlistentry>
 
317
          <term>
 
318
            <option>lxc.console</option>
 
319
          </term>
 
320
          <listitem>
 
321
            <para>
 
322
              Specify a path to a file where the console output will
 
323
              be written.
 
324
            </para>
 
325
          </listitem>
 
326
        </varlistentry>
 
327
      </variablelist>
 
328
    </refsect2>
 
329
 
 
330
    <refsect2>
309
331
      <title>Console through the ttys</title>
310
332
      <para>
311
333
        If the container is configured with a root filesystem and the
373
395
    <refsect2>
374
396
      <title>Root file system</title>
375
397
      <para>
376
 
        The root file system is the location where the container will
377
 
        chroot.
 
398
        The root file system of the container can be different than that
 
399
        of the host system.
378
400
      </para>
379
401
      <variablelist>
380
402
        <varlistentry>
383
405
          </term>
384
406
          <listitem>
385
407
            <para>
386
 
              specify a file location containing the new file tree for
387
 
              a root file system.
 
408
              specify a directory to become the root of the container.
 
409
              If not specified, the container shares its root file
 
410
              system with the host.
 
411
            </para>
 
412
          </listitem>
 
413
        </varlistentry>
 
414
 
 
415
        <varlistentry>
 
416
          <term>
 
417
            <option>lxc.rootfs.mount</option>
 
418
          </term>
 
419
          <listitem>
 
420
            <para>
 
421
              where to recursively bind <option>lxc.rootfs</option>
 
422
              before pivoting.  This is to ensure success of the
 
423
              <citerefentry>
 
424
                <refentrytitle><command>pivot_root</command></refentrytitle>
 
425
                <manvolnum>8</manvolnum>
 
426
              </citerefentry>
 
427
              syscall.  Any directory suffices, the default should
 
428
              generally work.
 
429
            </para>
 
430
          </listitem>
 
431
        </varlistentry>
 
432
 
 
433
        <varlistentry>
 
434
          <term>
 
435
            <option>lxc.pivotdir</option>
 
436
          </term>
 
437
          <listitem>
 
438
            <para>
 
439
              where to pivot the original root file system under
 
440
              <option>lxc.rootfs</option>, specified relatively to
 
441
              that.  The default is <filename>mnt</filename>.
 
442
              It is created if necessary, and also removed after
 
443
              unmounting everything from it during container setup.
388
444
            </para>
389
445
          </listitem>
390
446
        </varlistentry>
454
510
 
455
511
  <refsect1>
456
512
    <title>Examples</title>
 
513
      <para>
 
514
        In addition to the few examples given below, you will find
 
515
        some other examples of configuration file in @DOCDIR@/examples
 
516
      </para>
457
517
    <refsect2>
458
518
      <title>Network</title>
459
519
      <para>This configuration sets up a container to use a veth pair
461
521
        configured before on the system by the administrator). The
462
522
        virtual network device visible in the container is renamed to
463
523
        eth0.</para>
464
 
 
465
 
      <variablelist>
466
 
 
467
 
        <varlistentry>
468
 
          <term>lxc.utsname = myhostname</term>
469
 
          <listitem><para></para></listitem>
470
 
        </varlistentry>
471
 
        
472
 
        <varlistentry>
473
 
          <term>lxc.network.type = veth</term>
474
 
          <listitem><para></para></listitem>
475
 
        </varlistentry>
476
 
 
477
 
        <varlistentry>
478
 
          <term>lxc.network.flags = up</term>
479
 
          <listitem><para></para></listitem>
480
 
        </varlistentry>
481
 
 
482
 
        <varlistentry>
483
 
          <term>lxc.network.link = br0</term>
484
 
          <listitem><para></para></listitem>
485
 
        </varlistentry>
486
 
 
487
 
        <varlistentry>
488
 
          <term>lxc.network.name = eth0</term>
489
 
          <listitem><para></para></listitem>
490
 
        </varlistentry>
491
 
 
492
 
        <varlistentry>
493
 
          <term>lxc.network.hwaddr = 4a:49:43:49:79:bf</term>
494
 
          <listitem><para></para></listitem>
495
 
        </varlistentry>
496
 
 
497
 
        <varlistentry>
498
 
          <term>lxc.network.ipv4 = 1.2.3.5/24</term>
499
 
          <listitem><para></para></listitem>
500
 
        </varlistentry>
501
 
 
502
 
        <varlistentry>
503
 
          <term>lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597</term>
504
 
          <listitem><para></para></listitem>
505
 
        </varlistentry>
506
 
 
507
 
      </variablelist>
508
 
 
 
524
      <programlisting>
 
525
        lxc.utsname = myhostname
 
526
        lxc.network.type = veth
 
527
        lxc.network.flags = up
 
528
        lxc.network.link = br0
 
529
        lxc.network.name = eth0
 
530
        lxc.network.hwaddr = 4a:49:43:49:79:bf
 
531
        lxc.network.ipv4 = 1.2.3.5/24
 
532
        lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597
 
533
      </programlisting>
509
534
    </refsect2>
510
535
 
511
536
    <refsect2>
514
539
      the application, cpuset.cpus restricts usage of the defined cpu,
515
540
      cpus.share prioritize the control group, devices.allow makes
516
541
      usable the specified devices.</para>
517
 
 
518
 
      <variablelist>
519
 
        <varlistentry>
520
 
          <term>lxc.cgroup.cpuset.cpus = 0,1</term>
521
 
          <listitem><para></para></listitem>
522
 
        </varlistentry>
523
 
        
524
 
        <varlistentry>
525
 
          <term>lxc.cgroup.cpu.shares = 1234</term>
526
 
          <listitem><para></para></listitem>
527
 
        </varlistentry>
528
 
 
529
 
        <varlistentry>
530
 
          <term>lxc.cgroup.devices.deny = a</term>
531
 
          <listitem><para></para></listitem>
532
 
        </varlistentry>
533
 
 
534
 
        <varlistentry>
535
 
          <term>lxc.cgroup.devices.allow = c 1:3 rw</term>
536
 
          <listitem><para></para></listitem>
537
 
        </varlistentry>
538
 
 
539
 
        <varlistentry>
540
 
          <term>lxc.cgroup.devices.allow = b 8:0 rw</term>
541
 
          <listitem><para></para></listitem>
542
 
        </varlistentry>
543
 
      </variablelist>
544
 
 
 
542
      <programlisting>
 
543
        lxc.cgroup.cpuset.cpus = 0,1
 
544
        lxc.cgroup.cpu.shares = 1234
 
545
        lxc.cgroup.devices.deny = a
 
546
        lxc.cgroup.devices.allow = c 1:3 rw
 
547
        lxc.cgroup.devices.allow = b 8:0 rw
 
548
      </programlisting>
545
549
    </refsect2>
546
550
 
547
551
    <refsect2>
548
552
      <title>Complex configuration</title>
549
553
      <para>This example show a complex configuration making a complex
550
554
      network stack, using the control groups, setting a new hostname,
551
 
      mounting some locations and a changing the root file
552
 
      system.</para>
553
 
 
554
 
      <variablelist>
555
 
        <varlistentry>
556
 
          <term>lxc.utsname = complex</term>
557
 
          <listitem><para></para></listitem>
558
 
        </varlistentry>
559
 
        <varlistentry>
560
 
          <term>lxc.network.type = veth</term>
561
 
          <listitem><para></para></listitem>
562
 
        </varlistentry>
563
 
        <varlistentry>
564
 
          <term>lxc.network.flags = up</term>
565
 
          <listitem><para></para></listitem>
566
 
        </varlistentry>
567
 
        <varlistentry>
568
 
          <term>lxc.network.link = br0</term>
569
 
          <listitem><para></para></listitem>
570
 
        </varlistentry>
571
 
        <varlistentry>
572
 
          <term>lxc.network.hwaddr = 4a:49:43:49:79:bf</term>
573
 
          <listitem><para></para></listitem>
574
 
        </varlistentry>
575
 
        <varlistentry>
576
 
          <term>lxc.network.ipv4 = 1.2.3.5/24</term>
577
 
          <listitem><para></para></listitem>
578
 
        </varlistentry>
579
 
        <varlistentry>
580
 
          <term>lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597</term>
581
 
          <listitem><para></para></listitem>
582
 
        </varlistentry>
583
 
        <varlistentry>
584
 
          <term>lxc.network.ipv6 = 2003:db8:1:0:214:5432:feab:3588</term>
585
 
          <listitem><para></para></listitem>
586
 
        </varlistentry>
587
 
        <varlistentry>
588
 
          <term>lxc.network.type = macvlan</term>
589
 
          <listitem><para></para></listitem>
590
 
        </varlistentry>
591
 
        <varlistentry>
592
 
          <term>lxc.network.flags = up</term>
593
 
          <listitem><para></para></listitem>
594
 
        </varlistentry>
595
 
        <varlistentry>
596
 
          <term>lxc.network.link = eth0</term>
597
 
          <listitem><para></para></listitem>
598
 
        </varlistentry>
599
 
        <varlistentry>
600
 
          <term>lxc.network.hwaddr = 4a:49:43:49:79:bd</term>
601
 
          <listitem><para></para></listitem>
602
 
        </varlistentry>
603
 
        <varlistentry>
604
 
          <term>lxc.network.ipv4 = 1.2.3.4/24</term>
605
 
          <listitem><para></para></listitem>
606
 
        </varlistentry>
607
 
        <varlistentry>
608
 
          <term>lxc.network.ipv4 = 192.168.10.125/24</term>
609
 
          <listitem><para></para></listitem>
610
 
        </varlistentry>
611
 
        <varlistentry>
612
 
          <term>lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596</term>
613
 
          <listitem><para></para></listitem>
614
 
        </varlistentry>
615
 
        <varlistentry>
616
 
          <term>lxc.network.type = phys</term>
617
 
          <listitem><para></para></listitem>
618
 
        </varlistentry>
619
 
        <varlistentry>
620
 
          <term>lxc.network.flags = up</term>
621
 
          <listitem><para></para></listitem>
622
 
        </varlistentry>
623
 
        <varlistentry>
624
 
          <term>lxc.network.link = dummy0</term>
625
 
          <listitem><para></para></listitem>
626
 
        </varlistentry>
627
 
        <varlistentry>
628
 
          <term>lxc.network.hwaddr = 4a:49:43:49:79:ff</term>
629
 
          <listitem><para></para></listitem>
630
 
        </varlistentry>
631
 
        <varlistentry>
632
 
          <term>lxc.network.ipv4 = 1.2.3.6/24</term>
633
 
          <listitem><para></para></listitem>
634
 
        </varlistentry>
635
 
        <varlistentry>
636
 
          <term>lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297</term>
637
 
          <listitem><para></para></listitem>
638
 
        </varlistentry>
639
 
        <varlistentry>
640
 
          <term>lxc.cgroup.cpuset.cpus = 0,1</term>
641
 
          <listitem><para></para></listitem>
642
 
        </varlistentry>
643
 
        <varlistentry>
644
 
          <term>lxc.cgroup.cpu.shares = 1234</term>
645
 
          <listitem><para></para></listitem>
646
 
        </varlistentry>
647
 
        <varlistentry>
648
 
          <term>lxc.cgroup.devices.deny = a</term>
649
 
          <listitem><para></para></listitem>
650
 
        </varlistentry>
651
 
        <varlistentry>
652
 
          <term>lxc.cgroup.devices.allow = c 1:3 rw</term>
653
 
          <listitem><para></para></listitem>
654
 
        </varlistentry>
655
 
        <varlistentry>
656
 
          <term>lxc.cgroup.devices.allow = b 8:0 rw</term>
657
 
          <listitem><para></para></listitem>
658
 
        </varlistentry>
659
 
        <varlistentry>
660
 
          <term>lxc.mount = /etc/fstab.complex</term>
661
 
          <listitem><para></para></listitem>
662
 
        </varlistentry>
663
 
        <varlistentry>
664
 
          <term>lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0</term>
665
 
          <listitem><para></para></listitem>
666
 
        </varlistentry>
667
 
        <varlistentry>
668
 
          <term>lxc.rootfs = /mnt/rootfs.complex</term>
669
 
          <listitem><para></para></listitem>
670
 
        </varlistentry>
671
 
        <varlistentry>
672
 
          <term>lxc.cap.drop = sys_module mknod setuid net_raw</term>
673
 
          <listitem><para></para></listitem>
674
 
        </varlistentry>
675
 
        <varlistentry>
676
 
          <term>lxc.cap.drop = mac_override</term>
677
 
          <listitem><para></para></listitem>
678
 
        </varlistentry>
679
 
      </variablelist>
 
555
      mounting some locations and a changing root file system.</para>
 
556
      <programlisting>
 
557
        lxc.utsname = complex
 
558
        lxc.network.type = veth
 
559
        lxc.network.flags = up
 
560
        lxc.network.link = br0
 
561
        lxc.network.hwaddr = 4a:49:43:49:79:bf
 
562
        lxc.network.ipv4 = 1.2.3.5/24
 
563
        lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597
 
564
        lxc.network.ipv6 = 2003:db8:1:0:214:5432:feab:3588
 
565
        lxc.network.type = macvlan
 
566
        lxc.network.flags = up
 
567
        lxc.network.link = eth0
 
568
        lxc.network.hwaddr = 4a:49:43:49:79:bd
 
569
        lxc.network.ipv4 = 1.2.3.4/24
 
570
        lxc.network.ipv4 = 192.168.10.125/24
 
571
        lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596
 
572
        lxc.network.type = phys
 
573
        lxc.network.flags = up
 
574
        lxc.network.link = dummy0
 
575
        lxc.network.hwaddr = 4a:49:43:49:79:ff
 
576
        lxc.network.ipv4 = 1.2.3.6/24
 
577
        lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297
 
578
        lxc.cgroup.cpuset.cpus = 0,1
 
579
        lxc.cgroup.cpu.shares = 1234
 
580
        lxc.cgroup.devices.deny = a
 
581
        lxc.cgroup.devices.allow = c 1:3 rw
 
582
        lxc.cgroup.devices.allow = b 8:0 rw
 
583
        lxc.mount = /etc/fstab.complex
 
584
        lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
 
585
        lxc.rootfs = /mnt/rootfs.complex
 
586
        lxc.cap.drop = sys_module mknod setuid net_raw
 
587
        lxc.cap.drop = mac_override
 
588
      </programlisting>
680
589
    </refsect2>
681
590
 
682
591
  </refsect1>