ich verwende Wheezy als host und habe mit dem debian-wheezy template einen systemcontainer namens "ssh-container" angelegt.
Auf dem Host habe ich ein ein verschlüsseltes Raid /dev/mapper/maRAIDfs nach /mnt/maRAIDfs gemounted. Ich möchte im Container Zugriff darauf haben, am besten unter einem gleichlautenden mountpoint.
Hier der Inhalt meiner /var/lib/lxc/ssh-container/config
Code: Alles auswählen
lxc.rootfs = /var/lib/lxc/ssh-container/rootfs
lxc.tty = 4
lxc.pts = 1024
lxc.arch = amd64
lxc.utsname = ssh-container
lxc.cap.drop = sys_module mac_admin mac_override sys_time
# When using LXC with apparmor, uncomment the next line to run unconfined:
#lxc.aa_profile = unconfined
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rm
# mounts point
lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry = sysfs sys sysfs defaults 0 0
lxc.mount.entry = /mnt/maRAIDfs /var/lib/lxc/ssh-container/rootfs/mnt/maRAIDfs none bind 0 0
lxc.mount.entry = /home/user /var/lib/lxc/ssh-container/rootfs/mnt/tmp1 none bind 0 0
Der Aufruf des Containers
Code: Alles auswählen
lxc-start -n ssh-container -o tmp.txt -l INFO
Code: Alles auswählen
lxc-start 1405074080.179 INFO lxc_conf - tty's configured
lxc-start 1405074080.179 INFO lxc_start - 'ssh-container' is initialized
lxc-start 1405074080.179 INFO lxc_cgroup - [1] found cgroup mounted at '/sys/fs/cgroup',opts='rw,relatime,perf_event,blkio,net_cls,freezer,devices,cpuacct,cpu,cpuset,clo
lxc-start 1405074080.206 INFO lxc_cgroup - created cgroup '/sys/fs/cgroup//lxc/ssh-container'
lxc-start 1405074080.257 INFO lxc_conf - 'ssh-container' hostname has been setup
lxc-start 1405074080.258 INFO lxc_conf - mount points have been setup
lxc-start 1405074080.259 INFO lxc_conf - cgroup has been setup
lxc-start 1405074080.259 INFO lxc_conf - console has been setup
lxc-start 1405074080.259 INFO lxc_conf - 4 tty(s) has been setup
lxc-start 1405074080.260 INFO lxc_conf - created new pts instance
lxc-start 1405074080.260 INFO lxc_conf - set personality to '0x0'
lxc-start 1405074080.260 NOTICE lxc_conf - 'ssh-container' is setup.
lxc-start 1405074080.260 NOTICE lxc_start - exec'ing '/sbin/init'
lxc-start 1405074080.260 NOTICE lxc_start - '/sbin/init' started with pid '22786'
Grüße
Markus