UTM icon indicating copy to clipboard operation
UTM copied to clipboard

Request: new MacOS paravirtual graphics support from Qemu 10?

Open oscarbg opened this issue 8 months ago • 7 comments

Qemu 10 is released and according to Phoronix ships with it: “QEMU 10.0 graphics code added new "apple-gfx-pci" and "apple-gfx-mmio" devices to use the macOS host's para-virtualized graphics framework to provide accelerated graphics to macOS guests. The apple-gfx-pci is intended for x86_64 guests while apple-gfx-mmio is for AArch64 macOS.”

May UTM backport it to current Qemu used or update directly to Qemu 10? Thanks..

oscarbg avatar Apr 23 '25 01:04 oscarbg

macOS virtual machines in UTM currently use the Apple Virtualization framework which has had accelerated graphics on arm64/Apple Silicon hosts for a while, and the implementation is more complete and more performant that the nascent QEMU implementation.

https://developer.apple.com/documentation/paravirtualizedgraphics

Is there a specific usecase that you have for using QEMU instead of HVF/AVF for macOS guests on macOS hosts?

ideologysec avatar Apr 24 '25 16:04 ideologysec

not really.. just searching Qemu 10 release notes for MacOS changes that could get used by UTM.. but not any usecase.. just keep open. in case implemented in the future?

oscarbg avatar Apr 24 '25 16:04 oscarbg

macOS virtual machines in UTM currently use the Apple Virtualization framework which has had accelerated graphics on arm64/Apple Silicon hosts for a while, and the implementation is more complete and more performant that the nascent QEMU implementation.

https://developer.apple.com/documentation/paravirtualizedgraphics

Is there a specific usecase that you have for using QEMU instead of HVF/AVF for macOS guests on macOS hosts?

Is the Apple Virtualization framework used also for emulated VMs, like a x86-64 one on Apple Silicon? Accelerated graphics would be useful also in that case.

mocenigo avatar Apr 24 '25 18:04 mocenigo

Is the Apple Virtualization framework used also for emulated VMs, like a x86-64 one on Apple Silicon? Accelerated graphics would be useful also in that case.

No. QEMU is used as the backend for cross-platform VMs.

Would this feature work for what you're asking about?

Short answer: very maybe, probably not.

Longer answer: Keep in mind that this is specifically for macOS guests and hosts only. I'm not clear if the paravirt drivers work from a macOS x64 guest to a macOS arm host, but since this is all backed by the platform Virtualization framework and that framework doesn't support cross-platform VMs, it seems unlikely.

QEMU may develop this in the future but as it stands I don't believe this feature works that way, and without someone writing a QEMU Apple paravirt graphics driver for both Linux and Windows, it will never work there.

ideologysec avatar Apr 24 '25 19:04 ideologysec

Is the Apple Virtualization framework used also for emulated VMs, like a x86-64 one on Apple Silicon? Accelerated graphics would be useful also in that case.

No. QEMU is used as the backend for cross-platform VMs.

Would this feature work for what you're asking about?

Short answer: very maybe, probably not.

Longer answer: Keep in mind that this is specifically for macOS guests and hosts only. I'm not clear if the paravirt drivers work from a macOS x64 guest to a macOS arm host, but since this is all backed by the platform Virtualization framework and that framework doesn't support cross-platform VMs, it seems unlikely.

QEMU may develop this in the future but as it stands I don't believe this feature works that way, and without someone writing a QEMU Apple paravirt graphics driver for both Linux and Windows, it will never work there.

Ok, thank you for the explanation. Also the new QEMU feature would not work with linux, since they are specific to macOS guests.

mocenigo avatar Apr 24 '25 19:04 mocenigo

Following up on this, QEMU does support additional features such as debugging, etc, that could potentially make it a useful addition to UTM.

https://x.com/lauriewired/status/1916544677689335818

ideologysec avatar Apr 28 '25 14:04 ideologysec

Yes this will be picked up when we update QEMU

osy avatar May 07 '25 16:05 osy

unfortunately patch "qemu: enable vmapple for macOS" has been reverted.. https://github.com/utmapp/UTM/commit/a3e3efb93e7856c95a9e2fc483e60179023adaa8

EDIT: @osy maybe reopen the issue in the meanwhile?

oscarbg avatar Jul 29 '25 22:07 oscarbg

apple-gfx-pci is still available and is the only useful thing from that patch (vmapple works better in Apple virtualization anyways)

osy avatar Jul 29 '25 23:07 osy