It was a fun accomplishment

...even though I have no need for macOS.

My machine wasn't purpose-built for running macOS, but I've got High Sierra running in a KVM with (almost) everything working including onboard audio, usb, accelerated graphics and (emulated) Wi-Fi.

Hardware:
CPU: AMD Ryzen 5 2400G (finally, a use for the iGPU)
GPU: NVIDIA GeForce GTX 1070 Ti
RAM: 2x8GB G.SKILL Aegis DDR4-3000 (8GB available to VM but I could push it up some)
Host OS: Linux Mint 20 (based on Ubuntu 20.04)
Motherboard: MSI B350 Gaming Plus (BIOS: M.HR)
Audio Codec: Voodoo
Wifi/BT Card: Intel Wireless AC 8265 (Host emulates Ethernet to VM, Bluetooth passes through via USB)
Guide: The Passthrough Post

As for the system, this was the first computer I've built (around xmas 2018) so the specs aren't exactly optimized. For example, I have a CPU with integrated graphics because I didn't know how long it would be until I could buy a GPU (I ended up buying one a week later). I also have DDR4-3000 RAM but the R5 2400G can only run it up to 2933. Shortly after building it I tried running macOS just for kicks, and it was basically unusable. The Intel wireless adapter won't work natively in macOS, and the onboard audio and GPU drivers for whatever reason were mutually exclusive.

Flash forward to last year or so, and I saw the LTT video where they had macOS running in a KVM. I didn't think it was viable for me, but just recently the video showed up in my reccommended again. I decided to try it because hey, if it didn't work then all I had to do was delete a folder and be done with it. Luckily for me, The Passthrough Post (which LTT used in the video) had revised their guide, making it much easier. Now, the special sauce that makes running in a VM possible is the KVM Hypervisor feature of the Linux Kernel, which allows PCI Express pass-through. With that, I was able to pass my GPU, onboard audio and USB controllers through to the VM. Some Linux skills are required to get it set up, for example sudo apt install qemu doesn't install all of the QEMU components on my distribution, and to pass my USB and audio controllers through I had to install a patched kernel.

More info (rambling):
Doing this requires two GPUs, one of them can be an iGPU. (it is possible to do it with one GPU, albeit a little more difficult). I'm using Linux Mint 20 as my Host OS, because I already had it installed. If you're only interested in running macOS you'd be better off using Debian or Arch Linux. Setting this up requires a very basic understanding of Linux (enough to google your way out of problems). In my process, I had to configure AppArmor to allow QEMU to access the device files for my mouse/kb and the PulseAudio server, but this turned out to be a waste of time because audio emulation sucks and I wanted to attach more than a mouse and keyboard. I had to install a kernel with ACS Override to forward the motherboard's onboard USB and HD Audio controllers. If you don't want to do either of these or you really want the VM to be completely isolated you can buy a PCIe USB controller and plug all your peripherals into that (it would also allow you to plug peripherals into the host side and have two systems)

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