Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

1. host environmentを作る

2. Guest environmentを作る

  • 1. で作成したhost のrootfsにゲスト用ディレクトリを作成する
    • mkdir -p /lxc/guest
    • mkdir -p /lxc/cluster
  • 各ディレクトリにguest用にビルドしたrootfsを展開する
    • tar xf *****.tar.bz2 -C <SD>/lxc/guest
  • hostを起動、ログインの後に、下記コマンドでlxcからコンテナを作成する
    • lxc-create -n <Name> -t none
      • 例) lxc-create -n guest -t none
      • 例) lxc-create -n cluster -t none
  • /var/lib/lxc/ にディレクトリとconfigファイルが作成される。各configを書き換える

#lxc.net.0.type = empty
lxc.net.0.type = veth
lxc.net.0.flags = up
lxc.net.0.link = lxcbr0
lxc.net.0.hwaddr = fe:0d:e4:0:xx:xx
#lxc.net.0.veth.mode = bridge
lxc.net.0.ipv4.address = 10.0.3.10/24


lxc.rootfs.path = dir:/lxc/guest
lxc.signal.halt = SIGRTMIN+3
lxc.signal.reboot = SIGTERM
lxc.uts.name = "busybox"
lxc.tty.max = 1
lxc.pty.max = 1

lxc.cgroup.devices.allow = c *:* m
lxc.cgroup.devices.allow = b *:* m


lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed
lxc.mount.entry = /sys/kernel/security sys/kernel/security none ro,bind,optional 0 0

lxc.cgroup.devices.allow = c 116:* rwm
lxc.cgroup.devices.allow = c 13:* rwm
lxc.cgroup.devices.allow = c 226:* rwm
lxc.mount.entry = /dev/snd dev/snd none bind,optional,create=dir

lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry = /dev/tty3 dev/tty3 none bind,optional,create=file
lxc.mount.entry = /dev/input dev/input none bind,optional,create=dir

lxc.mount.entry = /run/platform/display mnt/tmp none bind,optional,create=dir
lxc.environment = XDG_RUNTIME_DIR=/home/0/tmp
lxc.mount.entry = /run/udev/data run/udev/data none bind,optional,create=dir

lxc.mount.entry = /sys/fs/smackfs sys/fs/smackfs none bind 0 0
lxc.mount.entry = /etc/smack etc/smack none bind,optional,create=dir

  • No labels