From 29a25a369417bfadb9a54737d014ad2477df5607 Mon Sep 17 00:00:00 2001 From: David Timber Date: Sat, 6 Apr 2024 13:04:58 +0900 Subject: Add writeups/hackintosh --- writeups/hackintosh/libvirt-diy.md | 99 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 writeups/hackintosh/libvirt-diy.md (limited to 'writeups/hackintosh/libvirt-diy.md') diff --git a/writeups/hackintosh/libvirt-diy.md b/writeups/hackintosh/libvirt-diy.md new file mode 100644 index 0000000..48a15d5 --- /dev/null +++ b/writeups/hackintosh/libvirt-diy.md @@ -0,0 +1,99 @@ +![Add VM icon](image-1.png) + +Things to set/look out for: + +- "Manual Install": as OpenCore loader can only deal SATA disks, you'll have to + add the install media yourself after the creation process +- "Generic or unknown OS" +- Memory: leave about 2GB to the host +- CPUs: match or fewer than host's count +- Disk image size: create one during the process or manually after creation +- Tick "Customize configuration before install", Finish + - Click on "Apply" before leaving the view + - Chipset: Q35 + - Firmware: UEFI + - Delete the NIC, audio, tablet, usb redirection + - Change the IDE disk to SATA + - Manually edit the xml + - Change the EFI images to the non secboot variant + - Turn smm off + +```xml +/usr/share/edk2/ovmf/OVMF_CODE.fd + +... + +``` + +Start editing the XML manually. Here's the breakdown of the changes. + +Add the xmlns spec. Without this, `` tag won't persist. +Without the tag, the xmlns spec won't persist either, so add the command line +passthrough first. + +The qemu commandline passthrough is unavoidable because it is not possible to +set up Apple SMC and custom CPU flags in Libvirt. It is also to circumvent the +issue of libvirt's mandatory use of pcie-root-ports for the Q35 machine type. +See [cloud+libvirt.md#caveats](cloud+libvirt.md#caveats) for detail. + +The PCI addresses are crafted so that they won't conflict with libvirt's +allocation. + +```xml + + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +Turn off memballoon. + +```xml + +``` + +That's pretty much it! -- cgit