Lxc from snap - where is /var/lib/lxd?

on a conventional (apt-get install lxd) system everything relevant for lxd in to be found in /var/lib/lxd I think.

what is the equivalent location for this when lxd runs from a snap package? I can’t really locate it in the various snap locations (and neither in /var/lib)

Tried to find it by locate [container-name], but that does not return any hits

1 Like

/var/snap/lxd/common/lxd/ is the equivalent of /var/lib/lxd/

2 Likes

thanks. Is there any good reason why this directory does only allow read and write access to the owner (711)?

/var/lib/lxd/ (of a non snap installation) has 755 (as most /var/lib/[application] folders) I believe.

No particular reason. I’ve changed our packaging branch to be 0755 moving forward (it won’t change permissions on existing installs though).

We have a whole bunch of paths under it that are 0711 for good reasons (don’t want to allow non-root to run outdated setuid binaries from a container’s filesystem).

Note that ‘lsof -U | grep lxd’ is one way to find all of the unix sockets over which local lxd daemons are listening. In the snap case, you can then talk to that daemon using:

lxc remote add snap unix:///var/snap/conjure-up/common/lxd/unix.socket

after which you can

lxc list snap: