*This is a copy of a similar post on the LXD fourms here:https://discuss.linuxcontainers.org/t/shared-host-directory-permission-issues/ *
Hi there, I'm new to using LXD so please bear with me if this question has already been answered or is very simple.
I've been trying to set up a shared host directory between my webserver container, running NextCloud, and my host. I've tried
sudo chown 100000:100000 /hdd-pool/nextcloud_data
lxc config device add webserver test disk source ="/hdd-pool/nextcloud_data" path= "/nextcloud_data"
and verified through ls -l /hdd-pool that indeed uid:100000 is in fact the owner. However, when I use ls -l /nextcloud_data in the container, it says that the shared directory belongs to nobody and nogroup.
I thought maybe since hdd-pool in my environment is actually a zpool mounted to hdd-pool that maybe that would have something to do with it. To test this, I created a test directory in my home directory with similar steps from above, but same results.
I've already looked into the following posts: Adding a shared host directory to an LXC/LXD Container
https://discuss.linuxcontainers.org/t/shared-directory-between-lxd-containers/1982/2
https://www.reddit.com/r/homelab/comments/4h0erv/resolving_permissions_issues_with_host_bind/
and still don't understand what I'm doing wrong. Am I missing something in the config or documentation? Is there a better way to go about my setup? I'd also rather not make the container a privileged one...
Thanks in advance!
Eugene Seubert
Edit: changed chmod to chown