[SOLVED] Restore of LXC failed with error code 2

Ovidiu

Renowned Member
Apr 27, 2014
325
12
83
Running Proxmox 5.3-12 with latest backups. Trying to restore a backup I made a few minutes ago.

Here is the log of the restore:

Code:
extracting archive '/mnt/pve/local-nfs/dump/vzdump-lxc-108-2019_04_10-22_01_01.tar.lzo'
tar: ./var/spool/postfix/dev/random: Cannot mknod: Operation not permitted
tar: ./var/spool/postfix/dev/urandom: Cannot mknod: Operation not permitted
Total bytes read: 3209512960 (3.0GiB, 75MiB/s)
tar: Exiting with failure status due to previous errors
TASK ERROR: unable to restore CT 108 - command 'lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar xpf - --lzop --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/108/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2

any ideas waht could be wrong here? I don't understand the problem.

Just in case it helps, here's the log of the backup:

Code:
INFO: starting new backup job: vzdump 108 --remove 0 --node jarvis --compress lzo --storage local-nfs --mode snapshot
INFO: Starting Backup of VM 108 (lxc)
INFO: status = stopped
INFO: backup mode: stop
INFO: ionice priority: 7
INFO: CT Name: mike.knightsenglish.com
INFO: creating archive '/mnt/pve/local-nfs/dump/vzdump-lxc-108-2019_04_10-22_01_01.tar.lzo'
INFO: Total bytes written: 3209512960 (3.0GiB, 49MiB/s)
INFO: archive file size: 1.88GB
INFO: Finished Backup of VM 108 (00:01:05)
INFO: Backup job finished successfully
TASK OK
 
  • Like
Reactions: Vazhnov
I managed to restore my container by unchecking the "unprivileged container" check box. How do I know if my container used to be privileged or unprivileged? I assumed when restoring it would restore to the same as when the backup was taken?

found this thread with a workaround and more explanations, not sure though what the "proper" solution is.
=> https://forum.proxmox.com/threads/unprivileged-containers.26148/page-2
 
How do I know if my container used to be privileged or unprivileged?
If you have the original config file somewhere, it would say "unprivileged: 1" in there.

I assumed when restoring it would restore to the same as when the backup was taken?
It does, but the option is there to make it possible to change this. For example if you wanted to switch your unprivileged container to privileged, restoring it as privileged makes this possible.

found this thread with a workaround and more explanations, not sure though what the "proper" solution is.
=> https://forum.proxmox.com/threads/unprivileged-containers.26148/page-2
No real "proper" solution. Some containers just don't work as unprivileged out-of-the-box (they contain device nodes, like in your case /dev/urandom etc.) and need some modifications.

We've changed the GUI default for CT creation/restore recently to unprivileged, since we believe it is a better option in terms of security.
 
If you have the original config file somewhere, it would say "unprivileged: 1" in there.


It does, but the option is there to make it possible to change this. For example if you wanted to switch your unprivileged container to privileged, restoring it as privileged makes this possible.


No real "proper" solution. Some containers just don't work as unprivileged out-of-the-box (they contain device nodes, like in your case /dev/urandom etc.) and need some modifications.

We've changed the GUI default for CT creation/restore recently to unprivileged, since we believe it is a better option in terms of security.
Thanks for explaining, I now understand the issue a bit better and will know how to proceed or what the problem is if this comes up again :)
 
You're welcome. You can mark the thread as [SOLVED] by editing your first post.
 
  • Like
Reactions: Ovidiu

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!