Hackintosh Post Install

/ Comments off

For a few years now, thanks to the hard work of others in the QEMU/KVM community, the ability to use the macOS operating system on our KVM powered virtual machines is now a reality. We can also enable a much better user experience for OSX virtual machines using GPU Passthrough.

  1. Hackintosh Post Install Youtube
  2. Hackintosh Post Install Guide
  1. If you get this message while installing, make sure your BIOS clock is set to the correct time and that you are connected to the internet. If that did not solve the issue, follow the install instructions again starting from the top, but this time do not select 'Patch OSX Installer' after running the package.
  2. May 11, 2020 Post Installation Audio HDMI Audio General Help Graphics Network Hardware Troubleshooting macOS / OS X Updates The Workshop Bootloaders Customization Overclocking Case Mods Completed Mods iMac Mods Mac Pro Mods PowerMac G3 B&W PowerMac G4 PowerMac G4 Cube PowerMac G5 Others Retail Cases Modders Tools.

Read Also: Benchmarking Linux OGL performance with Bugle

If you've given the Hackintosh route a try since my first post, let's hear how it's been working out for you in the comments. Before you can boot into or install OS X on your Hackintosh, you.

In this guide we will be showing you how to create a Hackintosh-KVM virtual machine using QEMU’s i440fx chipset, with the added benefit of using host passthrough of the CPU, instead of using the Penryn emulation that tends to be the usual way to get OSX up and running.

This guide will also be setting up these VMs as “Hackintosh” systems. We will not be using Apple’s actual OSK(SMC) key, which is an attempt to make your virtual machine a “Real Macintosh.” This information is provided for entertainment purposes only and The Passthrough POST waives all liability for any and all of what you do with it.

The main reason this guide focuses on the i440fx chipset is that there are still a few wrinkles that need to be ironed out on q35 with 10 series Nvidia GPUs and host CPU pass-through, whereas i440fx works well regardless of the host system’s hardware. If you want to find q35 chipset guides, they are available elsewhere for the time being. We will be adding an additional guide to Hackintosh-KVM series concentrating on the q35 chipset soon, after some testing is done to ensure it works with host CPU pass-through, macOS updates, and stability in general. We encourage others in the VFIO community to join our Discord server and help us out to work out other issues in the future.

Synopsis

  • This guide assumes that you already have set up a GPU pass-through virtual machine in the past and have experience with QEMU and libvirt, no support/steps will be given in the Hackintosh-KVM guide for setting up QEMU/libvirt for GPU pass-through, networking, CPU pinning, etc. If you need help with setting that up, refer to the The Passthrough POST Discord server.
  • This guide has only been tested with Ryzen CPUs. Your mileage may vary when using a Intel CPU (though we don’t expect any issues.) We encourage our readers to help contribute their experiences with Intel hosts, so this guide can be updated as appropriate.
  • The author also recommends that the initial setup to be done via GPU pass-through for ease of installation, as other display methods may or may not work(QXL,vmwvga,etc).
  • Clover is only to be used as it’s needed for the various tweaks within this guide. We will not supporting the Enoch or any other bootloader at any time during the Hackintosh-KVM guide.
  • We recommend using the OVMF files from the Hackintosh-KVM repo. We also recommend using recent versions of the kernel, libvirt, and QEMU. This is not guaranteed to work on versions older what was tested at the time this article was written.
  • For older or patched versions of QEMU and other applications, refer to kholia’s guide on github for additional patching/procedures.
  • We recommend using LVM or a standard image file(.img) to achieve the best I/O performance possible, using a .qcow2 image file with QEMU’s emulated SATA controller leads to rather abysmal performance in our testing. ZFS vdevs can also be used, but this has not been tested at the time of this write-up for disk I/O performance, although they should perform fine.
  • The author also recommends setting the CPU governor to performance and/or use a QEMU hook to ensure that the virtual machine is at its utmost performance. The xml file from the Hackintosh-KVM repository contains arguments for PulseAudio and evdev pass-through. If you plan to use this, you will want to make sure that evdev and PulseAudio pass-through are set up and working correctly beforehand.
  • We will be using the iMac18,3 SMBIOS with Clover as other versions of Macintosh’s include Thunderbolt 3 firmware, which upon update, will corrupt OVMF’s nvram, thus making the virtual machine unbootable.

