Skip to content

Conversation

@esselius
Copy link

No description provided.

@SuperSandro2000
Copy link
Member

Can you provide some context why cocoa is better? I don't know much about MacOS.

@esselius
Copy link
Author

esselius commented Oct 22, 2025

Can you provide some context why cocoa is better? I don't know much about MacOS. @SuperSandro2000

Ah yes sorry for low detail, I'll bring in as much relevant detail as I can then.

qemu in nixpkgs isn't built with gtk on darwin by default:

$ qemu-system-aarch64 -h|grep cocoa -C 4
Display options:
-display spice-app[,gl=on|off]
-display vnc=<display>[,<optargs>]
-display curses[,charset=<encoding>]
-display cocoa[,full-grab=on|off][,swap-opt-cmd=on|off]
              [,show-cursor=on|off][,left-command-key=on|off]
              [,full-screen=on|off][,zoom-to-fit=on|off]
-display dbus[,addr=<dbusaddr>]
             [,gl=on|core|es|off][,rendernode=<file>]
-display none
                select display backend type
                The default display is equivalent to
                "-display cocoa"

So microvm.graphics.enable = true; gets you a:
microvm@example: -display gtk,gl=on: Parameter 'type' does not accept value 'gtk'.

If you do vmHostPackages.qemu.override { gtkSupport = true; }, you end up with a:
microvm@example: OpenGL support was not enabled in this build of QEMU.

If you also override openGLSupport = true;, you end up with unsupported host platform build error (libdrm not supporting darwin).

I backed down and did -display gtk,gl=on -> -display gtk, which gets you a:
microvm@example: -device virtio-vga-gl: 'virtio-vga-gl' is not a valid device model name

These are de supported display devices:

$ qemu-system-aarch64 -machine virt -device help
....
Display devices:
name "apple-gfx-pci", bus PCI, desc "macOS Paravirtualized Graphics PCI Display Controller"
name "ati-vga", bus PCI
name "bochs-display", bus PCI
name "cirrus-vga", bus PCI, desc "Cirrus CLGD 54xx VGA"
name "dm163", desc "DM163 8x3-channel constant current LED driver"
name "led", desc "LED"
name "ramfb", bus System, desc "ram framebuffer standalone device"
name "secondary-vga", bus PCI
name "ssd0323", bus SSI
name "VGA", bus PCI
name "virtio-gpu-device", bus virtio-bus
name "virtio-gpu-pci", bus PCI, alias "virtio-gpu"
...

apple-gfx-pci is for macos guests and virtio-gpu-pci does 3D accel for linux guests.

In the end, using gtk + virtio-gpu doesn't make a separate vm window show up, staying tty-only, while using cocoa does make a window pop up 🤷‍♂️ So this seemed like the most acceptable compromise, no overrides and 3d-accel support on both darwin and linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants