Announcing the first Release Candidate for Apple M1 support

Hey all,

We’ve dropped the first Release Candidate for Apple M1 support. It can be found at:
https://multipass-ci.s3.amazonaws.com/multipass-1.8.0-rc.849%2Bgb6625c10.mac-Darwin.pkg

This is a Universal package that supports both Arm and Intel Macs.

The Intel side of things will now support a QEMU driver, but is not enabled by default. In order to enable the QEMU driver, you need to do:
$ sudo multipass set local.driver=qemu

Please note that if you currently have Hyperkit-based instances, those will not be available when using the QEMU driver, but they will be preserved and can be used again when setting the driver to hyperkit. We have plans to have a conversion utility to allow using the Hyperkit instances with the QEMU driver, but we aren’t there yet.

Lastly, there have a been a few reports during the beta testing that launching instances will suddenly start timing out where before it would work. There seems to be something going on with the Apple virtualized networking that we haven’t been able to solve yet. We are tracking that in #2265 and if you run in to that, please report it there.

Thank you, good luck, and let us know how it goes!

7 Likes

Not usable with snapcraft on an M1:

$ snapcraft
Launching a VM.
launch failed: The following errors occurred:
snapcraft-home-assistant-snap: timed out waiting for response
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.

Hey @lucyllewy,

Could you please provide the log found at /Library/Logs/Multipass/multipassd.log?

[2021-10-01T14:46:09.785] [debug] [update] Latest Multipass release available is version 1.7.2
[2021-10-01T14:46:14.845] [info] [rpc] gRPC listening on unix:/var/run/multipass_socket, SSL:on
[2021-10-01T14:46:14.852] [info] [daemon] Starting Multipass 1.7.2+mac
[2021-10-01T14:46:14.852] [info] [daemon] Daemon arguments: /Library/Application Support/com.canonical.multipass/bin/multipassd --verbosity debug
[2021-10-01T17:51:14.342] [info] [daemon] Received signal 15 (Terminated: 15)
[2021-10-01T17:51:14.350] [info] [daemon] Goodbye!
[2021-10-01T17:51:17.753] [debug] [update] Latest Multipass release available is version 1.7.2
[2021-10-01T17:51:19.213] [info] [VMImageHost] Did not find any supported products in "appliance"
[2021-10-01T17:51:20.976] [info] [rpc] gRPC listening on unix:/var/run/multipass_socket, SSL:on
[2021-10-01T17:51:20.980] [info] [daemon] Starting Multipass 1.8.0-rc.849+gb6625c10.mac
[2021-10-01T17:51:20.980] [info] [daemon] Daemon arguments: /Library/Application Support/com.canonical.multipass/bin/multipassd --verbosity debug
[2021-10-01T17:53:07.163] [debug] [qemu-system-aarch64] [11862] started: qemu-system-aarch64 --version
[2021-10-01T17:53:22.317] [debug] [qemu-img] [11863] started: qemu-img info --output=json /var/root/Library/Caches/multipassd/qemu/vault/images/snapcraft-core20-20210921/focal-server-cloudimg-amd64-disk.img
[2021-10-01T17:53:22.619] [debug] [qemu-img] [11864] started: qemu-img info /var/root/Library/Caches/multipassd/qemu/vault/images/snapcraft-core20-20210921/focal-server-cloudimg-amd64-disk.img
[2021-10-01T17:53:22.636] [debug] [qemu-img] [11865] started: qemu-img resize /var/root/Library/Application Support/multipassd/qemu/vault/instances/snapcraft-home-assistant-snap/focal-server-cloudimg-amd64-disk.img 274877906944
[2021-10-01T17:53:22.651] [debug] [qemu-img] [11866] started: qemu-img snapshot -l /var/root/Library/Application Support/multipassd/qemu/vault/instances/snapcraft-home-assistant-snap/focal-server-cloudimg-amd64-disk.img
[2021-10-01T17:53:22.660] [debug] [snapcraft-home-assistant-snap] process working dir ''
[2021-10-01T17:53:22.660] [info] [snapcraft-home-assistant-snap] process program 'qemu-system-aarch64'
[2021-10-01T17:53:22.660] [info] [snapcraft-home-assistant-snap] process arguments '-machine, virt,highmem=off, -accel, hvf, -drive, file=/Library/Application Support/com.canonical.multipass/bin/../Resources/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on, -nic, vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c, -cpu, cortex-a72, -device, virtio-scsi-pci,id=scsi0, -drive, file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/snapcraft-home-assistant-snap/focal-server-cloudimg-amd64-disk.img,if=none,format=qcow2,discard=unmap,id=hda, -device, scsi-hd,drive=hda,bus=scsi0.0, -smp, 2, -m, 2048M, -qmp, stdio, -chardev, null,id=char0, -serial, chardev:char0, -nographic, -cdrom, /var/root/Library/Application Support/multipassd/qemu/vault/instances/snapcraft-home-assistant-snap/cloud-init-config.iso'
[2021-10-01T17:53:22.663] [debug] [qemu-system-aarch64] [11867] started: qemu-system-aarch64 -machine virt,highmem=off -nographic -dump-vmstate /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/multipassd.nlITFX
[2021-10-01T17:53:22.702] [info] [snapcraft-home-assistant-snap] process state changed to Starting
[2021-10-01T17:53:22.704] [info] [snapcraft-home-assistant-snap] process state changed to Running
[2021-10-01T17:53:22.704] [debug] [qemu-system-aarch64] [11868] started: qemu-system-aarch64 -machine virt,highmem=off -accel hvf -drive file=/Library/Application Support/com.canonical.multipass/bin/../Resources/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c -cpu cortex-a72 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application Support/multipassd/qemu/vault/instances/snapcraft-home-assistant-snap/focal-server-cloudimg-amd64-disk.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 2 -m 2048M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -nographic -cdrom /var/root/Library/Application Support/multipassd/qemu/vault/instances/snapcraft-home-assistant-snap/cloud-init-config.iso
[2021-10-01T17:53:22.704] [info] [snapcraft-home-assistant-snap] process started
[2021-10-01T17:53:22.704] [debug] [snapcraft-home-assistant-snap] Waiting for SSH to be up
[2021-10-01T17:53:23.009] [warning] [snapcraft-home-assistant-snap] qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c: info: Started vmnet interface with configuration:
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c: info: MTU:              1500
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c: info: Max packet size:  1514
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c: info: MAC:              4a:8d:27:fa:99:dd
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c: info: DHCP IPv4 start:  192.168.64.1
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c: info: DHCP IPv4 end:    192.168.64.254
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c: info: IPv4 subnet mask: 255.255.255.0
qemu-system-aarch64: -nic vmnet-macos,mode=shared,model=virtio-net-pci,mac=52:54:00:58:df:5c: info: UUID:             A26EFB4C-9426-4598-85B6-1730E9D58D0D

[2021-10-01T17:53:23.009] [warning] [qemu-system-aarch64] 
[2021-10-01T17:53:23.009] [debug] [snapcraft-home-assistant-snap] QMP: {"QMP": {"version": {"qemu": {"micro": 0, "minor": 1, "major": 6}, "package": ""}, "capabilities": ["oob"]}}

[2021-10-01T17:53:23.060] [debug] [snapcraft-home-assistant-snap] QMP: {"return": {}}

[2021-10-01T18:00:22.962] [info] [daemon] Cannot open ssh session on "snapcraft-home-assistant-snap" shutdown: failed to determine IP address
[2021-10-01T18:00:22.962] [info] [snapcraft-home-assistant-snap] Shutdown request delayed for 10 minutes
[2021-10-01T18:03:48.515] [debug] [sshfs-mounts] No mounts to stop for instance "snapcraft-home-assistant-snap"
[2021-10-01T18:03:48.515] [debug] [snapcraft-home-assistant-snap] QMP: {"return": {}}

