How to share an LXC container between two compatible hosts

lxc

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.

Best Answer

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.

Related Topic