reims-ctl and its docs send people to OSX-KVM or ULTMOS for two things: an
OpenCore boot image with OVMF, and a way to install macOS. This does both in
one program with no other tools to install, on Linux and macOS, so reims-ctl
can point at it instead. Each job writes one file that reims-ctl takes as it
is.
- opencore: a 128 MiB GPT disk (qcow2 or raw) whose FAT32 EFI partition holds
OpenCore 1.0.8 with a config.plist made from the release's Sample.plist for
a q35 VM on KVM (no kexts, one SSDT for EC and USBX, a fresh SMBIOS
identity), plus OVMF from a pinned Arch edk2-ovmf package. Both downloads
are pinned by SHA-256 and cached.
- online-installer VERSION: Apple's recovery image for High Sierra to Tahoe,
as macOS-<name>-online-installer.dmg, checked chunk by chunk against its
chunklist, whose RSA signature must be Apple's, since both come over plain
HTTP. It installs the newest release of its macOS over the network.
- offline-installer VERSION: one exact release of macOS 11 to 26 for Intel
Macs, from the software update catalog, as one raw GPT disk,
macOS-<name>-<version>-<build>-offline-installer.img:
- FAT32 RECOVERY: com.apple.recovery.boot/BaseSystem.dmg and its chunklist,
which OpenCore boots, checking Apple's signature, as from a USB stick;
- exFAT Installer: InstallAssistant.pkg (12 to 18 GB, past FAT32's 4 GiB
limit), checked against its chunklist and the catalog's digest of its
table of contents, and install-macos.sh, run from Recovery's Terminal.
The script installs the package onto the erased disk and starts the app's
startosinstall. The package's postinstall writes to $3Applications, which
for a volume lands beside it on Recovery's RAM disk, so a link sends it onto
the volume; it also sets CM_BUILD and fixes the app's modes, as mist-cli does.
Both of the offline installer's files are downloaded straight into their
places in the image, so the package is never on disk twice. A disk is built
as byte ranges, with a reserved place for each download, and the package's
volume first so its place stays put when Apple's recovery image changes size.
The FAT32, exFAT and GPT writers are our own (fatfs made volumes macOS's
fsck_msdos rejected); fsck_exfat and fsck_msdos pass the volumes. An image
already there is checked read-only, since a VM may be running from it, kept
when its package checks out, and repaired otherwise.
Downloads resume from a .part file (or the image's place) after checking what
is already there against Apple's chunklists, and carry on through slow or
dropped connections. The same jobs run from a small inline terminal
interface, from subcommands, and with --json for scripts.
Licensed GPL-2.0-or-later OR LGPL-3.0-or-later, as reims-vgpu is. The serial
number tables come from OpenCorePkg's macserial, so its BSD-3-Clause license
is kept beside ours for that file.
reims-util
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-ctltakes 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's picker boots "macOS Base System" after 5 seconds, 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. Both are downloaded from pinned releases (OpenCore's from
GitHub, OVMF from Arch Linux's edk2-ovmf package), checked against the hashes reims-util knows,
and cached in ~/.cache/reims-util, so they're 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:
- No kexts. QEMU's
isa-applesmcis the SMC, and the GPU is reims-vgpu's, which macOS drives with its own driver. - The drivers a VM boots with: OpenRuntime, OpenHfsPlus (recovery images and installers are HFS+), OpenPartitionDxe (for older recovery images) and ResetNvramEntry.
- One ACPI table, with the
ECandUSBXdevices 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-spoofturns that off. - macOS doesn't see it runs in a VM, so iCloud and the App Store let you sign in.
--show-vmturns that off. - System Integrity Protection on, as on a real Mac.
--disable-sipturns it off.
--timeout sets how long the 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:
-
Open Disk Utility and erase the VM's disk as APFS. You can leave its name as it is.
-
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
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, under its BSD-3-Clause license. OpenCore and OVMF, which reims-util downloads, keep their own licenses.