Anees Iqbal 6e9f41a99b 🐎 Present the x86 guests' frames without waiting on each
The apv-arm64-port GPU kext's type-4 display pipe made WindowServer wait on
each present's fence before it sent the next. paravirt-x86-guest's 6829152
(its plan.md, Decided 18) submits command 8 at once and keeps at most two
presents outstanding, as Apple's x86_64 driver does. The host's messages are
unchanged.

These are that build's two changed executables, written by its deploy.sh from
5ba2290 (the commits after 6829152 change docs alone):
AppleParavirtGPUIOGPUFamily 6fb01accfb04f83dbbac9f7d0e18f185b9aba8131b0e8829053a026783d1fe50
AppleParavirtGPULoader 8f16ab488d72b3a6d9d77db6a1229e2d22d60e9794a1f3cdca52c2656864f801
The loader changes because its stage 1 compiles in the GPU kext's sites. The
other five bundles and every Info.plist came out byte-identical.

Checked on msi's RTX 5080 under reims-vgpu with a macOS 26 guest (run
perf-rvg-vm-macos-26-async0-014914): drag went from 55-59 fps to 89.5 and ufo
to 89.8, webgl and video stayed about even, the queue never went past two,
no present failed and nothing panicked, and metalwin passed 3 of 3. Upstream,
make check STRICT=1, the arm64e gate and deploy.sh's checks (no /Users/,
worktree paths, HEAD hash or stabs) passed.
2026-10-29 21:48:36 +02:00

reims-util

License: GPL-2.0-or-later OR LGPL-3.0-or-later

reims-util gets an x86-64 macOS VM ready to boot. It makes:

  • An OpenCore boot image, with the OVMF firmware to boot it, set up for a q35 VM on KVM.
  • macOS installers that reims-ctl takes as they are, from Apple and checked against Apple's own checksums and signatures:
    • an online installer, which installs the newest release of macOS 10.13 to 26 over the network;
    • an offline installer, which installs one exact release of macOS 11 to 26 with no network at all.

Downloads pick up where they stopped when they're interrupted.

It's made for reims-vgpu's reims-ctl, and does the job you'd otherwise use OSX-KVM or ULTMOS for. It's a single program with no other tools to install, and it runs on Linux and macOS.

Install

You need Rust 1.98.1 or later (rustup.rs). Then:

cargo install --locked --git https://github.com/steelbrain/reims-util

Or, from a checkout, cargo install --locked --path ..

Make a VM with reims-ctl

mkdir -p ~/vms/mac && cd ~/vms/mac
reims-util opencore                     # OpenCore.qcow2, OVMF_CODE.fd and OVMF_VARS.fd
reims-util online-installer tahoe       # macOS-Tahoe-online-installer.dmg
reims-ctl create mac --opencore OpenCore.qcow2 \
  --installer macOS-Tahoe-online-installer.dmg --start

reims-ctl copies the OpenCore image into the VM, finds OVMF beside it, and takes the installer as it is. OpenCore boots "macOS Base System" with no picker, and you're in macOS Recovery: erase the VM's disk in Disk Utility, then pick Reinstall macOS, which downloads the rest from Apple.

Use it interactively

Run reims-util with no arguments. A small interface opens at the bottom of your terminal (it doesn't take over the screen): pick a job, fill in its form, and press Enter to start it. Esc stops a download (press it again to leave without waiting), and starting it again picks up where it left off. What each job wrote, or why it failed, stays in your terminal once you quit.

Use it from the command line

Everything the interface does is a command too, which is what scripts and reims-ctl use.

OpenCore and OVMF

reims-util opencore -o OpenCore.qcow2

This writes a 128 MiB disk image with OpenCore 1.0.8 on its EFI partition: qcow2 for a .qcow2 name, and a raw disk image for anything else (.img). Beside it go OVMF_CODE.fd and OVMF_VARS.fd, with OVMF's licenses. What goes in them is downloaded from pinned sources (OpenCore's release, a commit of its picker icons and boot chime, OcBinaryData, and Lilu's release, from GitHub; OVMF from Arch Linux's edk2-ovmf package), checked against the hashes reims-util knows, and cached in ~/.cache/reims-util, so it's only downloaded once.

