How do you migrate a regular LXC container (from another or the same server) to a Proxmox LXC container, which can be accessed via the Proxmox web GUI?
For example, I have a container created by running:
lxc-create -n debian8 -t debian -- -r jessie
This container will not automatically be picked up by Proxmox. I can see related data stored in /var/lib/lxc
, and such a container has a regular root filesystem, unlike the raw disks created by Proxmox LXC containers, which are mounted on a ZFS rpool. (I'm using ZFS for storage, as configured by the Proxmox ISO installer.)
Another difference is, that Proxmox uses its own configuration files for LXC.
What is the best procedure to import/convert and register such a container with Proxmox?
Best Answer
Without detailed explanation here is how you can do this.
First cd into your lxc container root directory:
(If you used an lvm volume as your containers storage, you need to mount it and cd into your mount point, which can be done by
mount /dev/mapper/<lvgroup-lvdisk> /var/lib/lxc/debian8/rootfs/
, and than cd into the mount point)Create an archive:
Then create a new proxmox container out of that
(You can modify your options as you would like.)
For more information see - man pct