Live data from Hacker News

OS X-KVM: Run macOS on QEMU/KVM

github.com

1–10 of 73 posts

Re: OS X-KVM: Run macOS on QEMU/KVM

#4
See also quickemu which has support for launching macOS using information largely taken from this and similar repositories as well as Windows with TPM and enables all the good features: https://github.com/quickemu-project/quickemu

There is also another promising project called docker-osx which has the best documentation around doing the serial number generation to make iMessage etc work (you can use it in combo with most other methods but the docs are often confusing when I looked about a year ago): https://github.com/sickcodes/Docker-OSX

Re: OS X-KVM: Run macOS on QEMU/KVM

#5
I’m hoping to run macOS with QEMU/KVM with a project like this or another - does anyone know though if it is possible to pass through an intel integrated gpu (in a CPU only machine) to use for hardware acceleration?

Re: OS X-KVM: Run macOS on QEMU/KVM

#6
post #5

I’m hoping to run macOS with QEMU/KVM with a project like this or another - does anyone know though if it is possible to pass through an intel integrated gpu (in a CPU only machine) to use for hardware acceleration?

Yes, starting with CPUs circa 2014. You need CONFIG_DRM_I915_GVT from Device Drivers -> Graphics support -> Intel 8xx/9xx/G3x/G4x/HD Graphics -> Enable Intel GVT-g graphics virtualization host support.

There are a fixed number of partitions and a specific setup you need to do with /sys nodes, refer to the manual. Considering this and that support only became possible some time after 2014 it's worth realizing it does not work like normal VFIO passthrough. Why? No idea, seems like an oversight. Need to stop providing lying interfaces to users.

https://serverfault.com/questions/1048811/vfio-igpu-passthro...

Re: OS X-KVM: Run macOS on QEMU/KVM

#8
post #5

I’m hoping to run macOS with QEMU/KVM with a project like this or another - does anyone know though if it is possible to pass through an intel integrated gpu (in a CPU only machine) to use for hardware acceleration?

Not really pass through, no. If CONFIG_DRM_I915_GVT is enabled in your kernel, you can use Intel's graphics virtualization system... basically a virtio style virtual device that shares the GPU between VM and host. IMO this is way more convenient than real passthrough, where the device is only available either to the VM or the host. The downside is that you don't get full performance in the VM.

"Intel GVT-g is a full GPU virtualization solution with mediated pass-through (VFIO mediated device framework based), starting from 5th generation Intel Core(TM) processors with Intel Graphics processors. GVT-g supports both Xen and KVM (a.k.a XenGT & a.k.a KVMGT). A virtual GPU instance is maintained for each VM, with part of performance critical resources directly assigned. The capability of running native graphics driver inside a VM, without hypervisor intervention in performance critical paths, achieves a good balance among performance, feature, and sharing capability."

https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide

Re: OS X-KVM: Run macOS on QEMU/KVM

#9
post #5

I’m hoping to run macOS with QEMU/KVM with a project like this or another - does anyone know though if it is possible to pass through an intel integrated gpu (in a CPU only machine) to use for hardware acceleration?

It didn't work when I tried to pass through a virtualized GVT instance in Catalina a couple years ago.

Although this all will not matter once macOS becomes exclusive to Apple Silicon.

Re: OS X-KVM: Run macOS on QEMU/KVM

#10
post #5

I’m hoping to run macOS with QEMU/KVM with a project like this or another - does anyone know though if it is possible to pass through an intel integrated gpu (in a CPU only machine) to use for hardware acceleration?

I believe the most promising route is to not try to do passthrough but to use a "virtual" gpu, aka a paravirtualized device. Thanks to the contributions of an open-source developer*, virtio-gpu has been ported to macOS (it already works on Linux but not on Windows and soon it will be on macOS). Apple is also reportedly working on bringing better support for macOS virtualized environments [2].

It means that users will be able to create any number of macOS instances with 3D acceleration, without having to care about trying to do complicated things (mediated devices or single-gpu passthrough or pci-passthrough of a second GPU).

As of now, the performance hit is high (more than 50%), but it will certainly improve over time, and many users might already find it acceptable (= people NOT playing recent video games).

Icing on the cake, thanks to the EGL-headless display (which is independent of virtio-gpu) and VNC, it is possible to connect to these instances remotely.

Shameless plug: I am working on Phyllome OS [3], a Fedora Remix with the goal to include the necessary plumbing to ease advanced virtualization techniques for end-users, and to offer curated virtual machine models.

I currently only use virtual machines as desktop machines, including locally, and even my poor x230 laptop can do it. I keep the host operating system intact (Phyllome OS), and use VMs as desktop machines. It has drawbacks (difficult USB access; displays models that were not designed for local use; sound support), but I firmly believe it will get better over time and, perhaps, one day, end-users will be able to easily deploy any modern OS on any modern hardware...

[1] Sorry, I could not find the link to the repository [2] https://passthroughpo.st/mac-os-adds-early-support-for-virti... [3] https://phyllo.me/

[edit] Delete mention of KVM/QEMU

Post reply on HN