Looking at the LXD API execute docs shows that user and group IDs can be set:
This doesn’t appear to be exposed in the Instance.execute method of PyLXD. Any reason its not included, could this be added ? Would be cleaner then wrapping up commands in
su and sudo.