Mounting directory writable in container?

Lombra

New Member
Feb 2, 2025
18
3
3
Hi,

I have a directory on the host that needs to be mounted as writable in an unprivileged container. I understand I can do UID mapping, but are there any other/better options? I would like it to be owned by www-data inside the container.
 
Add the directory to the container via a bind mount:
Code:
pct set <vmid> -mp[n] /path/on/host,mp=/path/in/container,idmap=passthrough

Start the container and inside run chown www-data /path/in/container.
 
That sounds like it would work well. Thanks! So it just maps the guest UID to the same host UID? Are there any non obvious security implications that I should keep in mind?