Author’s Host System

  • Gentoo using a AMD Ryzen 5 1600 CPU with a Nvidia GTX1070 FE GPU for graphics pass-through. This was also tested with a AMD Ryzen 7 2700X and EVGA GTX1050 Ti FTW. Mojave breaks support for 9 and 10 series GPUs and 20 series cards will be totally unsupported.
  • Tested with QEMU 2.12 using a patched OVMF that the author created, which is located in the Hackintosh-KVM repository, and Linux kernel 4.17 (4.16 was also tested to be working too).
  • You will need a CPU with at least SSE4.1 to use macOS High Sierra/Mojave. Intel VT-x / AMD SVM is required.

Installation Prerequisites

  • Download the macOS High Sierra installer from the Apple App Store. Use the create_highsierra_iso.sh script from the Hackintosh-KVM repository to create a ISO for the virtual machine.
  • Run the ISO creation script create_iso_highsierra.sh on your real Macintosh. The High Sierra ISO file will be located in the Desktop folder when it is finished.
  • If you do not want to use the script from the Hackintosh-KVM for creating a ISO file, you can also refer to: https://www.tweaking4all.com/cd-dvd-blu-ray-disc-burning/burning-for-macmacOS/convert-dmg-to-iso/ for information on how make a ISO file for your virtual machine on your real Macintosh.
  • Lastly, copy the generated ISO image from your Macintosh’s Desktop folder to your host QEMU/KVM machine via Samba/NFS, or use a USB drive.

Hackintosh-KVM Preparation steps

Update: As of 10/20/2018 the repository location changed to the TPP Github repository

  • To get started, clone the repository listed below. The files included in this repository are necessary for creation of the virtual machine and will also be needed when you install Clover to the EFI folder of your Hackintosh install.
  • git clone https://github.com/PassthroughPOST/Hackintosh-KVM
  • Before you get started on anything else, you will want to define the xml, as root, using virsh define osx_i440fx.xml from the folder you have it located in. Next you will want to use Virtual Machine Manager to add your GPU, disks, and any other devices you plan on passing to the virtual machine. After that, you will want to open the xml file for the virtual machine and edit it for the location of your OVMF files, CPU pinning, and evdev pass-through. This can be achieved via virsh edit osx_i440fx. If you do not intend to use PulseAudio or evdev pass-through, delete the corresponding lines to those in the xml file.
  • The xml will have a virtio-net adapter on a bridged network interface, you may want to change from the bridged interface if this doesn’t match your network topology.
  • To enable pass-through of our hosts CPU feature flags we will be faking the CPU vendor ID via the QEMU argument shown below, do note that this will override what you have set in Virtual Machine Manager’s CPUs menu.
  • It is not recommended to set the CPU topology for multi-threading while in this menu, due to a bug in Clover, and instead to only set the amount of cores in the current and maximum allocation menus to the amount we want for the virtual machine. The reason for this is multi-threading does not work as intended with the QEMU and macOS. Passing the virtual CPU’s as sockets(which is default), or up 8 cores and 1 thread, has lead to far better CPU performance in the authors testing.

qemu:arg value='-cpu'
qemu:arg value='host,vendor=GenuineIntel,kvm=on,vmware-cpuid-freq=on,+invtsc,+hypervisor'

  • Create a virtual HDD where macOS will be installed. This can be done via Virtual Machine Manager’s Storage utility which is located in > Edit > Connection Details > Storage > Add-Pool, to create storage pool(s).
  • Create a Clover boot disk, libguestfs is a required dependency. (The steps below are optional)
  • To start off, you will want to edit $HOME/YourFolderHere/config.plist and set the desired screen resolution(OVMF by default is 1024×768). Do note that you may experience display corruption with higher resolutions, be sure to set this properly.

sudo ./clover-image.sh --iso Clover-v2.4k-4630-X64.iso --cfg $HOME/YourFolderHere/config.plist --img clover.qcow2

  • Next you will want to add some kext files to your newly created clover boot disk. The kexts files needed are also located in the Hackintosh-KVM repository. The kext files in this repository are used for GPU sensors, PulseAudio pass-through, and the Virtio-Net network device. The WhateverGreen kext is also needed if you use a AMD GPU, however it has not been tested. This step will also require the NBD kernel module to be loaded.
  • Connect and mount the clover.qcow2 image:
    sudo modprobe nbd
    sudo qemu-nbd --connect=/dev/nbd0 /$HOME/YourFolderHere/clover.qcow2
    fdisk /dev/nbd0 -l
    sudo mount /dev/nbd0p1 /mnt/somemntpoint/
  • Disconnect and unmount from the clover.qcow2 image:
    umount /mnt/somemntpoint/
    sudo qemu-nbd --disconnect /dev/nbd0
    sudo rmmod nbd
  • Instead of building your own bootable Clover disk, you may want to use the included clover.qcow2 disk image from the Hackintosh-KVM repository instead for ease of use, as this contains all the kext files needed, and offers a 1920×1080 screen resolution. It should be noted that the clover.qcow2 image can be useful as backup EFI bootloader in case you were to mess up your bootloader during a Clover update.
  • Before fully starting Clover on your new virtual machine, you will want to make sure that the OVMF resolution is set equal to the resolution set in your clover.qcow2 file. The OVMF default is 1024×768 and the clover.qcow2 image you will be using is set to 1920×1080, not setting this correctly will lead to display corruption and possible boot failures. The resolution can be set via the OVMF boot menu, which is able to be reached by pressing the ESC button on your keyboard during the OVMF boot logo, before the Clover boot screen appears.

Installer Steps

  • After booting, the initial language selection should show up. Select your preferred language, then select Disk Utility and erase your target disk. You can use HFS+ or APFS, as the clover.qcow2 image we are using has the proper EFI files for either file system. If you do choose APFS, make sure you place the apfs.efi file into your EFI folder when you install Clover to your boot disk.
  • High Sierra’s (< 10.13.3) Disk Utility does not recognize un-formatted disks, unless you click View > Show All Devices, quit Disk Utility, then relaunch it.
  • In some rare cases the target disk may not not appear in Disk Utility, for that you will need to use the Terminal app on the installer and prepare the hard drive for installation manually using the commands below.

diskutil list
diskutil eraseDisk JHFS+ macOS disk0# Adapt this according to your system

  • When you are done, quit Terminal.
  • Now, you can continue with the installation as you normally would.
  • When you are finished, the virtual machine will reboot automatically and the first time setup screen will appear, congratulations, you now have a Hackintosh-KVM virtual machine with close to bare metal performance! Hold on though, you’re not done yet, the last step is to follow the Post-Install Steps below, and put the Clover bootloader on the drive you just installed macOS to, so you can have the benefit of adding additional kext files, etc., in the future to make your virtual machine work better.

Post-Install Steps

First, you will want to install Clover to the main disk where macOS High Sierra was installed in the previous steps. You will also want to use the config.plist and i440fx-acpi-dsdt.aml files from the Hackintosh-KVM repository, as this has everything set as it would be in the clover.qcow2 image. The i440fx-acpi-dsdt.aml file will be placed in the EFI/CLOVER/ACPI/origin folder. Be sure not to forget the kext files you need and place them into the Kexts folder.

To use QEMU’s “host” CPU model you will need to make sure that these options are enabled in Clover Configurator’s “Kernel and Kext Patches” section.

You will also want to remove the +hypervisor bit from the QEMU cpu argument at the bottom of the xml file and set in Clover Configurator’s CPU section your system clocks as close as possible.

qemu:arg value='-cpu'
qemu:arg value='host,vendor=GenuineIntel,kvm=on,vmware-cpuid-freq=on,+invtsc'

To enable PS/2 mouse and keyboard emulation the VoodooPS2.kext will be needed, for ICH6 or ICH9 PulseAudio pass-through the VoodooHDA.kext is needed. The author found that using the emulated USB mouse and keyboard drivers, the keys have would have issues with sticking during a long keystroke on the authors hardware. Your mileage may vary here and technically no additional kext file is needed to use QEMU’s emulated USB mouse and keyboard.

For mounting of other filesystems (NTFS,EXT4,etc.) refer to:
https://github.com/macOSfuse/macOSfuse

For a quick way to install Nvidia drivers refer to:
https://github.com/Benjamin-Dobell/nvidia-update/blob/master/README.md

If you like what we do here, consider supporting us on Patreon.

Images courtesy PixaBay

