No permission writing to NAS from unprivileged container. Please help...

cloakedwarriorrias

New Member
Dec 28, 2023
3
0
1
I have spent a few days trying to fix this and I really don't know what I am doing wrong. I have a Synology NAS set up with my media and am trying to add write access to it from an unprivileged container.

I followed this guide: https://pve.proxmox.com/wiki/Unprivileged_LXC_containers

I also went to Datacenter > Storage > Add Mount and selected SMB/CIFS and added the IP address and location of the folder I want mounted. I added the username / password and it authenticated without issues.

On the host, I edited /etc/pve/lxc/104.conf and added: mp0: /mnt/pve/sonarr,mp=sonarr

If I boot up the unprivileged container and navigate to /Sonarr, I can see the files on the NAS and interact with them but I cannot make or edit files. Permission denied.
So from following the guide, I did exactly what the steps say:

I went to /etc/pve/lxc/104.conf and added
Code:
# uid map: from uid 0 map 1005 uids (in the ct) to the range starting 100000 (on the host), so 0..1004 (ct) → 100000..101004 (host)
lxc.idmap = u 0 100000 1005
lxc.idmap = g 0 100000 1005
# we map 1 uid starting from uid 1005 onto 1005, so 1005 → 1005
lxc.idmap = u 1005 1005 1
lxc.idmap = g 1005 1005 1
# we map the rest of 65535 from 1006 upto 101006, so 1006..65535 → 101006..165535
lxc.idmap = u 1006 101006 64530
lxc.idmap = g 1006 101006 64530

I edited both /etc/subuid and /etc/subgid with:
root:1005:1

And finally on the host I also ran: chown -R 1005:1005 /mnt/pve/sonarr

No errors ran when I did the chown -R command, but if I go into the directory and do ls - l, the permissions still show as root root 0

If I boot up the container again, I can still access to the NAS but I still can't write to it. I don't know what else to do or what I am doing wrong.
 
Last edited:
how would you edit the mountbind config with this info:

UID 103 (sonarr)

GID 1000 (media)

I was thinking this:

# uid map: from uid 0 map 1005 uids (in the ct) to the range starting 100000 (on the host), so 0..1004 (ct) → 100000..101004 (host)
lxc.idmap = u 0 100000 103
lxc.idmap = g 0 100000 1000
# we map 1 uid starting from uid 1005 onto 1005, so 1005 → 1005
lxc.idmap = u 103 103 1
lxc.idmap = g 1000 1000 1
# we map the rest of 65535 from 1006 upto 101006, so 1006..65535 → 101006..165535
lxc.idmap = u 1006 101006 64530
lxc.idmap = g 1006 101006 64530



But then while the container would start up, it didn't have access to run the sonarr web UI. So I must have done something wrong.
 

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!