The newest lxc in oneiric has several changes. One is that it now works
with libcgroup, so if you have the cgroup-bin package installed, you can
still run lxc. The main other is the new ubuntu template. There is now
a single template, ‘lxc-ubuntu’, in place of the several
release-specific ones. It supports automatically binding in your home
directory, stripping the container or using lxcguest, and using i386
containers on amd64. The basic creation command is
lxc-create -f /etc/lxc.conf -t ubuntu -n container1
but to specify arguments to the ubuntu template, you separate them
with ‘–‘. So for instance to create an i386 oneiric container which is
stripped (no lxcguest) and which has my ‘serge’ account with /home/serge
bind-mounted, I would do:
lxc-create -f /etc/lxc.conf -t ubuntu -n container1 — -r oneiric -a i386 -x -b serge
When I start this container, I can log in as user serge with the same
password I have on the host, and my home directory bind-mounted in.
Since the container is trimmed (-x) and doesn’t have lxcguest, it
won’t be as safe against updates, in particular udev updates will
likely break it. But it does make the container faster to boot, and
is easier on the host as it prevents re-firing udev events.
By default it creates a container with your current release as
identified by /etc/lsb-release (or lucid if /etc/lsb-release does not
exist), your current architecture, the use of lxcguest (so not -x), and
not binding in your user.