0

I use Linux and I am in the process of migrating from one Linux Mint 15 into Linux Mint 16. Each OS is installed on the same partition as a different subvolume on the same btrfs partition.

As I use both systems at the moment, I'd like to share all LXC Containers across both distributions.

I deep-copied the whole /var/lib/lxc/<container> path to separate btrfs subvolume.

Surprisingly it is not as easy as it seems. Each time when I make any form of linking of the container source into /var/lib/lxc/ on the host, I got an error (lxc-start: command get_init_pid failed to receive response). Unfortunately, any form of delegation (symlinks, mount --bind) doesn't work.

Copying the container with rsync -aAX works well, but I don't want to maintain two separate instances of the container, but to share one instance between two host OSes.

Adam Ryczkowski
  • 690
  • 1
  • 9
  • 29
  • It seems you try to link each container separately. If so, why do not you mount whole shared subvolume as /var/lib/lxc ? – Veniamin Dec 09 '13 at 08:08

2 Answers2

1

Try getting debug output from lxc:

   lxc-start -n container_name -o container.log -l DEBUG -d

there might be more information.

Also check lxc version, there's been quite huge progress in development lately, if you're running something like lxc 1.0.0.alpha1 or earlier version you should consider upgrading.

Tombart
  • 2,013
  • 3
  • 27
  • 47
-2

You should have a look at Docker which encapsulates all of this for you and makes containers easily portable (besides many other awesome things).

Elias Probst
  • 188
  • 8
  • I know it. But isn't it still at the beta phase? Maybe I'll give it a try anyway. Thank you. – Adam Ryczkowski Dec 08 '13 at 21:11
  • 1
    I tried. I followed the simple docker "getting started" howto on Ubuntu, and the container keeps failing on the first command with `The container failed to start due to timed out.`. I guess they are indeed not really ready for production. (BTW it wasn't me who downvoted your answer) – Adam Ryczkowski Dec 09 '13 at 10:37
  • This is a bug in old versions of the LXC utils shipped with Ubuntu. Make sure, your system is up-to-date, as the most recent version should have this bug fixed. Check also this Google Groups discussion regarding this: https://groups.google.com/d/msg/docker-user/n5uv5MzcPsY/2ds3L76sqlQJ – Elias Probst Dec 09 '13 at 16:11
  • Yes, it seems I've became a victim of this bug. Thanks! – Adam Ryczkowski Dec 09 '13 at 16:29
  • @AdamRyczkowski, it was me who upvoted your comment ;-P – poige Sep 04 '16 at 10:12