I tried to install snapcraft in a Qubes OS AppVM using the instructions on this page, but it failed because after rebooting the AppVM (to force a user logout), I get:
[user@docker ~]$ lxd init --minimal
Error: Failed to connect to local LXD: Get "http://unix.socket/1.0": dial unix /var/snap/lxd/common/lxd/unix.socket: connect: no such file or directory
and in fact the group lxd
that was added before rebooting has disappeared.
Because an AppVM doesn't have a persistent root, and it seems the user can't log out without restarting the AppVM, which loses some persistent changes such as the group just added, we need to make some slight alterations to the instructions.
snap disable lxd
snap enable lxd
sudo snap start lxd
sudo useradd snap
. The second and subsequent times that you do this after a reboot, you will get a warning that the home directory already exists. This is expected and can be ignored.sudo usermod -a -G lxd snap
sudo su - snap
lxd init --minimal
mkdir my-project
cd my-project
snapcraft init
snapcraft
sudo /usr/lib/qubes/setup-ip add eth0
. You will get a warningRTNETLINK answers: File exists
. This can be ignored.snapcraft
.You will have to repeat these instructions (except steps 9 and 11) every time you restart the AppVM.