Due to certain recent developments, It’s become clear to us that it’s necessary to update and improve our OSX VM guide. A lot’s changed since we wrote it, and rolling in those changes will make the process much more user friendly and accessible to newer VFIO users.

So here’s part 1 of our attempt at making this process easier and more straightforward.

This site is ad-free and always will be. Consider supporting us on Patreon if you like our work and want to see more from us.

Prerequisites for a basic OSX VM

  • A CPU supporting SSE 4.2 (most modern ones do)
  • 64gb+ free space for VM image
  • working basic knowledge of linux

Prerequisites For 3D Acceleration

  • A Desktop with modern virtualization extensions and functional IOMMU
  • Spare GPU to pass to the VM
  • A linux install with a Qemu installation and configured to enable relevant platform features.
  • If you want Mojave or future versions of OS X, you must have a 700 series nvidia GPU or an AMD gpu without the reset bug. (Generally 280X and older as long as they have a UEFI VBIOS)

Disclaimers and Warnings

  • The vast majority of laptops won’t work, and using an eGPU to make them work is not covered in this guide.
  • Using software acceleration and not doing passthrough will degrade performance to some degree
  • No hackintosh project is update safe, and you will likely need to upgrade clover at points to maintain functionality.
  • We do not condone software piracy. We don’t offer support for those who obtain commercial software through illegitimate methods.
  • Pay attention to Apple ID related steps if you plan on logging in with a pre-existing account. Like any other hackintosh, you risk a temporary ban from apple if you don’t take proper measures.

Basic Setup

First, install a few prerequisite packages. You’re going to need qemu, python, pip, click, request, git, and all the relevant dependencies. So run:

then install click and request:

From here, you’re gonna need to use git to get the macOS-Simple-KVM repo from github:

Make sure to do this in a working directory where you want the VM files to live. The jumpstart script defaults to 10.15 Catalina. If you would rather install mojave, or high sierra, just run it with the corresponding argument, e.g. ./jumpstart --high-sierra, --mojave, or --catalina

The jumpstart script should make the recovery media for your VM to install from. After it finishes, simply create a qcow2 image by running

and adding these 2 lines to the end of the included basic.sh script

where MyDisk is the name of your image.

You may also want to change the mac address listed in line 23 (-device e1000-82545em ...) of ./basic.sh at this point to avoid Apple ID issues, as the provided one is not unique. a new mac address can be generated easily by running openssl rand -hex 6 sed 's/(..)/1:/g; s/:$//' and pasting the output into the mac= argument. You can also just generate a new mac address in the virt-manager GUI at a later stage (don’t log in in the meantime.)

Hackintosh post install high sierra

From here you can boot your new VM by running ./basic.sh.

Basic Installation

Your vm should, after a short while, boot into clover, and then an OS X recovery partition. From here, click “Disk Utility” and format the image you created using the “Erase” button. Be sure not to format the recovery disk or the small partition labeled ESP.

After that, exit disk utility and click “reinstall OS X.” Follow the prompts and grab a coffee. This bit can take a while.

Hopefully by now, you have a basic working OS X VM.

Hackintosh

From here, there are a few common tweaks you may want to do to improve performance and useability:

Change VM Resolution

Once you’re in the VM, you can change its resolution by editing config.plist in the clover ESP.

Start by copying ESP.qcow2 and renaming the copy something like ESP.qcow2.bak. Do the same for the firmware folder.

From there, boot into the VM, open a terminal and run sudo diskutil list. The 256MB disk is the one you want. Mount its first partition by running sudo diskutil mount diskXsY (where X and Y are the disk and partition numbers)

Open finder, navigate to “EFI” in the left bar under volumes, navigate to the clover folder, and open config.plist. There should be a section of this file that looks like this

Change this value to your desired resolution, e.g. 1920×1080. Note that some odd/intermediate resolutions like 1366×768 may not work well. Try to stick to more common 16:9, 16:10 and 4:3 form factors.

Increasing CPU/Memory

Hackintosh Post Install Youtube

This process can increase overall performance if you have more than the default resources available to you. For memory, simply change the -m 2G line in basic.sh to a higher value. For CPUs, replace -smp 4,cores=2 with -smp cpus=X,cores=X,threads=1,sockets=1 where X is the number of threads you want to pass through. If you want to pass more than 8 threads, add to the number of sockets for every 8 cores as well. When and if you switch your configuration to virt-manager, DO NOT change the thread topology or model settings via the GUI. This can cause issues with clover and the boot process. If you do need more cores, just virsh edit and follow the same rules as above and do not change the cpu model type.

Switching to Virt-Manager

This will give you a GUI to launch and manage your VM with, making other adjustments and customizations easier. You’ll also need this for part 2 of the guide. Just install virt-manager and you can get started.

First things first: back up your ESP image and firmware folder as described in the resolution change section. Boot your VM, and press escape at the first UEFI dialog. Type exit, hit enter. This should bring you to the OVMF configuration menu. Navigate to Device Configuration > OVMF Platform Features, and set the resolution to the same value as your VM resolution. If you did not change your VM resolution, set it to 1280×720. Hit f10, Y, then press escape until you’re in the main dialog. hit continue and boot into the VM. Shut it down fully, then Boot again to make sure the change didn’t cause any issues.

Next, enable libvirt by running systemctl enable libvirtd.service virtlogd.service and systemctl start libvirtd.service and virtlogd.service. Open virt-manager and make sure you see Qemu/KVM in the connections window. Double click the connection and check the value for Virsh URI. If it’s qemu:///system then run every virsh command mentioned here with sudo.

Download the generic XML we provide here. Find and replace all instances of YOURPATH with the absolute path that corresponds to your VM’s firmware and image files. After you’ve edited the xml, run virsh define OSX.xml (use sudo if your URI is qemu:///system instead of qemu:///session) in the same working directory you saved your XML to.

Restart Libvirt by running systemctl restart libvirtd.service virtlogd.service and open up virt-manager. You should have a VM named OSX under the Qemu Connection in the main window.

If you’ve already extensively customized your qemu script, you can run ./make.sh --add. This script is included in the repo. Edit the XML before defining, using uuidgen to create a new UUID to avoid issues with apple ID. The xml we provide will do so automatically.

If you get network startup errors, simply remove the NIC device in virt-manager and re-add it, manually specifying the device type to e1000-82545em. This should also generate a new MAC address. On Arch, you may get an error like:

Hackintosh Post Install Guide

To fix this, install ebtables and dnsmasq and try again.

Some distros (e.g. manjaro) come with badly configured or incompatible firewalls too. If you get an error saying NAT failed to connect or that the default virsh network is inactive, and running virsh net-start defaultdoesn’t resolve the issue, you should try manually setting FirewallBackend= in /etc/firewalld/firewalld.conf to iptables

If you get Permissions errors related to your qcow images on boot, simply remove the affected qcow images and re-add them as sata devices. Virt-manager will ask if you want it to fix the permissions. Click yes.

If you get an error on startup similar to Error starting domain: path /dev/dri/bypath/pci-0000:00:02-0-render is not accessible. No such file or directory and you created your XML with ./make.sh --add, then it may have erroneously assigned a device to your qxl graphics. Simply edit your XML with virsh edit and remove the entire line containing that entry.

Troubleshooting

Qemu refuses to start after running basic.sh:

Check to make sure you have all dependencies installed. You have to manually install packages like virglrenderer and spice on some distributions. If your error includes unknown attribute type for SMBIOS, then your version of Qemu isn’t recent enough to support this project. You can try updating it by compiling a more recent version yourself or installing it through a 3rd party repo. The oldest version to support this feature is 2.8.

The Installer doesn’t have any listed hard drives:

Make sure you generated your qcow image, added it to basic.shand formatted it to hfs+ in Disk Utility before starting the installer.

Installer fails with “Failed to Contact Validation Server”

Check your internet connection and firewall settings and try again. If it still doesn’t work, make sure your system time is correct.

UI is tiny:

You can change your VM resolution to a better supported one in the ESP, like 1920×1080, or use a tool like Enable-HiDPI-OSX to regain scaling functionality.

Part 2 of this guide covers GPU and Device Passthrough, CPU and IO optimizations, as well as other ways to improve your virtualized OSX experience. Special thanks to Foxlet for providing most of the groundwork for this new guide.

Consider Supporting us on Patreon if you like our work, and if you need help or have questions about any of our articles, you can find us on our Discord. We provide RSS feeds as well as regular updates on Twitter if you want to be the first to know about the next part in this series or other projects we’re working on.