Multipass launch fails on Ubuntu Server for Arm devices (arm64)

I am usingUbuntu preinstalled server image on raspi 3 B+ to be able to build snaps for arm64 devices. The build has failed with following error:

ubuntu@ubuntu:~/testsnap$ sudo snapcraft
Using 'snap/snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
Launching a VM.
Starting snapcraft-my-snap-name -[2019-04-30T08:41:29.900] [error] [snapcraft-my-snap-name] process error occurred FailedToStart

launch failed: failed to start qemu instance                                    
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

After this I tested if launching a VM using multipass was success or not with the following result:

sudo multipass launch                                 
Starting lucrative-buck /[2019-04-30T09:04:02.001] [error] [lucrative-buck] process error occurred FailedToStart
launch failed: failed to start qemu instance                                    
ubuntu@ubuntu:~/testsnap$ sudo snap logs multipass
multipass              multipass.libvirt-bin  multipass.multipassd
ubuntu@ubuntu:~/testsnap$ sudo snap logs multipass
2019-04-30T09:04:00Z multipassd[2644]: process program 'qemu-system-arm'
2019-04-30T09:04:00Z dnsmasq[2869]: using nameserver 127.0.0.53#53
2019-04-30T09:04:00Z multipassd[2644]: process arguments '--enable-kvm, -hda, /var/snap/multipass/common/data/multipassd/vault/instances/lucrative-buck/ubuntu-18.04-server-cloudimg-armhf.img, -drive, file=/var/snap/multipass/common/data/multipassd/vault/instances/lucrative-buck/cloud-init-config.iso,if=virtio,format=raw,snapshot=off,read-only, -smp, 1, -m, 1024M, -device, virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:d8:4d:94, -netdev, tap,id=hostnet0,ifname=tap-b9c20b8e
2019-04-30T09:04:00Z dnsmasq[2869]: reading /etc/resolv.conf
2019-04-30T09:04:00Z dnsmasq[2869]: using nameserver 127.0.0.53#53
2019-04-30T09:04:00Z dnsmasq[2869]: reading /etc/resolv.conf
2019-04-30T09:04:00Z dnsmasq[2869]: using nameserver 127.0.0.53#53
2019-04-30T09:04:01Z multipassd[2644]: process state changed to Starting
2019-04-30T09:04:02Z multipassd[2644]: process state changed to NotRunning
2019-04-30T09:04:02Z multipassd[2644]: process error occurred FailedToStart

For some reason the process is failing. I was wondering if any of you folks have encountered this issue. I assumed few folks would have tried this after running into issue of cross compilation of snaps which is currently not possible.

I really need this to work on Ubuntu server for arm and not some other distro like Ubuntu Mate for raspberry pi (where snapping actually works using the multipass). This is a requirement beyond my control.

Hi @trex, we’re not putting as much attention outside of amd64 I’m afraid. FWIW you should not need “sudo” for using multipass.

Does journalctl -afu snap.multipass* show any more info?

I’ll try this myself now, too.

Thanks for the reply @Saviq

I am afraid the logs do not show much information. Here’s the output of the journalctl for you:

ubuntu@ubuntu:~/testsnap2$ journalctl -afu snap.multipass*
-- Logs begin at Sun 2018-01-28 15:58:18 UTC. --
Apr 30 10:05:19 ubuntu dnsmasq[1584]: reading /etc/resolv.conf
Apr 30 10:05:19 ubuntu dnsmasq[1584]: using nameserver 127.0.0.53#53
Apr 30 10:05:19 ubuntu multipassd[1311]: process working dir '/snap/multipass/753/qemu'
Apr 30 10:05:19 ubuntu multipassd[1311]: process program 'qemu-system-arm'
Apr 30 10:05:19 ubuntu multipassd[1311]: process arguments '--enable-kvm, -hda, /var/snap/multipass/common/data/multipassd/vault/instances/snapcraft-my-snap-name/ubuntu-18.04-minimal-cloudimg-amd64.img, -drive, file=/var/snap/multipass/common/data/multipassd/vault/instances/snapcraft-my-snap-name/cloud-init-config.iso,if=virtio,format=raw,snapshot=off,read-only, -smp, 2, -m, 2048M, -device, virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:a0:6d:34, -netdev, tap,id=hostnet0,ifname=tap-d070318d
Apr 30 10:05:19 ubuntu multipassd[1311]: process state changed to Starting
Apr 30 10:05:19 ubuntu multipassd[1311]: process state changed to NotRunning
Apr 30 10:05:19 ubuntu multipassd[1311]: process error occurred FailedToStart
Apr 30 10:26:53 ubuntu dnsmasq[1584]: reading /etc/resolv.conf
Apr 30 10:26:53 ubuntu dnsmasq[1584]: using nameserver 127.0.0.53#53

Hey @trex, I’m afraid the problem is that KVM is not supported, at least on my Pi 3 B:

$ sudo apt install cpu-checker
$ kvm-ok
INFO: /dev/kvm does not exist
HINT:   sudo modprobe kvm
$ sudo modprobe kvm
modprobe: FATAL: Module kvm not found in directory /lib/modules/4.15.0-1031-raspi2

You said this works on MATE on the Pi, which suggests we’re only missing some kernel bits to be able to get this working. There’s a bug reported on the linux-raspi2 package in Ubuntu, you could go there and bump it for the responsible folks to look at it.

Otherwise, building your own kernel with KVM could be an option, or driving snapcraft manually in a LXD container, while --with-lxd isn’t a thing.