7

How do I start a LXC container inside of a docker container - end to end - with shared networking? Ideally I'd like to do this with Debian or Ubuntu. Some problems I found when trying to do this:

  • lxc-net doesn't start when installed into a Docker container, so the lxcbr0 bridge never gets created. Partial workaround is to manually create the bridge.
  • lxc containers fail to start to due to cgroupfs failed to detect cgroup metadata, even if I manually mount a cgroup via mount -n -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
Jonathan
  • 5,027
  • 39
  • 48
  • Did you try resolving this issue? I am facing the same issue :( – Viswesn Aug 27 '15 at 07:07
  • Possible duplicate of [Is there a way how to run LXD inside Docker?](https://stackoverflow.com/questions/43741660/is-there-a-way-how-to-run-lxd-inside-docker) – Mat Jan 29 '18 at 13:54

1 Answers1

0

Take a look at the --privileged flag to your docker container docs

Michael
  • 10,124
  • 1
  • 34
  • 49
  • 1
    Done that. Just booting a docker container, installing LXC, and trying to start some LXC containers yields various problems though. That's why I posted the question. – Jonathan Apr 17 '15 at 20:18
  • 2
    If you boot an ubuntu container, install lxc and dnsmasq, lxc-net never runs even though the upstart config is in place. Attempting to run it via `service lxc-net start` yields `lxc-net: unrecognized service`. Not sure why. lxc-net installs and starts fine on a bare metal machine. – Jonathan Apr 17 '15 at 21:20