Each image gets a Mac identity of its own: a serial number, logic board serial (MLB), system UUID and ROM, which it prints when it's done. Keep them if you'll want the same identity in another image (--serial, --mlb, --uuid, --rom). The model is an iMac20,1 unless you ask for another with --model:

Model Runs
iMac20,1 macOS 10.15.6 to 26
iMacPro1,1 macOS 10.13 to 15

What's in the image, and why:

  • Two kexts, which load on macOS 26 alone: Lilu, and its plugin ReimsVgpu.kext, from this repository's kext/. macOS drives reims-vgpu's GPU with its own driver, whose x86-64 build asks the device for an old interface version (6) and turns every later feature off. The kext has it ask for the one arm64 guests use (245), and patches what the driver and its Metal plugin hardcode, so Metal offers the GPU families GPU-accelerated Chrome needs, and D32S8 depth/stencil textures. --no-kexts leaves them out, and the boot argument -reimsvgpuoff turns the kext off. The apv-arm64-port kexts load after these, on macOS 26.4 and later, and reims-vgpu-video's after those, on macOS 26.7 (below). There are no others: QEMU's isa-applesmc is the SMC.
  • The drivers a VM boots with: OpenRuntime, OpenHfsPlus (recovery images and installers are HFS+), OpenPartitionDxe (for older recovery images) and ResetNvramEntry.
  • No boot picker: OpenCore boots the default entry, the disk macOS last chose as its startup disk. --show-picker shows it at every boot: the graphical one, OpenCanopy, with the GoldenGate icons. Pick with the arrow keys, Tab and Enter; it has no mouse pointer in a VM. --text-picker gives OpenCore's text list instead.
  • The boot chime, which plays on the VM's Intel HD Audio controller when it has one (QEMU's ich9-intel-hda with an hda-output codec). Turning off "Play sound on startup" in macOS's Sound settings silences it.
  • One ACPI table, with the EC and USBX devices macOS looks for.
  • The CPU reported as a Skylake-SP, which every macOS from 10.13 to 26 knows, whatever CPU model the VM has. --no-cpuid-spoof turns that off.
  • macOS doesn't see it runs in a VM, so iCloud and the App Store let you sign in. --show-vm turns that off.
  • System Integrity Protection on, as on a real Mac. --disable-sip turns it off.

--timeout sets how long a shown picker waits (0 waits for you), --boot-args the kernel's boot arguments, and --verbose-boot shows the kernel's messages while it boots. reims-util opencore --help lists the rest.

Online installers

reims-util online-installer list
reims-util online-installer sonoma -o ~/vms/mac

An online installer is Apple's recovery image for a macOS, as a Mac's Internet Recovery gets it: about 1 GB, written as macOS-<name>-online-installer.dmg. A VM boots it into macOS Recovery, whose Reinstall macOS downloads and installs the newest release of that macOS. Name a version by name (sonoma, big-sur), number (14, 10.15) or latest. The image is checked against its chunklist, which Apple signs, 10 MiB at a time, so what you get is byte for byte what Apple made.

Offline installers

reims-util offline-installer list
reims-util offline-installer 26.6.2 -o ~/vms/mac

Recovery always installs the newest release of its macOS, downloaded as it goes. To install a particular one, such as 26.6.2 when 26.7.1 is out, or to install with no network, make an offline installer: a disk image, macOS-<name>-<version>-<build>-offline-installer.img, of 13 to 20 GB. It holds the recovery image of that macOS, which OpenCore boots as it would from a USB stick, and Apple's full installer for that release, with a script that installs it.

