$ show kholia/OSX-KVM
This repository provides a comprehensive set of scripts, configuration files, and precompiled bootloader components to run macOS as a guest operating system on Linux hosts using QEMU/KVM and the OpenCore bootloader. It is not a traditional application but rather an infrastructure-as-code project that automates the creation of a virtual Hackintosh environment. The codebase includes a Python script (`fetch-macOS-v2.py`) to download macOS recovery images from Apple's servers with cryptographic verification, shell scripts to launch QEMU with the appropriate CPU flags, firmware, and device emulation, and a set of OpenCore EFI binaries (kexts, drivers, ACPI tables, icons) tailored for macOS compatibility. The project also documents GPU passthrough, USB passthrough, kernel debugging, and reverse engineering of macOS VM detection. While the repository is highly popular and actively maintained, the code quality is uneven: many shell scripts are boilerplate-heavy with hardcoded paths, and the prebuilt binaries are opaque, making the project more of a curated recipe collection than a polished software product. The most reusable components are the macOS downloader script and the OpenCore disk image builder, which can be extracted and adapted for other virtualization workflows.
The LLM identified 2 files worth highlighting for reuse:
A standalone Python script that downloads macOS recovery images (High Sierra through Tahoe) from Apple's servers. It implements chunklist-based downloading with SHA-256 verification, RSA signature checking, and interactive menu-driven selection. The script is well-structured with error handling, progress reporting, and support for serial number validation. It can be reused as a generic macOS recovery downloader or adapted for other Apple firmware fetching tasks.
A shell script that uses guestfish (libguestfs) to build a bootable QEMU qcow2 disk image containing the OpenCore EFI bootloader. It bundles config.plist, kexts, ACPI tables, and drivers into a FAT32 EFI system partition. The script is parameterized and includes error checking, making it a reusable pattern for constructing custom EFI images for virtual Hackintosh setups.