How to export a working LXC to template for use in other environment

1 reply
spollock
111 posts

Is there a known way to export a finished LXC container  antlet that can be imported into other hypervisors?

I have several antlets (lxc) that are taking up valuable resources on my Antsle and I would like to move them to a different environment like ProxMox, VirtualBox, or VMWare.

I have tried tar -czvf on the directory structure of the antlet but not much luck with it yet.

TIA

Antsle TeamStaff
32 posts

A container antlet's root filesystem is a ZFS dataset on your antsle, and zfs list shows its mountpoint. Stop the antlet, then archive the root filesystem while keeping numeric owners and permissions, for example: tar --numeric-owner -czpf myantlet.tar.gz -C /path/to/rootfs . Proxmox can create a new LXC container directly from a tarball like that (pct create, with the tarball as the template).

VirtualBox and VMware run full virtual machines rather than containers, so for those, create a new VM with the same OS and copy your data and configuration over.

— Antsle Team

Log in to reply. New here? It takes a minute.