[2021-10-01T18:03:48.516] [debug] [snapcraft-home-assistant-snap] QMP: {"timestamp": {"seconds": 1633107828, "microseconds": 515938}, "event": "POWERDOWN"}

[2021-10-01T18:03:48.516] [info] [snapcraft-home-assistant-snap] VM powering down
[2021-10-01T18:04:34.978] [debug] [snapcraft-home-assistant-snap] QMP: {"return": {}}

[2021-10-01T18:04:34.978] [debug] [snapcraft-home-assistant-snap] QMP: {"timestamp": {"seconds": 1633107874, "microseconds": 978028}, "event": "POWERDOWN"}

[2021-10-01T18:04:34.978] [info] [snapcraft-home-assistant-snap] VM powering down
[2021-10-01T18:05:04.978] [warning] [Qt] QProcess: Destroyed while process ("qemu-system-aarch64") is still running.
[2021-10-01T18:05:04.996] [info] [snapcraft-home-assistant-snap] process state changed to NotRunning
[2021-10-01T18:05:04.996] [error] [snapcraft-home-assistant-snap] error: program: qemu-system-aarch64; error: Process crashed
[2021-10-01T18:12:16.458] [debug] [sshfs-mounts] No mounts to stop for instance " U-�
[2021-10-01T18:12:16.937] [debug] [update] Latest Multipass release available is version 1.7.2
[2021-10-01T18:12:17.314] [info] [VMImageHost] Did not find any supported products in "appliance"
[2021-10-01T18:12:19.057] [info] [rpc] gRPC listening on unix:/var/run/multipass_socket, SSL:on
[2021-10-01T18:12:19.060] [info] [daemon] Starting Multipass 1.8.0-rc.849+gb6625c10.mac
[2021-10-01T18:12:19.061] [info] [daemon] Daemon arguments: /Library/Application Support/com.canonical.multipass/bin/multipassd --verbosity debug

Ugh, yet another example of the virtualized network not giving out an IP address. Do you happen to have Internet sharing or a VPN turned on?

I think it’s more likely the fact that snapcraft or Multipass has decided to download an amd64 image…

1 Like

Ohhhh…yes, that is completely b0rked. I’ll enter an issue in Github.

1 Like

Thanks for pointing that out. Here’s the issue: https://github.com/canonical/multipass/issues/2268

2 Likes

Thanks @lucyllewy, unfortunately there are no compatible arm64 snapcraft images yet, so we had to disable it altogether.

The workaround, for now, is to launch a normal instance and use snapcraft --use-lxd inside. We’ll try and work on those images soon.

Grab it while it’s hot!

https://github.com/canonical/multipass/releases/tag/v1.8.0

2 Likes

Thanks folks - Works great on M1!. I have the opposite need, though. I need to run x64 images on my M1. Can I do that via the included qemu?

1 Like

Hi @fsedano, no - the included qemu will only run images matching the host architecture.

We’re looking into cross-architecture runs for the future, but it’s not going to happen very soon.

You could try and build qemu upstream, though - you need qemu-x86_64-static.

So assuming I build (or otherwise install) qemu x86_64, is there some way to configure multipass to use it?

I never really considered it before, but with qemu being multi-architecture, the notion of a qemu driver without a specified architecture was always underspecified. As a convenience default for “use current platform” it’s fine, but does there want/need to be a way to specify the intended architecture?

Though having raised that, there’s probably more involved (like downloading the appropriate architecture specific images), so maybe the qemu driver isn’t the right thing to touch.

Regardless, thanks for all of your work, folks!

Hi @jsshapiro that’s precisely why I’ve not seen “generic” qemu binaries. They are always annotated with the architecture of what they are meant to run (not what they are, since they should always be native).

