Creating a snap for Raspberry pi 4

I’m trying to build a (closed source) snap for a Raspberry pi 4 with 64 bit OS.

To build the snap, I first installed Ubuntu server 20.04 arm64, and installed snapcraft on it.

It failed to run snapcraft, because it couldn’t install multipass, as there’s no stable release apparently, so I installed the candidate: sudo snap install multipass --candidate.

I checked kvm-ok, that was fine: KVM acceleration can be used

However, multipass fails to run, with the following error:

launch failed: Internal error: qemu-system-x86_64 failed getting vmstate (Process returned exit code: 1) with output:
qemu-system-aarch64: -nographic: No machine specified, and there is no default
Use -machine help to list supported machines

Any idea how to continue from here? Or maybe a suggestion for a different approach?

1 Like

When building a snap natively on Raspberry Pi, you should use LXD instead of multipass as it’s better supported currently. See https://github.com/canonical/multipass/issues/1376 for more details as well as a rather involved workaround to get multipass working.

To build with lxd instead, install lxd and use it with:

$ snap install lxd
$ sudo lxd init --auto
$ snapcraft --use-lxd
1 Like

Thanks a lot! That worked :slight_smile: