I just configured LXD (sudo lxd init) on a fresh install of Ubuntu Server 20.04. My previous installs have not involved snap, and 20.04 appears to default to snap. After configuring successfully with my initial user, I added another user to the lxd group, logged on as that user, and get:
cannot create user data directory: /home/user/snap/lxd/15067: Permission denied
The inital user continues to work fine.
Can someone please direct me to what I’m missing? Thanks very much.
Also, did I make a mistake? Should I have installed LXD from apt?
No you did the right thing, lxd will only be available through snap in the future (atleast for Ubuntu (and some other distros) as far as I know.
cannot create user data directory: /home/user/snap/lxd/15067: Permission denied
Can you run: ls -l /home/user/snap/lxd/
I suspect the result will be that this folder is only accessable by the first user (this is the case for me).
Your result might still be odd though, because imo it should simply create a folder for the second user in the second users home, so maybe it’s a bug.
Potencial workaround:
You might solve the problem by allowing the second user access to it.
But be warned, I don’t know if thats a good solution.
I see that one possible solution is to simply always run lxc commands with sudo (e.g., sudo lxc list). I would rather figure out why I can’t give a regular user permission to run lxc commands, but if I did use sudo are there consequences?
This has been solved. The issue is that our LDAP users have home directories in the form of /home/primarygroup/username, but snap requires user’s home directories to be in /home. The solution was pointed out to me (in the Snapcraft Forum) and is explained here.