NixOS/mobile-nixos

Add AArch64 QEMU target

samueldr opened this issue · 6 comments

Should in some way provide a framebuffer and serial console.

Should be configured as close as possible to the postmarketOS ones.


This depends on cross-compiling (#5).

I just added QEMU x86_64, so I re-worked this issue as AArch64.

grwlf commented

Hi @samueldr Could you please provide some status on emulation? I am struggling to figure out is there a possibility to run mobile-nixos in some sort of qemu. It would be especially nice if there is a way to run a pinephone emulation.

I don't think that there's any value in running an AArch64 VM for PinePhone emulation.

This is because the "hard to emulate" hardware wouldn't be emulated. So you'd actually end up testing for QEMU AArch64, and not for the PinePhone.

What are your requirements?

For testing a configuration in a VM, I usually use the x86_64 UEFI vm:

 $ nix-build ./examples/hello --argstr device uefi-x86_64 -A outputs.uefi.vm && ./result

This provides an environment that, except for un-emulated hardware (brightness, sensors, modem) allows testing the integration of a Mobile NixOS config. An AArch64 VM wouldn't be much different in term of missing hardware.

Though, to be fair, an AArch64 VM should still be worked on, if only to better dogfood an AArch64-only workflow!

grwlf commented

Got it, thanks.

What are your requirements?

I think of two kinds of tasks: 1) to port some service modules from my desktops systems (networking, vpn, sync, etc). For them I think any vm would suffice. 2) I forecast that setting up mobile gui would require some efforts) To speedup the process a bit I would probably like to have emulator with a realistic gui.

Btw, I found this page where author describes a pinephone qemu port withou gpu. I'll pin it here. https://unxp.fr/post/2020/pinephone_on_qemu_emulation/
What I don't understand right now is whether he means that he has no GPU-acceleration (e.g. in games and videos) or that he has no graphics at all.

Looking at the implementation, it seems marginally useful.

The interesting hardware is missing. So this provides not much more than what an x86_64 UEFI vm would for system integration, and comparatively, not much more than an AArch64 UEFI vm would too.

This is especially since this is not booting using the same system startup and operating system startup flow as would be used on real Allwinner hardware! It directly boots a kernel+initramfs, completely skipping the hard and interesting parts of the boot process.

It's not entirely useless, but it's not really useful.


  1. to port some service modules from my desktops systems (networking, vpn, sync, etc). For them I think any vm would suffice.

Yes, and given Mobile NixOS is mostly NixOS once booted, your config from a normal computer should mostly just work.

  1. I forecast that setting up mobile gui would require some efforts) To speedup the process a bit I would probably like to have emulator with a realistic gui.

I'm not sure I follow.

If it's about the form factor, the QEMU system from that post won't provide anything more than a vertical 720p window, which the UEFI x86_64 VM also provides.

If it's about the interesting hardware, like sensors, wireless (wifi, bluetooth) or modem (voice, sms, data, gps) none of that is provided by that system either.

I invite you to try the x86_64 UEFI VM, and then tell me what is missing for this use case.

grwlf commented

If it's about the form factor, the QEMU system from that post won't provide anything more than a vertical 720p window, which the UEFI x86_64 VM also provides.

Yep, I meant this. I'll try x86_64 VM. Thank you for clarification!