Creating a Simple Test Snap

I’m learning how to create a Snap. I managed to run a test one earlier, but after switching to another distro and back (to Ubuntu Budgie) found that I can no longer create a Snap. I have installed snapd and lxd and made myself into an LXD user.

snapcraft cleanbuild

results in

Error: Get http://unix.socket/1.0: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: permission denied
Failed to initialize container: there are either no permissions or the remote ‘local’ does not exist.
Verify the existing remotes by running lxc remote list. Refer to the documentation at https://linuxcontainers.org/lxd/getting-started-cli.
I think it is failing to download a Linux kernel, am I right and what should I do about it?

lxc remote list

results in

±----------------±-----------------------------------------±--------------±----------±-------±-------+
| NAME | URL | PROTOCOL | AUTH TYPE | PUBLIC | STATIC |
±----------------±-----------------------------------------±--------------±----------±-------±-------+
| images | https://images.linuxcontainers.org | simplestreams | | YES | NO |
±----------------±-----------------------------------------±--------------±----------±-------±-------+
| local (default) | unix:// | lxd | tls | NO | YES |
±----------------±-----------------------------------------±--------------±----------±-------±-------+
| ubuntu | https://cloud-images.ubuntu.com/releases | simplestreams | | YES | YES |
±----------------±-----------------------------------------±--------------±----------±-------±-------+
| ubuntu-daily | https://cloud-images.ubuntu.com/daily | simplestreams | | YES | YES |
±----------------±-----------------------------------------±--------------±----------±-------±-------+
chris@desktop:~/SnapWork/test$

If you are sure you are in the lxd group (sudo adduser $USER lxd), try logging out and then logging back in again to ensure the assignment is correctly applied to your session.

I have checked this:

chris@desktop:~$ sudo adduser chris lxd
[sudo] password for chris: 
The user `chris' is already a member of `lxd'.
chris@desktop:~$

and the computer has been on and off several times.

[FIXED]
I was using elementaryOS for a bit and lxd wouldn’t install accepting the defaults as I had done in the past for Ubuntu-MATE, so tried something else. Now I’m back on Ubuntu-MATE I tried to install it as usual, but I think it must have used some configuration file details hanging over from eOS and it still didn’t work. I’ve now removed lxd and reinstalled it accepting the usual defaults and it works.