offline-installer list shows the releases Apple's software update catalog has for Intel Macs; macOS 27 runs on Apple silicon only, so it isn't there. Name one by version (26.6.2, or 26 for the newest 26), build (25G83), name (tahoe, for the newest Tahoe), Apple's product ID (140-93587) or latest. Both of its files are downloaded straight into their places in the image, each checked against Apple's chunklist for it, so the installer, up to 18 GB, is never on your disk twice.

reims-ctl create mac --opencore OpenCore.qcow2 \
  --installer macOS-Tahoe-26.6.2-25G83-offline-installer.img --start

reims-ctl uses the image where it is, read-only, so it isn't copied again. Once you're in Recovery:

  1. Open Disk Utility and erase the VM's disk as APFS. You can leave its name as it is.

  2. Quit Disk Utility, open Utilities > Terminal, and run:

    sh /Volumes/Installer/install-macos.sh
    

The script puts "Install macOS ….app" on the disk you erased and starts it; the VM restarts into the installer, and goes on from there as any macOS install does.

Interrupted downloads

An installer is written as a .part file next to where it ends up. If it stops, whether you pressed Ctrl-C, the network dropped or the machine went to sleep, run the same command again: what's there is checked against Apple's chunklists and the download continues from there. An installer that's already complete and checks out isn't downloaded again, and one that doesn't is repaired. An offline installer whose recovery image Apple has since replaced is left as it is: it still boots, and a VM may be using it.

For scripts

--json prints progress and the result as JSON lines on stdout. The last line is either {"event":"done","result":{…}}, with what was written (and for opencore, the identity it made) or, for list, the versions, or {"event":"error","message":"…"}.

reims-util --json online-installer tahoe -o ~/vms/mac

The kexts

kext/ holds the kexts reims-util puts in its images, built: a kext builds on a Mac alone, while reims-util builds anywhere. Every image carries them by default, each set after the one before it:

  • ReimsVgpu.kext, with Lilu, on macOS 26 (above), built from its source in kext/.
  • The apv-arm64-port kexts, on macOS 26.4 and later, which drive reims-vgpu's GPU with kexts of their own; older macOS 26 builds keep macOS's own driver with ReimsVgpu.kext. --no-apv-arm64-port makes an image without them.
  • reims-vgpu-video's kexts, on macOS 26.7, which drive the paravirtualized VideoToolbox (106b:1a03) and M2 scaler (106b:1a0b) devices, when the VM's QEMU serves them: AppleVideoToolboxParavirtualization.kext and AppleM2ScalerParavirtDriver.kext, Apple's arm64 guest drivers ported to x86-64, and VtWaitPatch.kext, a Lilu plugin that keeps the x86-64 VideoToolbox's waits for the host's replies from expiring at once on macOS 26.7.1 (25G241). The two drivers link against apv-arm64-port's IOSurface mapper, so an image carries them only with the apv-arm64-port kexts, from Darwin 25.6.0 on; a driver whose device the VM lacks loads and matches nothing. --no-video makes an image without them. The two drivers are Apple's code, ported, and are not for redistribution.

After changing ReimsVgpu.kext's source, rebuild it on a Mac with Xcode, and commit the built kext with the change:

cd kext
make LILU=path/to/Lilu.kext KERNEL_SDK=path/to/MacKernelSDK

LILU is a DEBUG build of Lilu 1.7.2, the version the image carries, from Lilu's releases, and KERNEL_SDK a checkout of MacKernelSDK. With the same Xcode, the same source builds the same bytes. make also writes kext/sources.sha256, what the kext was built from, and cargo test fails when the source no longer matches it.

License

reims-util is licensed under GPL-2.0-or-later OR LGPL-3.0-or-later; see LICENSE. The serial number tables come from OpenCorePkg's macserial, and the built ReimsVgpu.kext holds code of Lilu's, each under its BSD-3-Clause license. OpenCore, its picker icons and chime (OcBinaryData), Lilu and OVMF, which reims-util downloads, keep their own licenses.

Languages
Rust 100%