[lxc-users] Convert virtual machine to LXC container

Fajar A. Nugraha list at fajar.net
Thu Aug 9 04:19:24 UTC 2018


Sorry, my mistake. I meant "lxc-console". And I just rechecked, apparently
there's the equivalent "lxc console" command as well.

Ignore my comment about "lxc-attach" earlier. You should be able to use lxd
rootfs for lxc as long as:
- you have the correct uid mapping (it's simpler if you just use privileged
container. Otherwise just setup uid map on lxc config file manually)
- you have a suitable lxc config file (the easiest way is probably to
create a new lxc container, then replace the original rootfs with the one
from rsync/lxd-p2c)

-- 
Fajar


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

> LXD does not support lxc-attach?
> I thought that LXD was a superset of LXC, that added on top of it.
> Maybe somebody care to explain how LXC and LXD compare.
>
>
> On Wed, Aug 8, 2018 at 11:21 PM Fajar A. Nugraha <list at fajar.net> wrote:
>
>> 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
>>>
>>
>> _______________________________________________
>> 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/4df946b6/attachment-0001.html>


More information about the lxc-users mailing list