[Lxc-users] [systemd-devel] Unable to run systemd in an LXC / cgroup container.

Michael H. Warfield mhw at WittsEnd.com
Wed Dec 5 14:55:02 UTC 2012


On Wed, 2012-12-05 at 13:00 +0000, John wrote:
> On 04/12/12 21:29, Michael H. Warfield wrote:
> >> I raised the question about LXC/systemd a while back and have been
> >> trying to follow the conversation but I have to admit it's going
> >> somewhat over my head. I've also been away on another piece of work but
> >> would now like to understand where things lie with LXC and systemd
> >> inside a container.
> > Ok...  I'll try to answer some of them...
> Thanks Mike, much appreciated.

> >> I have just updated my system to 0.8.0 and I can't see any changes to
> >> make a systemd container work. Are there changes in 0.8.0 ?
> > There are very significant changes in 0.8.0 but, unfortunately, not the
> > ones you need to get systemd to work in a container.  We've been testing
> > a lot of these and they are in git but they are not in a release yet.
> > Hopefully soon, just not yet.

> >> If so, I'd be grateful for some guidance on what I need to do to to my
> >> configuration to make it work.
> > Right now, you'll have to build from git.
> I will go away and do a git build later today.
> I presume that would be from git://lxc.git.sourceforge.net/gitroot/lxc/lxc.

> >> I'm also happy to help test this if I can. If it helps I am on Arch Linux.
> > There are two problems.  One is systemd in an lxc container.  I think we
> > have a rope on this one and it's tied down.  The other is the more
> > recent (195+) versions of systemd in the host that throw the "pivot
> > root" errors.  That has not been addressed as yet.  I use Fedora.  Right
> > now, I have Fedora 17 hosts with Fedora 17 containers.  Fedora 18
> > (currently in beta) host (systemd 195) is going to be a train wreck
> > until we sort the pivot root problem.  I don't know what you have with
> > Arch Linux.  You'll have to tell us what versions of systemd you are
> > running.

> Ah yes, the "pivot root" problem. I have worked around this for the time 
> being by doing a "mount --make-rprivate /". I created a systemd service 
> on the host as an "after" dependency on "systemd-remount-fs.service" to 
> do this. I believe this is ok in the short term (it appears to work ok 
> for me).

Hmmm...  I was thinking someone ran into some problems doing that and
causing problems with the /dev/pts mounts or some such.  Good to note if
that worked for you.  I'm about to start playing with Fedora 18 Beta
where I expect problems.  I'll try that out.

> If I rebuild lxc from git, should I then expect my existing systemd 
> container to work or is there anything else that I need to do ?

Yeah, one other thing (in addition to following Serge's advice regarding
git and #stage)...

You have to add an option to the config file for your systemd
containers.

lxc.autodev = 1

> My versions:
> 
> lxc version: 0.8.0
> Linux hydrogen 3.6.8-1-ARCH #1 SMP PREEMPT Mon Nov 26 22:10:40 CET 2012 
> x86_64 GNU/Linux
> systemd 196
> 
> >> many thanks everyone.
> >> John
> > Mike
> 
> Thanks, I really appreciate the help.

Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20121205/00486801/attachment.pgp>


More information about the lxc-users mailing list