LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-23-2011, 05:11 AM   #1
wolf0403
LQ Newbie
 
Registered: Nov 2004
Posts: 4

Rep: Reputation: 0
Question Problem setting up LXC containers


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.
 
  


Reply

Tags
lxc, virtualization


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux-Vserver or lxc or anything else vishesh Linux - Server 2 11-19-2010 03:25 PM
LXer: How To Install OpenQRM 4.7 With LXC Containers In Debian Squeeze/Lenny LXer Syndicated Linux News 0 10-22-2010 02:50 PM
vzdump equivalent for lxc containers bigaddo81 Linux - Virtualization and Cloud 0 06-06-2010 08:28 PM
c++ containers vendtagain Programming 6 12-22-2009 04:28 PM
fast containers gecoool Programming 4 02-02-2006 02:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration