Working on a usable hackintosh VM

I've been tweaking and working on a hackintosh VM and it has been working incredibly well. I thought I'd share my experiences with this setup.

Host Hardware

This VM host is running the relatively cheap Xeon E5 v1 platform that was dumped on ebay in huge numbers last year. The processors were ~50 bucks each at the time and it was the perfect platform for hobby VMs.

CPU - 2x Xeon E5 2670 - SR0KX stepping. This has full support for VT-d. Other steppings may not work with it for GPU passthrough.

Motherboard - Intel S2600CP2J motherboard

Memory - 204 GB RAM

GPU1 - GTX 960 2G (Passed through to mac VM)

GPU2 - GTX 1050ti (Passed through to windows VM)

USB 3.1 card - Hornettek USB 3.1 PCI-e x4 card.

Storage - VMs live on a total of ~1 TB of SSD space. Split among a few old 850 pros of different sizes.

The actual VM 'hardware'

CPU: The VM was given all of the 32 threads from the host. The host in general is over provisioned but KVM/qemu does a really good job of scheduling when 90% of the threads would be idle anyway. The only weird part about this setup is the only way the VM will fully boot is if the VM reports the CPUID as penryn. I don't think it makes a huge difference but I'm curious if this prevents certain CPU features of the Xeon from being taken advantage of.

Memory: 64 GB of ram. I did not overprovision on RAM, that sounds like a terrible idea but I gave it a large slice of the total share.

Storage: 220 GB of SSD backed storage presented as one IDE device.

A 1 GB drive thats specifically used for the clover bootloader. This is an artifact of the tutorial I used. When I redo this setup I will probably use clover from the start and I might squeeze this partition onto the main mac HD.

A 4MB drive specifically for proxmox's EFI vars/storage.

Ethernet: In order for macOS to see your virtual ethernet adapter you have to change the model in proxmox to an e1000-82545em This worked out of the box.

GPU: GTX 960 2GB. I blacklisted this card from being used in the linux host and sent it to the VM.

Input and USB: This took the longest to get right. Not every USB card fully worked. Some showed up in macOS but didn't actually allow me to use the devices. The Hornettek is the card that works reliably and natively. The ASM1142 chipset it uses just works.

Installation

I used this tutorial to setup my VM. The tutorial is mostly straight forward if you know your way around proxmox. The most annoying part of installing macOS is sending input to the installer program. The native emulated mouse/keyboard does not work in the installer. I had to passthrough two motherboard USB ports to the VM in order to control it while using the browser on a different machine as the "monitor" as the GPU was not passed through at this point. You can edit your machine definitions in qemu to emulate a supported device but this broke the input on my other VMs.

The other issue I had was the fact that the top menu bar in the macOS installer did not render and I was not able to get to the Disk Utility to format the drive. There are solutions and hotkeys to enter the Disk Utility but I didn't have them at the time. Instead I mounted the virtual drive in a different linux VM and formatted it as hfs+ from there. This worked and I was able to continue with macOS setup just fine.

Once I got to the macOS desktop and verified it was functional, I installed noMachine to allow remote desktop into the machine. This was incredibly useful later for debugging GPU issues and allowing access to the machine.

Once I verified I had remote access to the machine I powered it down and worked on getting PCI passthrough working. 90% of the passthrough issues I had were not related to macOS. I had card compatibility problems in the case of the USB cards, verified by the fact that they could also not be passed to a windows VM, and just general documentation problems with GPU passthrough. Not every tutorial has every piece of information you need to know to get it fully working. Getting the add in cards to show up in macOS required a few hours of experimentation with the system definitions. I settled with the mac pro 3,1. This seems to work the best with my hardware.

What is broken?

I have a few small issues with the setup that i'm hoping aren't specific to the VM setup I'm running. Perhaps people here can help me out with this.

4k 60hz output: I have been unable to get any sort of 4k 60hz output out of my setup. I two displayport to HDMI 2.0 adapters that are confirmed to work at 60hz but I can't get my mac to allow me to set that refresh rate. The windows VM with the 1050ti does do 4k60 and I believe the 960 is also capable of it. I have read of issues with 4k60 output out of HDMI and the solutions are to use displayport adapters, so I did and It didn't help.

A weird system clock bug: My system clock keeps resetting after a certain amount of time. I can't quite pin it down. I have disabled sleep on the machine completely and because its a VM it doesn't share a system clock with any other machine. The host VM is set to UTC and so doesn't have the localtime issue that windows/mac dualboot machines have.

Since this is a virtual machine setup Its difficult for me to show the machine off but if there is a test you would like me to run or have questions about running macOS in a KVM vm let me know.

submitted by /u/swgbex
[link] [comments]