I am running PVE 5.4-11 on a r720xd configured with two containers. One is TKL File Server (100) which is configured with several cifs shares. Those shares are accessible and writable on numerous PCs on the LAN.
I have TKL Syncthing (101) installed as the second container. I am attempting to utilize the /syncthing share hosted from the TKL File Server as the default storage for the Syncthing container.
I have first added the /syncthing storage share in PVE webUI by: Datacenter>Storage>Add>CIFS, entering the TKL File Server IP, credentials, selecting '/syncthing' from the share list that PVE provides, and type: Disk image. This creates /mnt/pve/syncthing on the host.
I then nano /etc/pve/lxc/101.conf (the Syncthing CT) and add to the last line: mp0: /mnt/pve/syncthing,mp=/mnt/syncthing
When I launch CT 101 console and 'ls /mnt/syncthing' I can see test files I 'touch'ed from the host as well as on CLI in the syncthing container. So all seems good.
However, when attempting to add a new sync folder from within Syncthing webUI, it complains: Failed to create folder root directory mkdir /mnt/syncthing/[new_shared_folder]: permission denied. Syncthing's default local directory is /home/syncthing/Sync , so I:
and therefore tried to:
but received the same permission denied error from syncthing UI. And sure enough:
So it looks like I cannot change ownership of the mounted share to allow user 'syncthing' write permission. However, I can 'touch /mnt/pve/synthing/testfrompveroot' as root from PVE ssh and 'touch /mnt/syncthing/testfromsyncthingroot' as root from the container console without any problem. I have tried adding write permission to the group with no luck as well:
I also tried adding write permission to /mnt/pve/syncthing from the PVE side with no luck.
I have tried adding 'allow mount fstype=cifs,' to the last line in /etc/apparmor.d/lxc/lxc-default prior to the closing '}' with no luck as
well. How do I grant write permission to a container user to write to a mounted share that is mount in PVE - or - what am I doing wrong here?
I have TKL Syncthing (101) installed as the second container. I am attempting to utilize the /syncthing share hosted from the TKL File Server as the default storage for the Syncthing container.
I have first added the /syncthing storage share in PVE webUI by: Datacenter>Storage>Add>CIFS, entering the TKL File Server IP, credentials, selecting '/syncthing' from the share list that PVE provides, and type: Disk image. This creates /mnt/pve/syncthing on the host.
I then nano /etc/pve/lxc/101.conf (the Syncthing CT) and add to the last line: mp0: /mnt/pve/syncthing,mp=/mnt/syncthing
When I launch CT 101 console and 'ls /mnt/syncthing' I can see test files I 'touch'ed from the host as well as on CLI in the syncthing container. So all seems good.
However, when attempting to add a new sync folder from within Syncthing webUI, it complains: Failed to create folder root directory mkdir /mnt/syncthing/[new_shared_folder]: permission denied. Syncthing's default local directory is /home/syncthing/Sync , so I:
Code:
ls -Al /home/syncthing/Sync
syncthing syncthing
ls -Al /mnt/syncthing
root root
and therefore tried to:
Code:
chown syncthing:syncthing /mnt/syncthing
but received the same permission denied error from syncthing UI. And sure enough:
Code:
ls -Al /mnt/syncthing
root root
So it looks like I cannot change ownership of the mounted share to allow user 'syncthing' write permission. However, I can 'touch /mnt/pve/synthing/testfrompveroot' as root from PVE ssh and 'touch /mnt/syncthing/testfromsyncthingroot' as root from the container console without any problem. I have tried adding write permission to the group with no luck as well:
Code:
root@syncthing /mnt/syncthing# ls -Al
total 2048
drwxr-xr-x 2 root root 0 Aug 25 18:50 images
-rwxr-xr-x 1 root root 0 Aug 25 18:35 testfrompveroot.txt
-rwxr-xr-x 1 root root 0 Aug 25 19:10 testfromsyncthingroot.txt
root@syncthing /mnt/syncthing# chown -R syncthing:syncthing /mnt/syncthing
root@syncthing /mnt/syncthing# ls -Al
total 2048
drwxr-xr-x 2 root root 0 Aug 25 18:50 images
-rwxr-xr-x 1 root root 0 Aug 25 18:35 testfrompveroot.txt
-rwxr-xr-x 1 root root 0 Aug 25 19:10 testfromsyncthingroot.txt
root@syncthing /mnt/syncthing# chmod -R g+w /mnt/syncthing
root@syncthing /mnt/syncthing# ls -Al
total 2048
drwxr-xr-x 2 root root 0 Aug 25 18:50 images
-rwxr-xr-x 1 root root 0 Aug 25 18:35 testfrompveroot.txt
-rwxr-xr-x 1 root root 0 Aug 25 19:10 testfromsyncthingroot.txt
I also tried adding write permission to /mnt/pve/syncthing from the PVE side with no luck.
I have tried adding 'allow mount fstype=cifs,' to the last line in /etc/apparmor.d/lxc/lxc-default prior to the closing '}' with no luck as
well. How do I grant write permission to a container user to write to a mounted share that is mount in PVE - or - what am I doing wrong here?