What does HackerNews think of OSX-KVM?

Run macOS on QEMU/KVM. With OpenCore + Big Sur + Monterey support now! Only commercial (paid) support is available now to avoid spammy issues. No Mac system is required.

Language: Python

#2 in macOS
I just researched a bit, mac os x guest vm with pcie passthrough seems possible on linux.

Dropping the links below:

https://github.com/kholia/OSX-KVM

https://github.com/yoonsikp/macOS-KVM-PCI-Passthrough

You can use qemu/libvirt/kvm on any Linux host to run macOS pretty easily these days[1]. I run Ventura on unraid with nvidea gpu passthrough (w/ ryzen cpu even!) and it’s been fairly painless.

You can also run macOS in docker, but it’s ultimately running through qemu/kvm as well[2]

1. https://github.com/kholia/OSX-KVM

2. https://github.com/sickcodes/Docker-OSX

I recently wanted to build Python wheels for a whole bunch of Python versions and packages on Mac ARM64. I ended up using OSX-KVM, and then using cibuildwheel to crossbuild to arm64. Pretty dang easy.

I set up OSX-KVM (https://github.com/kholia/OSX-KVM) and it worked really well. Having archlinux is a huge plus for this (it's why the docker image uses it), as qemu is super simple to setup and get running. Was surprised how easy it was, but given how much effort the bootloaders have had over the recent years for Hackintosh, qemu users can just yoink that bootloader and use it.

Dual boot into a linux OS and run :

https://github.com/kholia/OSX-KVM

The repo works well. Tweak the CPU cores and type for emulation. If you're running an Intel CPU you're pretty set as you wont be required to emulate as if you were one (aka running a Ryzen perhaps).

On my Ryzen 16cores, I get about 90%+ performance inside the OSX vs my native machine.

If not going with dual boot, while you can run QEMU with windows, you won't have the KVM accelerator which is how I got high performance. You might want to try nesting a Linux inside Hyper-V and then running Qemu inside of that.

Take a look here https://github.com/kholia/OSX-KVM. Post install, I use the "Opencore-Boot.sh" script to boot the machine and inside of it modify the cpu "Penryn" to Icelake one assuming you're running a Ryzen one.

I did get some warnings from QEMU along the lines of "X register doesnt exist" or something but the machine runs fine and geekbench runs fine as well. Play with the cores/threads settings as well. If you go too high (for me was around 8), it doesn't boot up and just hangs.

> Also you're required to sign in for updates so they can track you. No software patches without monitoring.

This hasn't been my experience. macOS still incessantly bothers you about OS updates even if you decline signing into an Apple account during first-boot, and you can download major release updaters independently from the Mac Store (e.g. using the script from OSX-KVM).

[1] https://github.com/kholia/OSX-KVM

I know it's unmaintained now, but SimpleOSX VM defaulted to a Core 2 Duo.

Looks like it's successor also defaults to a Core 2 Duo, though with 2 cores and SMT.

https://github.com/foxlet/macOS-Simple-KVM https://github.com/kholia/OSX-KVM

That being said, just browsing through that site, it doesn't immediately seem like it's this family of Hackingtosh VMs adding significantly to the list or at all.

You need to dedicate the instance for a full 24 hours, so if you're doing daily builds you'll probably end up paying for a mac mini every month.

Not that I'd ever do or recommend it in a commercial setting, but hobbyists should probably just fire up something like https://github.com/kholia/OSX-KVM to do builds.

Newer versions of VMWare work under a Hyper-V host [1]. I'm not sure if macOS runs properly in that mode though. I also had some success a while back running macOS under WSL2 using KVM [2], though it was pretty buggy and a pain to set up.

[1] https://blogs.vmware.com/workstation/2020/05/vmware-workstat...

[2] https://github.com/kholia/OSX-KVM

I use this: https://github.com/kholia/OSX-KVM

It works quite well for me. Simulator works fine (though graphics are slow) and so does connecting a physical phone (by passing through the USB controller).

This is false. OSX runs fine on non-Apple hardware without patching.

https://github.com/kholia/OSX-KVM

> please let me know your experience

You can run Linux as a host, macOS as a guest[1] under QEMU, buy a second GPU that is supported by Apple (e.g., Sapphire Radeon RX 580 Pulse 4GB) and pass that GPU in its entirety to the guest macOS. The same for one of the USB controllers on your motherboard. Effectively, you get native macOS performance under Linux. A bonus: you can use the iptables firewall with the FORWARD ruleset to control guest macOS network access. The overall setup process is involving, but nothing that an intermediate Linux user would not be able to handle. Please note that it might be actually illegal (?) in some (?) countries to run macOS software on non-Apple hardware.

[1] https://github.com/kholia/OSX-KVM

It depends on your internal GPU. If it's an Intel GPU, you could use vfio-mdev, which allows you to split your physical GPU into smaller counterparts. It will only work with the macOS version that are compatible with Intel GPUs (probably most of them).

Have a look here for a guide on Archlinux : https://wiki.archlinux.org/title/Intel_GVT-g. And here for a script to deploy macOS on KVM : https://github.com/kholia/OSX-KVM.

Side-note : vfio-mdev can now be unlocked on consumer-grades Nvidia cards too : https://github.com/DualCoder/vgpu_unlock. Sadly, it is not possible for AMD-cards.

By the way, I am working on Phyllome OS (https://phyllo.me/), which is an attempt to make it easier to do such things. But please don't tell anyone :)

You can also run Catalina and Big Sur on Linux with OSX-KVM[1]. It does everything for you and more up-to-date.

1: https://github.com/kholia/OSX-KVM

Sosumi Snap uses Clover internally.

[1] showed how to boot macOS in KVM without the usual Clover / Opencore setup but is not maintained for newer versions anymore. [2] shows how to run current macOS versions without Clover or Opencore in VirtualBox by changing the VM's ACPI(?) entries and loading variables into the NVRAM. [3] uses KVM but also uses Opencore.

I tried to translate [2] to QEMU but was never successful.

Does anybody know some resources how to have a pure KVM macOS VM without any hackintoshing?

[1] https://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/

[2] https://github.com/myspaghetti/macos-virtualbox

[3] https://github.com/kholia/OSX-KVM

You may find the reasoning here interesting: https://github.com/kholia/OSX-KVM

The "secret" Apple OSK string is widely available on the Internet. It is also included in a public court document available here. I am not a lawyer but it seems that Apple's attempt(s) to get the OSK string treated as a trade secret did not work out. Due to these reasons, the OSK string is freely included in this repository.

That repo has been around for many years.

And also https://github.com/kholia/OSX-KVM (which I found by searching the OSK and finding another HN thread about from 2016, with the same conversations about legality, e.g. https://news.ycombinator.com/item?id=12558195)
Not the poster you're replying to, but a cheesegrater MP4.1 with Debian and this package (https://github.com/kholia/OSX-KVM) works just fine.

Never bothered with GPU passthrough however.

tcpdump them, or read the data/privacy disclosure link at the bottom of the first launch pane of any of them.

https://github.com/kholia/OSX-KVM if you need an easy way to fire up a fresh install.

You can read the main Github page here: https://github.com/kholia/OSX-KVM

It only works on Macs, it needs the toolchain and ROM I guess? Docker is just one step closer to porting it on the Windows and Linux platforms.

Personally, if I wanted to run MacOSX that badly, I'd buy a Mac Mini or the lowest-priced Mac they have. Much easier and worth it for the AppleCare and Warranty.

Edit: grammar and spelling.

More info on the project in this reddit thread from a few hours back:

https://www.reddit.com/r/jailbreak/comments/gwg3e4/free_rele...

The developer mentions[0] that, like macOS-Simple-KVM[1], this leverages kholia's OSX-KVM[2].

[0] https://www.reddit.com/r/jailbreak/comments/gwg3e4/free_rele...

[1] https://github.com/foxlet/macOS-Simple-KVM

[2] https://github.com/kholia/OSX-KVM

Of you are thinking of a hackintosh just to compile, then it would probably be easier to just virtualize it.

https://github.com/kholia/OSX-KVM

macOS on amd64 works well enough on upstream qemu with a few hacks: https://github.com/kholia/OSX-KVM
The arch linux wiki page [1] is a good place to start (Note you don't have to use arch for the host to get value out of the page, I use nixos), and/or the macos repo [2] (Or maybe this newer one [3])

The only real hurdle hardware wise is your IOMMU groups and your CPU compatibility, if you have a moderately modern system it should be a problem.

I also have a couple of inexpensive PCIe USB cards that I pass through to the guests for direct USB access, highly recommended.

The guides will use qcow2 images or pass through a block device, as I mentioned I have a giant LVM pool, I just create lvs for each vm and pass the volume through to the vm as a disk , and let the vm handle it. In the host you can use kpartx to bind and mount the partitions if you ever need to open them up.

[1] https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVM...

[2] https://github.com/kholia/OSX-KVM

[3] https://github.com/yoonsikp/macos-kvm-pci-passthrough

I don't have any specific guides about my setup, but here are a few things that have been helpful to me:

- Good starting point for setting up macOS under QEMU/KVM: https://github.com/kholia/OSX-KVM

- DSDT/SSDT patching: https://www.tonymacx86.com/threads/ssdt-gpu-graphics-card-in...

- AMD reset bug: https://www.reddit.com/r/VFIO/comments/5h351m/gpu_stuck_in_d...

- Kernel extension that can help with some GPU issues: https://github.com/acidanthera/WhateverGreen

The DSDT/SSDT patch was probably the trickiest thing. I've posted my particular patch here if you're interested: https://pastebin.com/ngvkVZYN

Also, a few of my other scripts/config: https://pastebin.com/9Nh5rheZ

You can run Hackintosh on KVM just right away, although there are practically no 3D acceleration (unless you opt for PCI passthrough) and the performance is really tearful awful, still, it runs Simulator just fine.

https://github.com/kholia/OSX-KVM

You can now run macOS in Linux KVM (https://github.com/kholia/OSX-KVM), although I guess you'd need a beefy machine to have Indesign run fluently in a VM. Also I don't know if and how the license manager works in a virtualized environment. I guess overall it's not more hacky than Hackintosh :)
Here are some other links for people who are interested in trying to run hackintoshes:

- https://github.com/geerlingguy/macos-virtualbox-vm

- https://github.com/kholia/OSX-KVM

Personally I ended up just buying a Mac Mini and upgrading it's RAM. It's unfortunate, but I was under a deadline and didn't want to risk having a technically-illegal version of MacOS prevent me from building/publishing client apps suddenly.

In the future, I'm going to just take writing iOS apps off the list of services I offer.

System76 Bonobo. My day job involves cloud (k8s) GPU stuff and it's the only linux laptop I could find with two Nvidia GPUs. The trackpad sucks ass, the power connector is stupid. It's full of batteries that only provide an hour (max) of battery and it's only a laptop in the sense that it can (technically) fit on my lap.

A coworker recently got the single GPU Serval, and I could see using that daily. Ubuntu 18.04 is a great desktop OS. I have tentative plans to take apart my Bonobo, remove the batteries, put power supplies inside with a standard power plug out the back and cut out the trackpad and fit in an Apple trackpad.

LXD+QEMU makes it a pretty nice machine. I almost don't miss OSX and this [0] project has solved a lot of those issues.

[0] https://github.com/kholia/OSX-KVM

If you're interested in this, you may also be interested in OSX-KVM[1], which handles all the steps necessary to create an installation image that works with qemu/kvm.

[1] https://github.com/kholia/OSX-KVM/

Kind of hijacking the thread, but what's the best software for running graphical VMs on top of a Linux desktop? (i.e. a Parallels equivalent)

I tried setting up MacOS through Qemu/KVM (using these instructions [0]) and it installed pretty much fine. I don't have a spare graphics card or monitor for VFIO, so I tried running it in a window, but the mouse and keyboard capturing was really finicky, so it was completely unusable.

[0] https://github.com/kholia/OSX-KVM

Virtualization (e.g. https://github.com/kholia/OSX-KVM) can help a lot by reducing your dependence on specific parts. If you stick with an Intel CPU and a motherboard with an IOMMU and a well supported graphics card you're pretty likely to be okay. IOMMU support has gotten to be super common, even on lower end processors and motherboards.