[Lxc-users] Moving lxc containers

Trent W. Buck twb at cybersource.com.au
Mon Mar 28 01:59:25 UTC 2011


Amit Uttamchandani <amit.uttam at gmail.com>
writes:

> I'm just wondering what the best way is to move an lxc container? Can
> I just tar the root filesystem and untar it on another system? Or
> should I rsync it over?

If you use tar, make sure to pass --numeric-owner, ESPECIALLY if the
container is RH-derived and the host is Debian-derived (or vice-versa).

Otherwise things MOSTLY work except you get a few really strange
behaviours, and you eventually track it down and realize that the untar
operation changed UIDs to match the new dom0, e.g. the container sees

    -rwsr-xr-- 1 root cups 48112 Feb 18 07:18
     /usr/lib/dbus-1.0/dbus-daemon-launch-helper

instead of

    -rwsr-xr-- 1 root messagebug 48112 Feb 18 07:18
     /usr/lib/dbus-1.0/dbus-daemon-launch-helper

> I understand that before doing any of the above, the container should be
> shutdown first. However, is there a way to do this while the container
> is running?

Safely? Not without the Checkpoint/Restart stuff that's being worked on
elsewhere, I think.





More information about the lxc-users mailing list