Unprivileged containers and chown

Is it possible to run a chown command successfully in an unprivileged container?

I’m guessing not, but I simply may have something misconfigured.

The genesis of this question relates to using tools like Packer and Ansible to create and provision LXD containers. If I don’t set security.privileged=true, at best I’ll see chown errors and at worst have execution failures.

Thanks again for the support and patience.


chown works fine for the uid/gid that are available inside the container, typically that’s uid 0 through 65535, any uid/gid after that will cause an error unless you tweak your container to get a larger range.