[SOLVED] Backup to Dropbox works for VM but not LXC

Sandbo

Member
Jul 4, 2019
65
6
13
32
Hi,

I am trying to setup an automatic backup of the disk image to dropbox for my VM.
First I install dropbox on my proxmox root, then I created a symlink folder where then I assign as the backup directory in the GUI.
With this, I have no problem backing up a VM and have it uploaded to dropbox.

However, when I tried to do the same for LXC it fails:
INFO: create storage snapshot 'vzdump'
WARNING: You have not turned on protection against thin pools running out of space.
WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
Logical volume "snap_vm-102-disk-0_vzdump" created.
WARNING: Sum of all thin volume sizes (<352.02 GiB) exceeds the size of thin pool pve/data and the amount of free space in volume group (<16.00 GiB).
INFO: creating archive '/CSQT_RAID1/BKUPs/BKUP_CSMS1/dump/vzdump-lxc-102-2020_02_24-03_33_25.tar.lzo'
INFO: tar: /CSQT_RAID1/BKUPs/BKUP_CSMS1/dump/vzdump-lxc-102-2020_02_24-03_33_25.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now
INFO: remove vzdump snapshot
Logical volume "snap_vm-102-disk-0_vzdump" successfully removed
ERROR: Backup of VM 102 failed - command 'set -o pipefail && lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --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' --one-file-system '--warning=no-file-ignored' '--directory=/CSQT_RAID1/BKUPs/BKUP_CSMS1/dump/vzdump-lxc-102-2020_02_24-03_33_25.tmp' ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw '--directory=/mnt/vzsnap0' --no-anchored '--exclude=lost+found' --anchored '--exclude=./tmp/?*' '--exclude=./var/tmp/?*' '--exclude=./var/run/?*.pid' ./ | lzop >/CSQT_RAID1/BKUPs/BKUP_CSMS1/dump/vzdump-lxc-102-2020_02_24-03_33_25.tar.dat' failed: exit code 2
INFO: Failed at 2020-02-24 03:33:28
INFO: Backup job finished with errors
TASK ERROR: job errors

Any idea would be appreciated.
 

Stoiko Ivanov

Proxmox Staff Member
Staff member
May 2, 2018
6,968
1,080
164
I guess the container for dropbox is unprivileged - in that case the backup is done with root inside the container and that is UID 100000 on the host:
make sure that the backup-storage is writable by all users (or at least by UID 100000)

I hope this helps!
 

Sandbo

Member
Jul 4, 2019
65
6
13
32
I guess the container for dropbox is unprivileged - in that case the backup is done with root inside the container and that is UID 100000 on the host:
make sure that the backup-storage is writable by all users (or at least by UID 100000)

I hope this helps!

Thanks a lot for your reply.
The container is indeed unprivileged and what you suggest is highly likely the case.

I didn't know the backup was done by the root of the container, but not of the Proxmox host, and this is probably the reason.
 

Stoiko Ivanov

Proxmox Staff Member
Staff member
May 2, 2018
6,968
1,080
164
Let us know if that fixed your problem (and if yes - please mark the thread as 'SOLVED')
Thanks!
 

Sandbo

Member
Jul 4, 2019
65
6
13
32
Let us know if that fixed your problem (and if yes - please mark the thread as 'SOLVED')
Thanks!
Yes, I can confirm it solves my problem. Just a bit more:
Apart from setting the destination folder to 777, I do have to set the /root and /root/Dropbox directories to 755, as I understand that the execution bit is required in order for the child directory to be written by other users.

I might just work on setting a special group for the backup task later to avoid exposing the folder to everyone though.
 

Stoiko Ivanov

Proxmox Staff Member
Staff member
May 2, 2018
6,968
1,080
164
glad that solved the issue!
Please consider the security implications of changing the permissions of /root (it does contain sensitive data)
maybe creating a dedicated backup user seems like a better alternative
 

Sandbo

Member
Jul 4, 2019
65
6
13
32
glad that solved the issue!
Please consider the security implications of changing the permissions of /root (it does contain sensitive data)
maybe creating a dedicated backup user seems like a better alternative
Yes, I think the simplest solution is just to move the Dropbox folder out of root to my attached drive.
Thanks again for your help!
 
  • Like
Reactions: Stoiko Ivanov

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 your own in 60 seconds.

Buy now!