Restoring a LXC container from Proxmox to another server

skn666

New Member
Dec 2, 2023
4
0
1
Hi, I need help please...

I have a LXC debian12 container on my Proxmox server.
Works fine !

Now, for testing, I want to reload this container on my local machine...
I proceed like this;
  1. I shutdown my lxc container on Proxmox
  2. I do a "backup" of the container
  3. I get back the .zst on my local machine
  4. On this same local machine, I recreate a debian container ($ lxc launch images:debian12 same-name-than-proxmox-cnt)
But If I try

Bash:
$ sudo lxc image import <my .zst> ...
Error: Metadata tarball is missing metadata.yaml


I also tried:
Bash:
$ sudo lxc import <my .zst> ...
Importing instance: 100% (275.21MB/s)Error: Backup is missing index.yaml

What am I doing wrong ?

Thanks for your help
 
Hi, I need help please...

I have a LXC debian12 container on my Proxmox server.
Works fine !

Now, for testing, I want to reload this container on my local machine...
I proceed like this;
  1. I shutdown my lxc container on Proxmox
  2. I do a "backup" of the container
  3. I get back the .zst on my local machine
  4. On this same local machine, I recreate a debian container ($ lxc launch images:debian12 same-name-than-proxmox-cnt)
But If I try

Bash:
$ sudo lxc image import <my .zst> ...
Error: Metadata tarball is missing metadata.yaml


I also tried:
Bash:
$ sudo lxc import <my .zst> ...
Importing instance: 100% (275.21MB/s)Error: Backup is missing index.yaml

What am I doing wrong ?

Thanks for your help
Hi,
as far as I can tell you are trying to run a LXC container created and backed up with Proxmox VE on a machine using LXD? Is that correct? Note this is not supported out of the box.

Without having tested this, the following could be a way to approach the conversion:
  • Extract the zstd compressed tar archive to the rootfs folder in a folder structure as required to generate an LXD image [0].
  • Create the required content of the metadata.yml [1].
  • Add the template content if required.
  • Create the image via the already mentioned lxc image import command [2].
  • Generate the new container from the new image.
There might be more steps/adaptions required, depending on what LXD requires for networking, ecc. Happy hacking!

[0] https://documentation.ubuntu.com/lxd/en/latest/reference/image_format/
[1] https://documentation.ubuntu.com/lxd/en/latest/reference/image_format/#metadata
[2] https://documentation.ubuntu.com/lxd/en/latest/howto/images_copy/#import-from-the-local-file-system
 
Last edited:
  • Like
Reactions: skn666

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!