And yeah qemu is the only hope for running cross-architecture, but we’ve not had time to evaluate it properly yet. And if/when we introduce it, you’ll have a per-instance choice, there’s no reason to limit it to just one architecture (whether native or not).

Hello! For some reason I started to get issues on deleting instances with prune option.

[2021-12-01T09:39:52.764] [debug] [ssh session] Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
[2021-12-01T09:39:54.337] [debug] [ssh session] Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
[2021-12-01T09:39:55.593] [debug] [ssh session] Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
[2021-12-01T09:39:56.930] [debug] [ssh session] Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
[2021-12-01T13:51:02.820] [debug] [sshfs-mounts] No mounts to stop for instance "vm1"
[2021-12-01T13:51:02.847] [debug] [vm1] QMP: {"return": {}}

[2021-12-01T13:51:02.847] [debug] [vm1] QMP: {"timestamp": {"seconds": 1638363062, "microseconds": 845667}, "event": "POWERDOWN"}

[2021-12-01T13:51:02.848] [info] [vm1] VM powering down
[2021-12-01T13:51:05.717] [debug] [vm1] QMP: {"timestamp": {"seconds": 1638363065, "microseconds": 715412}, "event": "SHUTDOWN", "data": {"guest": true, "reason": "guest-shutdown"}}

[2021-12-01T13:51:05.717] [info] [vm1] VM shut down
[2021-12-01T13:52:02.839] [warning] [Qt] QProcess: Destroyed while process ("qemu-system-aarch64") is still running.
[2021-12-01T13:52:02.935] [info] [vm1] process state changed to NotRunning
[2021-12-01T13:52:02.947] [error] [vm1] error: program: qemu-system-aarch64; error: Process crashed

The instance starts and works fine, but it seems to be deleted with a crash.

Thanks it works great
I need some way to run a linux amd64 binary on my m1 pro
one approach

  • run arm64 ubuntu image that multipass can run on my m1-pro.
  • then amd64 emulation software to run the linux binary.

this failed as the there was no loader to be found anywhere ld-linux-x86-64.so.2

on macOS M1 with 1.8.1 failed to be able to set to hyperkit
only qemu can be set

MacBook-Pro:bin chad$ sudo multipass set local.driver=qemu
MacBook-Pro:bin chad$ sudo multipass set local.driver=hyperv
Invalid setting ‘local.driver=hyperv’: Invalid driver
MacBook-Pro:bin chad$ sudo multipass set local.driver=hyperkit
Invalid setting ‘local.driver=hyperkit’: Invalid driver
MacBook-Pro:bin chad$ sudo multipass set local.driver=virtualbox
Invalid setting ‘local.driver=virtualbox’: Invalid driver
MacBook-Pro:bin chad$ sudo multipass set local.driver=ldx
Invalid setting ‘local.driver=ldx’: Invalid driver
MacBook-Pro:bin chad$ sudo multipass set local.driver=libvirt
Invalid setting ‘local.driver=libvirt’: Invalid driver

I uninstalled removing what I could

1545 sudo sh “/Library/Application Support/com.canonical.multipass/uninstall.sh”
1547 brew uninstall --cask multipass
1548 brew install --cask multipass
1549 sudo multipass get local.driver
qemu

the multipass version

MacBook-Pro:bin chad$ multipass --version
multipass 1.8.1+mac
multipassd 1.8.1+mac
MacBook-Pro:bin chad$ sudo multipass --version
multipass 1.8.1+mac
multipassd 1.8.1+mac

@chad-nash that’s not a Multipass issue, you’re trying to run a dynamically linked library, so you’d need a x86_64 linker. If your binary would be statically linked, it would run fine:

ubuntu@primary:~$ uname -p
aarch64
ubuntu@primary:~$ file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=b12d5fd8ec8c4b87bbb2d1123c681222bcfb73c9, for GNU/Linux 3.2.0, not stripped
ubuntu@primary:~$ ./a.out
Hello, World!

Note the “statically linked” bit.

thanks saviq
regards Chad