[lxc-users] Convert virtual machine to LXC container

Fajar A. Nugraha list at fajar.net
Thu Aug 9 03:21:05 UTC 2018


I've converted (manually) some lxc containers to lxd and back in the past.
IIRC the biggest difference was that lxd does not need to output anything
to console, while lxc needs it (e.g. for lxc-attach). Depending on what
container distro and version you use, it might not matter (e.g. it should
"just work" for newer ubuntu), and you can use the same container rootfs
for both.

If you use anything else and simple 'rsync --numeric-ids)' doesn't work,
take a look at the customizations done by lxc-template to find out what
else need to be adjusted, e.g.
https://github.com/lxc/lxc-templates/blob/master/templates/lxc-debian.in#L67
for old debian system that still use sysvinit.

-- 
Fajar

On Thu, Aug 9, 2018 at 9:18 AM, Saint Michael <venefax at gmail.com> wrote:

> The question is how can I use that for plan LXC.
> I can install a box with LXD, bring the computer in, but then I want a
> plain LXC container.
> Is it doable?
>
> On Wed, Aug 8, 2018 at 7:17 PM David Favor <david at davidfavor.com> wrote:
>
>>   wrote:
>> > Has anybody invented a procedure, a script, etc., to convert a running
>> > machine to a LXC container? I was thinking to create a container of the
>> > same OS, and then use rsync, excluding /proc /tmp/ /sys etc.  Any ideas?
>>
>> Use the fabulous lxd-p2c script.
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
>
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20180809/eef25810/attachment.html>


More information about the lxc-users mailing list