How to run the latest Librem5 image on qemu on Macos


#1

I’m following the guide here -> https://developer.puri.sm/Librem5/Development_Environment/Boards/qemu.html

However when I try to run it with ./qemu-system-x86_64 -boot menu=on -drive file=~/Downloads/qemu-x86_64.img -vga virtio -display gtk -m 2G -enable-kvm
it fails with “Display ‘gtk’ is not available”.

if I omit the display parameter it just hangs there. Using display = cocoa also hangs.

Anybody know how to work around this on Macos? Which display parameter should I use to see the booting screen?


#2

First, don’t use -enable-kvm because that’s a Linux only feature.

I think I’ve managed to run it once but I didn’t save the exact command I used. Let me try later today…


#3

First attempt,

$ qemu-system-x86_64 --version
QEMU emulator version 4.0.0
Copyright © 2003-2019 Fabrice Bellard and the QEMU Project developers

$ qemu-system-x86_64 -boot menu=on -drive file=qemu-x86_64.qcow2,format=qcow2 -vga virtio -m 3G

This booted and went all the way to switching the window shape to look like a phone but no graphics were displayed.

$ qemu-system-x86_64 -boot menu=on -drive file=qemu-x86_64.qcow2,format=qcow2 -vga virtio -m 3G -accel hvf -cpu host

So “-accel hvf” is supposed to be the macOS (10.10+) equivalent of “-enable-kvm”. However when I do this I cannot get past the boot menu (not even GRUB just the qemu boot menu).

Will keep trying.


#4

Thanks, yeah, I’ve got the same results.
I’ve tried converting the qcow2 image to .vdi to run it on VirtualBox but it didn’t work stating there was no bootable media.


#5

To run it in VBox you probably have to convert the qcow2 image to a different file format recognized by VBox…

I’ve managed to run the image under qemu under Linux. I did notice that under Linux the example runs sudo, and in my attempts above I didn’t run sudo. Will try again when I reboot…


#6

Yeah, I’ve converted to .vdi which is a format that VirtualBox understands. Unfortunately, after setting up a VM to use that .vdi as the disk, it is unable to boot.
Initially the .vdi file was very small (< 1gb), but then I found a comment by a developer that adding -S 0 to the qemu-img convert command would help. Then the .vdi file ended up being 33gb, but didn’t boot either.
I then tried converting the .img file to a .iso so I could try to boot from it as the cdrom on the VM. That was also met with the same issue, not bootable.
I was able to install PureOS in a VM in Virtualbox. Once inside PureOS I was then able to download the qcow2 file and create a box for it using Gnome boxes. Naturally the performance was not that good.
I’m actually unsure if the performance was bad or I was having issues with the emulator recognizing my macbook trackpad. Cause I kept clicking and dragging to unlock the screen and it didn’t respond.
After much trial and error I managed to unlock the screen and enter the 123456 password and open the browser. I was unable however to find where are all the applications installed, I guess I need to learn more about how this mobile Gnome works.

Anyway, I hope to find a way to run the qcow2 image on macos so that I don’t have a VM within a VM LOL