How do I set permissions for a program inside a TRueNAS LXC container?

Created a TrueNAS container with a base OS of ubuntu. At first everything looked good. The plan is to install asterisk and have the config files mapped to a dataset outside of the container. I was able to create the dataset and map it to the container’s /etc/asterisk directory so that NFS shares can access it as well as the TrueNAS shell and of course the container shell.

So far so good.

However, when I try to install asterisk with apt install asterisk, it fails on installation due to a permission error for either the installer or asterisk itself. Asterisk wants the permissions set to asterisk:asterisk, but what is actually there is nobody:nogroup. If I try to change them inside the container, I get “permission denied” even though I’m running as root.

So even though the shell, the TrueNAS host and also NFS shares all have full access, apparently the installer and asterisk don’t. How do I change the permissions of the dataset directory inside the container (mounted as /etc/asterisk) to allow asterisk and the apt installer to work properly?

Try adding the truenas_container_unpriv_root user to your datasets acls. That user automatically gets mapped to root inside the lxc.

1 Like

Thanks, that worked. Unfortunately, I had messed up the vm so bad that it was necessary to delete it and the dataset and start over. I re-added everything and then the ACL permission unpriv_root_user and then asterisk installed just fine as far as I can tell.

Only now, despite re-enabling NFS sharing, that part no longer works. So asterisk can see the files, but I can’t.

For some strange reason, the NFS started working on its own this morning. I didn’t change anything.