Hi all. I'm currently doing some experiments with Linux Containers but having problems.
My Linux host is a Ubuntu 10.04 LTS (Lucid) 64bit, running inside a VirtualBox machine (which would not be related). This Linux has lvm setup as the following:
Volume group "lxcbase" running the sys and volume group "lxcdata" hosting the data partition
Logical volume /dev/lxcbase/root mounted on /
Logical volume /dev/lxcbase/swap_1 used as swap
Logical volume /dev/lxcdata/lxcdata mounted on /data
LXC has been the chosen virtualization solution shipped with Ubuntu 10.04 instead of OpenVZ so I decided to give it a try. I generally followed
http://blog.bodhizazen.net/linux/lxc...id-containers/
My container was placed at /data/ubuntu and configuration file is at /data/ubuntu/lxc.config. The content is as following:
Code:
lxc.utsname = ubuntu
lxc.tty = 4
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.mtu = 1500
lxc.network.ipv4 = 192.168.56.200/24
lxc.rootfs = /data/ubuntu
lxc.mount = /data/ubuntu/lxc.fstab
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
# /dev/pts/* - pts namespaces are "coming soon"
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
and the container's fstab, /data/ubuntu/lxc.fstab is
Code:
none /data/ubuntu/dev/pts devpts defaults 0 0
none /data/ubuntu/proc proc defaults 0 0
none /data/ubuntu/sys sysfs defaults 0 0
none /data/ubuntu/var/lock tmpfs defaults 0 0
none /data/ubuntu/var/run tmpfs defaults 0 0
/etc/resolv.conf /data/ubuntu/etc/resolv.conf none bind 0 0
When I start the container with
Code:
lxc-start -n ubuntu
I get the following message:
Code:
# lxc-start -n ubuntu
swapon: /dev/mapper/lxcbase-swap_1: swapon failed: Device or resource busy
mountall: swapon /dev/mapper/lxcbase-swap_1 [27] terminated with status 255
mountall: Problem activating swap: /dev/mapper/lxcbase-swap_1
Then the sessions displays no more and hangs there until I do an "lxc-stop -n ubuntu". /dev/mapper/lxcbase-swap_1 was actually the host swap and there is no reference to this in the container /etc files. Grep didn't see references to "swapon" command under container etc scripts neither.
What might be wrong? Any pointers would be really appreciated.