Unable to restore LXC backup on new PVE Install

smittychifi

Member
Dec 8, 2021
5
0
6
45
Hi, I just re-installed PVE 7 on a new set of hardware. I had forgotten about some of the settings I had setup on the previous hardware, and was presented with the following errors when trying to restore my container:

Code:
recovering backed-up configuration from 'tank-backups:backup/vzdump-lxc-100-2021_12_06-17_12_27.tar.zst'
restoring 'tank-backups:backup/vzdump-lxc-100-2021_12_06-17_12_27.tar.zst' now..
extracting archive '/tank/backups/dump/vzdump-lxc-100-2021_12_06-17_12_27.tar.zst'
lxc 20211208035155.847 ERROR    conf - conf.c:lxc_map_ids:3087 - newuidmap failed to write mapping "newuidmap: uid range [1000-3000) -> [1000-3000) not allowed": newuidmap 112291 0 100000 1000 1000 1000 2000 65534 165534 1
Failed to write id mapping for child process
lxc 20211208035155.847 ERROR    utils - utils.c:lxc_drop_groups:1343 - Operation not permitted - Failed to drop supplimentary groups
lxc 20211208035155.847 ERROR    utils - utils.c:lxc_switch_uid_gid:1318 - Invalid argument - Failed to switch to gid 0
TASK ERROR: unable to restore CT 101 - command 'lxc-usernsexec -m u:0:100000:1000 -m u:1000:1000:2000 -m u:65534:165534:1 -m g:0:100000:100 -m g:100:100:1 -m g:101:100100:899 -m g:1000:1000:2000 -m g:65534:165534:1 -- tar xpf - --zstd --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' -C /var/lib/lxc/101/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 1

This is the configuration file within the backup:

Code:
arch: amd64
cores: 12
features: nesting=1
hostname: servarr
memory: 16384
mp0: /SSD-Pool/downloads,mp=/mnt/downloads
mp1: /tank/media,mp=/mnt/media
nameserver: 1.1.1.1
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.1,hwaddr=0A:CA:38:B4:4A:C5,ip=192.168.1.55/24,type=veth
onboot: 1
ostype: ubuntu
rootfs: ssd-pool:subvol-100-disk-0,size=50G
searchdomain: 1.1.1.1
swap: 16384
unprivileged: 1
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
lxc.idmap: u 0 100000 1000
lxc.idmap: u 1000 1000 2000
lxc.idmap: u 65534 165534 1
lxc.idmap: g 0 100000 100
lxc.idmap: g 100 100 1
lxc.idmap: g 101 100100 899
lxc.idmap: g 1000 1000 2000
lxc.idmap: g 65534 165534 1

Is there a way for me to create a new, empty container with the same configuration settings, and then manually unzip the backup file to the rootfs?
 
hi,

I had forgotten about some of the settings I had setup on the previous hardware, and was presented with the following errors when trying to restore my container:
Failed to write id mapping for child process
you'll need to adapt the /etc/subuid and /etc/subgid files on your new host (because you have a custom id mapping for your container). afterwards it should work fine :)
 

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!