Home Store Blog Development

Creating a Snap


#1

I’m learning how to create a Snap, I managed to run a test one earlier, but then switched to an other distro. I’ve come back to UB and found that I can no longer create a Snap. I have install snapd and lxd.
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?

chris@desktop:~/SnapWork/test$ lxc remote list
±----------------±-----------------------------------------±--------------±----------±-------±-------+
| 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$


#2

Have a quick read of this. There is a suggestion here that your user account needs to be added to the lxd config

https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1767469

I am no expert of snap issues but I do know that the snapcraft forum is a very friendly place with lots of knowledgeable people if you get stuck


#3

I had already set up snapd and lxd in the same way as before, including adding my username, so it wasn’t that. I’ll have a look at snapcraft.io, I’d forgotten about that!