Create a custom image from running lxc container

Hello to everyone,
Is it possible to create the image from running lxc container. Note that there is no lxd setup. It’s standalone lxc host running lxc only.

Thank you

It’s quite manual. You’d effectively make a tarball of the rootfs and generate a metadata tarball by hand, you could then use that with the lxc-local template (or whatever it’s called).

1 Like

Hello @stgraber Sir,

Thank you for the response. Is there any reference for the content of the metadata yaml file. I have been confused at it. I am very new to lxc and i have been struggling at it for a while.

Thank you

So for old style LXC, there is no YAML involved.

Easiest is to look at one of the tarballs like:
https://images.linuxcontainers.org/images/ubuntu/focal/amd64/default/20200825_07:42/meta.tar.xz