Commit Graph
43 Commits
Author SHA1 Message Date
Anees Iqbal 50a4abbb20 🐛 Say a Mac before macOS 26 starts no VM, not one without a GPU
docs/known-issues.md and install-ctl.sh's warnings said that on a Mac with
no KosmicKrisp, macOS 15 or earlier or a mesa without the driver, VMs get no
GPU. They do not start: the library's device has no GPU device to open
(reims-vgpu's GraphicsDevice::with_platform refuses with HostResources), so
rvg_graphics_device_create refuses, and QEMU's reims-graphics-pci fails its
realize, which ends QEMU before the guest runs. reims-ctl gives every arm64
VM that device, and arm64 VMs are what a Mac runs.

The doc's heading and paragraph and the installer's two warnings now say the
VMs do not start.
2026-11-20 06:03:27 -08:00
Anees Iqbal 0747dfc4c7 🐛 Install Homebrew's mesa on a Mac, the rt platform's driver
On a Mac the rt platform runs on Mesa's KosmicKrisp, which the installed
QEMU loads from its lib directory, linked to Homebrew's mesa. The installer
listed molten-vk and no mesa, so after the cutover a Mac without mesa got a
QEMU with no device for the guest. It now lists mesa where the Mac runs
macOS 26 or later.

Homebrew's mesa formula builds KosmicKrisp only from macOS 26 (Tahoe) on;
before, its Vulkan drivers are swrast alone. On macOS 15 or earlier mesa is
left out, and the installer says, at its start and at its end, that VMs on
that Mac get no GPU, then installs reims-ctl and QEMU as before. Where mesa
is installed but holds no KosmicKrisp, as a bottle poured for an older
macOS, linking the driver says the same and asks for brew reinstall mesa.

molten-vk is dropped from the list: nothing of ours loads it after the
cutover. rt's floor refuses MoltenVK (rt_driver.rs), the rt platform's
window presents through rt's swapchain on the KosmicKrisp device, and
reims-ctl, QEMU and the build load no Vulkan driver themselves. Homebrew's
mesa depends on molten-vk for its zink driver, so it is installed with mesa
all the same. The README's install paragraph says KosmicKrisp in place of
MoltenVK.
2026-11-20 06:03:27 -08:00
Anees Iqbal 66bdf92dce 📝 Say the default platform passes KosmicKrisp over on a Mac [ci skip]
The device choice now passes over a device a display's window cannot present
on, so with KosmicKrisp's manifest where Homebrew's mesa puts it the default
platform opens MoltenVK. docs/qemu.md and install-ctl.sh's comment said it
timed KosmicKrisp as the faster and took it; they now say it passes it over,
with the M3 Max boot that shows it (m3-max-57194: 16 of 16 checks, the
full-screen Metal app at 60 fps with 600 frames and none dropped), and keep
the earlier numbers as what it did before. mesa stays out of what the script
installs, as the default platform does not use it.
2026-11-19 23:57:05 -08:00
Anees Iqbal dad756075c 📝 Say how the default platform picks KosmicKrisp on a Mac [ci skip]
install-ctl.sh's comment said the default platform takes the first GPU of
its kind the loader lists. It times each GPU the loader lists and takes the
fastest (device_choice.rs), and a boot measured what that does when Homebrew's
mesa puts KosmicKrisp's manifest where the loader reads it: on the M3 Max the
default platform took KosmicKrisp, on which a display's window cannot present,
and check-boot's full-screen Metal app ran at 30 fps with dropped frames and
failed, where on MoltenVK it runs at 60 fps with none dropped.

The comment now says so, and docs/qemu.md records the boot beside the rt
build's, which passed all 16 checks on the KosmicKrisp the install links.
2026-11-19 23:39:11 -08:00
Anees Iqbal 1c69f8ab2a 🆕 Link the rt platform's Vulkan beside QEMU on a Mac
The rt platform loads the Vulkan loader and Mesa's KosmicKrisp only from
beside QEMU's binary or from ../lib (rt_driver.rs), and nothing put them
there: lanes linked them beside QEMU by hand.

On a Mac, install-ctl.sh now links both into the lib directory of the QEMU
it installs, and make qemu (or make vulkan-links) into build/lib, which is
../lib from build/qemu and from the arm64 build directory docs/qemu.md
configures beside it. Each link points into its Homebrew formula's opt
directory, so brew upgrade reaches it: the loader to vulkan-loader's, the
driver to mesa's. Homebrew's mesa formula is Mesa's release built unpatched
(26.3.1, the release the M3 boots on rt used), and its macOS 26 and later
bottles build KosmicKrisp, so no Mesa build of our own is needed.

Neither installs mesa: with its manifest in Homebrew's share, the system
loader lists KosmicKrisp ahead of MoltenVK (measured on the M3 Max), and the
default platform would take it in MoltenVK's place before the cutover.
Where Homebrew has no KosmicKrisp, no link to it is made and rt makes its
own instance, as before. Linux and Windows installs are unchanged: the new
code runs only where uname says Darwin.
2026-11-19 23:39:11 -08:00
Anees Iqbal 07221b9ec5 🆕 Install the build's Fedora packages in install-ctl.sh
install-ctl.sh's Fedora list was empty, so on Fedora it only warned and
printed the Ubuntu package names, and the build stopped at the first
missing header.

The list now holds Fedora's name for each Debian and Arch entry: the
compilers and QEMU's build tools, QEMU's libraries (glib, pixman, libslirp,
libfdt, PipeWire, PulseAudio, ALSA, libusb, the SPICE server, gnutls), the
Vulkan loader, SDL3's X11, Wayland, libdecor, EGL, GBM, D-Bus and udev
headers, and GTK 3. Each is checked with rpm -q --whatprovides, as some are
another package's (zlib-devel is zlib-ng-compat-devel's on Fedora 40 and
later), and the missing ones are installed with sudo dnf. The README and the
script's help name Fedora beside the others.
2026-11-18 17:26:40 -08:00
Anees Iqbal 60a4433e15 🐛 Fail doctor's /dev/kvm line only where a VM here runs on KVM
On x86-64 Linux, arm64 VMs run on TCG and need no KVM, yet doctor failed
"/dev/kvm" on a host whose VMs are all arm64 ones, and install-ctl.sh warned
that VMs would not start.

doctor now fails the line only where a VM this host runs needs KVM: a
registered VM whose profile runs on KVM here, or, with no VMs yet, the one a
create makes, of the host's default profile (x86-64 on x86-64 Linux, arm64 on
arm64 Linux, where every VM runs on KVM). Otherwise the line is ok and says
which VMs would need it and how to give it. install-ctl.sh's warning on
x86-64 Linux says that x86-64 VMs need KVM and arm64 VMs start without it.
What the host sees changes only in doctor's output and exit status and in
the installer's warning.
2026-11-18 17:26:40 -08:00
Anees Iqbal e389416315 🐛 Keep reims-ctl's install record beside the install it records
scripts/install-ctl.sh moves its install with XDG_DATA_HOME, XDG_CACHE_HOME
and CARGO_INSTALL_ROOT, and runs reims-ctl __record-install last, which wrote
install.toml in the config directory, which none of those move. An install
into a scratch prefix (a64start's m3-max-48499 on um870) therefore replaced
the user's own record with one naming the scratch QEMU build.

The record now lives in the data directory, beside the QEMU builds it names,
where reims-ctl already finds the QEMU it runs: an install into another data
directory records itself there, and update, doctor, the TUI's update and the
bug report read the record of the install whose QEMU this reims-ctl runs.
install-ctl.sh has no --prefix of its own to key a config directory to, and
its STAGE is QEMU's DESTDIR inside one install, not an install of its own.

An earlier reims-ctl's record in the config directory is still read where the
data directory has none, and an install's record replaces it, removing it,
only where it named a QEMU build of the same data directory: a scratch install
leaves it as it was.
2026-11-18 17:26:40 -08:00
Anees Iqbal 04dcd7959f 🆕 Build qemu-system-aarch64 wherever reims-ctl runs arm64 VMs
install-ctl.sh builds QEMU's aarch64-softmmu beside x86_64-softmmu on x86-64
Linux, and alone on an arm64 Mac (with HVF, signed with its entitlement) and
on arm64 Linux (with KVM), with gnutls for vmapple's AES. It installs
reims-restore where arm64 VMs run, for finish-eacs, and reims-ctl's
__record-install downloads Ambrosia there.
2026-11-18 15:57:52 -08:00
Anees Iqbal 326f393a15 🐛 Print install-ctl.sh's paths on Windows in Windows' form
On Windows install-ctl.sh's closing summary named QEMU's build in MSYS2's form,
/c/Users/me/.local/share/reims-ctl/qemu/<build>, which only MSYS2's bash
takes, while the summary sends the user to PowerShell or Windows Terminal. The
other paths its messages print (the checkout it pulls, a missing QEMU, cargo,
the library's pkg-config file, the installed reims-ctl, CARGO_TARGET_DIR) were
in the same form, and those that send the user back to the script named it by
the path reims-ctl update ran it with, C:/reims-vgpu/scripts/install-ctl.sh.

On Windows every path the script prints is now in Windows' own form
(C:\Users\me\.local\share\reims-ctl\qemu\<build>), and the messages that send
the user back to it name scripts\install.ps1, as reims-ctl's do there. macOS
and Linux print as before.
2026-11-16 23:30:08 -08:00
Anees Iqbal 31dbdd4b8c 🆕 Install libva and Mesa's vaon12 on Windows hosts
The device's video on Windows runs on libva-win32 and Mesa's VA-API driver
on Direct3D 12, vaon12, which MSYS2's CLANG64 libva and mesa packages
build. The Windows install now installs both with the other CLANG64
packages, and copies libva.dll, libva_win32.dll and vaon12_drv_video.dll,
with the CLANG64 DLLs they load, beside QEMU: the library loads them by
name when the device's video starts, so ldd of QEMU lists none of them, and
libva looks for its driver beside itself.

The two packages add at most five to an install, 172 MiB installed (17 MiB
to download): mesa, libva, spirv-tools, spirv-llvm-translator and
vulkan-loader. vaon12 itself is 11 MiB and loads only Windows' own DLLs.
2026-11-16 22:11:27 -08:00
Anees Iqbal 2af666bd33 🐛 Build a Windows install outside paths with spaces
A Windows user's folder can hold a space (C:\Users\First Last), and QEMU's
configure refuses a source or build directory with one ("main directory
cannot contain spaces nor colons"). With the library fixed, a user's install
would stop there next: install-ctl.sh builds QEMU in ~/.cache/reims-ctl, in
that folder. With the checkout in the folder too, as install.ps1 clones by
default, sdl3-sys stops first: it finds no SDL3, as a space splits the -L
path of the pkg-config file it reads. Both measured on the mini with a profile
named "Test User". No alias keeps the space out: meson takes realpath of its
directories, which turns an 8.3 short name back into the long one, and a volume
can have no short names (the mini's P: has none).

install.ps1 now clones into C:\reims-vgpu where the user's folder has a space,
saying so, and stops on a -Checkout with one. install-ctl.sh on Windows builds
and stages QEMU in the target directory where the cache directory has a space,
and stops before any download or build on a checkout or CARGO_TARGET_DIR with
one, naming the folder to use.
2026-11-16 16:36:48 -08:00
Anees Iqbal bd239b6ddf 🐛 Build every C and C++ part of a Windows install with clang
A user's install of development on Windows stopped in sdl3-sys's CMake build:
their environment's CC named Visual Studio's cl.exe, cc-rs gave the build
MSVC's C flags (and clang's C++ flags, CXX being unset), and CMake, which
reads CC itself where the cmake crate names no compiler, took cl.exe. Its test
compile failed once MSYS2 had turned /nologo into C:/msys64/nologo. Visual
Studio's install alone does not do it: cc-rs takes cl.exe from it for MSVC
targets only, and our hosts set no CC, so no run of ours met it.

install-ctl.sh on Windows now sets CC, CXX and AR, their per-target forms that
cc-rs takes first, and CMake's generator, to CLANG64's clang, clang++, llvm-ar
and MSYS Makefiles, for cargo's build scripts, CMake, QEMU's configure and
meson alike. The generator is the one the cmake crate chose with none set, and
CLANG64's ar is llvm-ar, so a host without those variables builds as before.
2026-11-16 16:36:48 -08:00
Anees Iqbal 8807df2aa4 🐛 Write CRLF text files out again in Windows checkouts made before
A checkout Git for Windows made before .gitattributes holds every text file
with CRLF line ends (its installer sets core.autocrlf=true), and git does not
write a file again where a later checkout leaves it unchanged: .gitattributes
has it compare the file as LF, so it finds nothing to do. A clone at
core.autocrlf=true moved to the commit that added .gitattributes kept all 1730
text files CRLF, and the build would have failed on the .metal sources' hashes
as before.

install-ctl.sh on Windows now writes each text file whose working copy differs
from its commit only in its line ends out again from the commit, after the
update and before any build, and keeps a file with changes of its own.
2026-11-16 16:36:48 -08:00
Anees Iqbal 13e22421e6 🐛 Build on Windows with gnullvm whatever rustup's default host
install-ctl.sh installs rustup with the x86_64-pc-windows-gnullvm host, whose
builds link with CLANG64's clang and lld, but a rustup already there builds
with its own default host. Windows' usual one, x86_64-pc-windows-msvc, builds
xtask, the build scripts, reims-ctl and reims-util for MSVC, which link only
with Visual Studio's link.exe: a host without Visual Studio's build tools
fails the install, and one with them installs MSVC binaries no install here
was checked with.

On Windows the script now runs rust-toolchain.toml's channel for the
gnullvm host (RUSTUP_TOOLCHAIN), installing that toolchain beside the user's
where it is missing, whatever rustup's default host; the default stays as
the user set it.
2026-11-16 07:56:51 -08:00
Anees Iqbal aaa06e63d9 🐛 Retry moving QEMU's staged install into place on Windows
A cold install on the mini built QEMU and then stopped at the move of its
staged install into reims-ctl's data directory: "Permission denied", as
Windows refuses to move a folder while a file in it is open, and just after
the stage was written something held one (m3-max-36159). The same move in
the same workspace minutes later succeeded, right after running the staged
QEMU and copying a DLL in as the script does (m3-max-36188). The Windows
branch now tries the move for a minute; Linux moves once, as before.
2026-11-16 05:07:24 -08:00
Anees Iqbal 00a942c42a 🐛 Build QEMU without its guest agent on Windows
A cold install in a new MSYS2 stopped at QEMU's configure: meson's auto
guest agent is on for a Windows host, and its build needs windmc, which no
CLANG64 package install-ctl.sh installs provides (m3-max-36094, the mini).
reims-ctl runs no guest agent, so the Windows build turns it off.
2026-11-16 05:07:24 -08:00
Anees Iqbal 2a0f952b67 🐛 Install make for the library's build in MSYS2
The cmake crate, which builds SDL3 for the library, chooses CMake's
generator on a GNU Windows target by looking for make, then mingw32-make, and
stops without either ("no valid generator found for GNU toolchain"): an
install into a new MSYS2 stopped there. install-ctl.sh now installs MSYS2's
make with the rest.
2026-11-16 05:07:24 -08:00
Anees Iqbal d4e40073d9 🆕 Install reims-ctl on Windows, in MSYS2's CLANG64 shell
scripts/install-ctl.sh refused Windows, where reims-ctl runs x86-64 VMs on
WHPX. In MSYS2's CLANG64 shell it now installs CLANG64's clang, lld, QEMU's
build tools and libraries with pacman, rustup with the x86_64-pc-windows-gnullvm
host (whose builds link with that clang, so no Visual Studio is needed), and
QEMU configured for WHPX, its CLANG64 DLLs copied beside it, qemu/current a
junction, into the user's profile, where reims-ctl looks. The Linux lines
are as they were.

reims-ctl update ran `bash`, which on Windows can be WSL's: the install now
records MSYS2's bash (__record-install --shell), and update runs the script
there as a CLANG64 login shell. MSYS2's programs expand wildcards and
braces in the arguments a Windows program gives them, and reims-ctl's git
calls ("@{u}", "HEAD^{commit}") reached MSYS2's git mangled: they run with
MSYS=noglob. The host messages say x86-64 VMs run on Windows too.
2026-11-16 05:07:24 -08:00
Anees Iqbal b5ad91b938 🆕 Make arm64 VMs from an IPSW with reims-ctl, downloading the latest
On an arm64 Mac or arm64 Linux, `reims-ctl create NAME --ipsw latest|PATH`, or
the interface's form, restores macOS from an IPSW onto a new VM's disk with
reims-restore's pipeline, offline: no VM runs and none of Apple's code. The
create saves the VM in the layout Ambrosia's boot reads (disk.img, aux.img,
machine-identifier.bin, and vm.toml with the profile vmapple-arm64 and its aux
and ECID; the ECID as text, since one can pass TOML's integers). A macOS 14 VM
is named with its one step left: a boot that makes its Data volume, then
`reims-restore finish-eacs DIR`.

`latest` is the current macOS in Apple's IPSW catalog, which lists only the
current release, so another is given by its IPSW's path, as the owner chose. The
IPSW downloads into the installers directory and continues after a stop;
`reims-ctl downloads` lists and deletes what is kept, never one a VM uses or one
being downloaded. The space check covers the download and the restore together.
A failed or stopped restore leaves nothing, and its log moves to the cache,
where the error names it.

reims-ctl doesn't start arm64 VMs yet: start, describe, doctor and the USB and
GPU views say so. Windows and Linux x86-64 keep their profile; host.rs adds
vmapple-arm64 for arm64 Macs (HVF) and arm64 Linux (KVM).

On those hosts scripts/install-ctl.sh installs reims-ctl alone: the restore runs
no QEMU and reims-ctl starts no arm64 VM. A Mac needs Xcode's command line
tools; arm64 Linux a C toolchain, git and curl (apt, pacman or dnf).
docs/qemu.md says so.
2026-11-16 02:03:39 -08:00
Anees Iqbal 00c9346cc4 🐛 Build QEMU of another commit in an empty directory
An update to f378a38f8 stopped in QEMU's build on the owner's laptop:
"qemu-version.h: No such file or directory". QEMU of 2026-11-13 writes
that header at configure (configure_file) wherever `git describe --match
'v*'` fails, as it does in every shallow vendor/qemu; the QEMU before made
it with a build step. meson, configuring in place, runs `ninja -t
cleandead` after writing build.ninja, which deletes each file .ninja_log
records as built that build.ninja does not name: the header it had just
written. Every later configure in that directory deletes it again.

install-ctl.sh and `make qemu` now record the vendor/qemu commit a build
directory was configured from (qemu-source) and start the directory empty
when the commit differs; a directory without the record is started empty
once. The same commit keeps its directory, so edits not yet committed in
vendor/qemu rebuild as before.

Reproduced on ms01 (job m3-max-31803): the old QEMU's directory
configured in place for the new loses the header and the compile fails as
on the laptop, twice over; an empty directory keeps it and compiles, and
keeps it when configured again at the same commit.
2026-11-15 03:12:15 -08:00
Anees Iqbal cf40cc8c57 🔥 Install no clang or lld for reims-ctl's build
install-ctl.sh installed clang and lld for the option ROM cargo xtask dist
built for apple-gfx-pci. dist builds no ROM now: reims-graphics-pci's comes
prebuilt (firmware/prebuilt). What the install builds needs neither: the
library's Linux dist links its archive with binutils's ld, nm, objcopy and
ar; SDL3 builds with CMake and the system's C compiler; metal2vulkan and
QEMU need no clang. binutils stays.
2026-11-07 19:45:50 -08:00
Anees Iqbal fea9c0b2ae 🔥 Drop apple-gfx, vmapple and Mac hosts from reims-ctl
reims-vgpu no longer has apple-gfx, Apple's paravirtualized GPU, nor
vmapple's arm64 boots (owner, 2026-11-07). reims-ctl follows:

- Every VM runs reims-vgpu's own GPU device, reims-graphics-pci, or VMware
  SVGA. The choice by the guest's macOS version (apple-gfx below 26.4) is
  gone, with no version check in its place. Settings that name apple-gfx
  read as reims-vgpu, and migration 3 makes such a VM's OpenCore image again
  for the device, keeping the old one as <image>.pre-migration-3.
- apple-gfx's settings and options go: displays, HiDPI, refresh rate and
  video acceleration (read past in old settings, dropped on the next save),
  view --display, the video and IOSurface devices, the Metal error-mode
  note, the aux trim and the emptied-entry warnings. With logs off the
  library logs at warn.
- reims-ctl runs VMs on Linux x86-64 hosts alone. Mac hosts go with arm64
  boots, per the owner's 11-07 ruling, and come back with the arm64 loader.
  create, start, gpus and usb on a Mac say "reims-ctl runs VMs on Linux
  x86-64 hosts"; vz.rs and its objc2 Virtualization dependencies go; the
  crate still builds and tests on a Mac.
- scripts/install-ctl.sh refuses any host but Linux on x86-64, and builds
  the library on Vulkan alone: GPU_ARM, the -vulkan builds, Homebrew and
  codesigning go.
- reims-util moves to 5ca3b10, which carries Lilu alone, without
  ReimsVgpu.kext: the renew warning for an image lacking it goes too.
2026-11-07 18:21:43 -08:00
Anees Iqbal 34dfe1b28a 🔥 Move QEMU to its tree without apple-gfx
vendor/qemu's eb36a099 removes apple-gfx (PCI and vmapple's MMIO device),
the IOSurface device, the paravirtual VideoToolbox and M2 scaler devices and
the KVM dirty source only apple-gfx gave the library. reims-graphics-pci is
QEMU's only device on the library, and calls only its rvg_graphics_device_*
functions and rvg_status_message. vmapple is no longer built: its display
was apple-gfx-mmio.

QEMU's option that finds the library is now --enable-reims-vgpu, not
--enable-pvg, upstream's name for Apple's framework, so its callers change
with it: install-ctl.sh's and the lane gate's configure lines, and make
qemu. make qemu now builds qemu-system-x86_64, the guest reims-graphics-pci
serves, configures again over a build an earlier make qemu configured for
aarch64 or with --enable-pvg, and no longer checks for ReimsVgpu.rom, the
option ROM QEMU installed for apple-gfx-pci. make vm, which booted a vmapple
guest, goes.
2026-11-07 18:21:43 -08:00
Anees Iqbal da0adc38b3 🐛 Find rustup in Cargo's home beside a distribution's cargo
install-ctl.sh looked for rustup only on PATH, and stopped where it found
another cargo there. On four Linux hosts pacman's cargo-nextest had pulled in
Arch's rust, /usr/bin/cargo, and the installer, run from a shell whose PATH
lacked ~/.cargo/bin, where rustup was, stopped at "cargo is installed without
rustup" on each.

It now puts Cargo's home's bin, where rustup is there, first on its PATH, so
the build runs rustup's proxies and the toolchain rust-toolchain.toml pins,
not the other cargo's release. Where rustup is missing, it offers it beside
the other cargo, as it does where there is no Rust, and --yes installs it. The
closing check of PATH looks at the PATH it started with, which the user's
shell has, not its own.
2026-11-07 12:03:23 -08:00
Anees Iqbal 06a13b6cb4 🆕 Offer to turn MGLRU's thrashing guard off on Linux hosts
With /sys/kernel/mm/lru_gen/min_ttl_ms above 0, the kernel kills a process
where it can't keep the pages used in the last that many milliseconds in
memory, even while RAM is free (the kernel's multigen_lru.rst, "Thrashing
prevention"), and a VM's QEMU can be the one killed. CachyOS's kernel sets it
to 100. Measured on hosts here at 100: kswapd invoked the global OOM killer
with most RAM free, killing a compiler with 19 GiB free on um870, and making 19
of a day's 22 OOM kills on ms01. An hour of builds beside a VM on um870 killed
no QEMU.

The installer and reims-ctl doctor now read the file, and above 0 they say
what it does in one line. On a terminal they offer to write 0 with sudo, and
they show the systemd-tmpfiles line that keeps it at 0 after a restart.
Without a terminal they only tell. VMs run either way, so doctor doesn't count
it as a failure.

Tested in mount namespaces on um790, where the file was a root-owned copy
holding 100 or 0: the installer without a terminal, and on one answering y and
n; then doctor the same ways. Each wrote 0 only on a y, said nothing at 0, and
left the host's own file at 100.
2026-11-07 11:12:50 -08:00
Anees Iqbal 31207d56d1 🆕 Build reims-ctl's QEMU with SPICE on Linux
QEMU's configure turns SPICE on only where it finds the SPICE server's
development files, and leaves it out without a word where it does not, so a
Linux user had -spice only if those files happened to be installed when the
installer built QEMU. People reach their VMs with SPICE clients, the user who
reported the cursor bug among them, so the installer now installs the SPICE
server with the build's other dependencies (spice on Arch and CachyOS, which
brings spice-protocol; libspice-server-dev on Debian and Ubuntu, which brings
libspice-protocol-dev) and configures QEMU with --enable-spice, as it does
libusb, so that a build without it stops rather than leave it out.
2026-11-07 04:59:54 -08:00
Anees Iqbal 93de5098e3 🐛 Refuse --skip-qemu with no QEMU, and warn of an outdated one
With --skip-qemu and no QEMU installed, the installer warned, installed
reims-ctl, and stopped at __record-install, whose --qemu refuses the empty
path it was given: no install record, no reims-util, and an error that did
not say what to do. Every VM runs on QEMU, so --skip-qemu now ends at once
where none is installed, before it builds anything, saying to run the
installer without it.

A QEMU kept from an older checkout runs on a QEMU source and a library this
checkout may have changed since. Its build's directory names its commit, so
the installer now compares that commit's QEMU source and library inputs
with HEAD's, and warns, saying what to run, where they differ, where the
checkout lacks that commit, or where GPU_ARM picks the other arm. A change
to reims-ctl alone, which --skip-qemu is for, warns of nothing.
2026-11-07 04:59:54 -08:00
Anees Iqbal fe6f1f7d0f 🆕 Pass the host's USB devices through to x86-64 VMs
reims-ctl had no way to give a guest a USB device of the host's: a user wrote
usb-host into extra_args by hand. Now `reims-ctl usb NAME --add DEVICE` and
the interface's USB devices view (p on a VM: a checkbox per device, Space to
give or take back) choose them, as virt-manager, VirtualBox, GNOME Boxes and
UTM offer: a flat list of the devices plugged in, not a tree of hubs.

- A device is kept in vm.toml as a [[usb]] table by its vendor and product
  IDs, which follow it to any port; one chosen beside a device with the same
  IDs is kept by its port too, which tells the two apart. QEMU's usb-host
  matches the same way, on the VM's xHCI controller.
- A device not plugged in when the VM starts joins the guest when it is, and
  one unplugged comes back when plugged in again: QEMU looks for each
  usb-host device's match every 2 s. The view and `start` say so.
- While the VM runs, a change attaches or detaches the device at once, with
  QMP's device_add and device_del, and is kept for the next start.
- A VM takes four at most, what the controller's seven ports leave room for.
- QEMU opens the device's file in /dev/bus/usb, which only root may write by
  default: install-ctl.sh now asks to add a udev rule giving USB devices
  other than hubs to the kvm group and to the user at the screen (uaccess).
  reims-ctl says what lets it open a device it can't, and doctor checks it.
- macOS hosts get none, and the interface says why: macOS gives a USB device
  one of its drivers holds only to a process running as root or holding an
  entitlement Apple grants VM apps, which QEMU here can't hold.

The docs are usb --help and the interface's help.
2026-11-07 04:59:54 -08:00
Anees Iqbal c8e650ff00 🐛 Check /dev/udmabuf on every Linux host, and offer its group
reims-ctl and the installer checked /dev/udmabuf only for AMD GPUs, and told
every host to raise vm.max_map_count by a rule of 64 mappings per MiB. But
the library's own views of the guest's memory need udmabuf on every GPU:
without it a view of an x86-64 guest's pages takes a mapping per 4 KiB page,
and an idle 3840x2160 desktop's surfaces alone (193-199 MiB, about 50k
mappings) pass the stock 65,530's budget; Safari at 4K passes even
1,048,576. On Debian 12 and Ubuntu 22.04/24.04 a user outside kvm cannot open
it, and on systemd 257+ a desktop session's access does not reach ssh.

So reims-ctl warns on every Linux host where /dev/udmabuf does not open,
naming the group that owns the node (or what to do where root alone may open
it, or the node or its module is missing), and says the group is needed over
ssh; doctor checks it too. The installer offers to add the user to that group
with sudo usermod, as it offers packages. vm.max_map_count is now only a
speed-up on NVIDIA, where udmabuf opens: a mapping per 4 KiB page past the
library's 16,384 and 8,192, past which buffers are copied. Doctor and the
installer name the value as information, by one rule, and the start no
longer warns of it. The README says the same.

Landed on development at the owner's word with no checks: reims-ctl's tests,
rustfmt and clippy, and the install and VM boot on each Linux host that
AGENTS.md asks of install-ctl.sh, were not run.
2026-10-29 01:01:57 +02:00
Anees Iqbal f424dadad9 🐛 Build QEMU with gnutls, and refuse vmapple without AES
vmapple's AES engine runs the guest's commands on QEMU's ciphers, and QEMU
gets those from a crypto library: gnutls, nettle or libgcrypt. Neither
install-ctl.sh nor `make qemu` asked for one, so whether QEMU had AES depended
on what else the host's Homebrew held. Built without one, QEMU falls back to a
stub that refuses every cipher. A macOS guest then hangs for good as it mounts
its root volume: its first AES DATA command fails and stays at the head of the
engine's FIFO, with every command after it. Serial output ends at "End of
iBootStage2", and the display never gets a mode. That was the hang on the
Scaleway M2 Pro Macs on macOS 27.2, whose Homebrew had none of the three; the
M3 Max's QEMU links gnutls.

- vendor/qemu moves to c7a4f070 on steelbrain/reims-vgpu. The AES engine
  checks at realize that AES-128, -192 and -256 work in ECB and CBC mode. A
  QEMU without them exits at start, saying what the build lacks, instead of
  hanging the guest.
- install-ctl.sh installs Homebrew's gnutls with the other formulas on macOS.
  Both it and `make qemu` configure QEMU with --enable-gnutls, so configure
  stops where gnutls is missing. An install's next update reconfigures QEMU,
  since its configure options changed.
- docs/qemu.md says how the hang was found and told apart from macOS 27.2,
  and README.md lists gnutls among QEMU's dependencies.

This is development-performance's 9d4f0a635, f8ef804f4 and 79225f10f
squashed. The QEMU change is its f1c10385 alone, picked onto development's
QEMU, without the dirty-source commits under it there.
2026-10-27 13:42:42 +02:00
Anees Iqbal 3777d1e001 🐛 Run the pulled install-ctl.sh when an update changes it
reims-ctl update runs install-ctl.sh --update, which pulls the checkout and
builds. bash reads a script from the file it opened as it goes, and the pull
replaces that file, so the update ran the old script to its end: a change to
the script's dependencies or QEMU options reached a host only on the update
after the one that brought it, such as libusb for usb-host.

When the pull changes the script, it now runs the new one with the same
options; that one's pull finds nothing new and goes on.
2026-10-26 17:38:07 +02:00
Anees Iqbal 149c26b71a 🐛 Build QEMU on Linux with libusb, for usb-host
QEMU's configure leaves libusb out, saying nothing, when its headers are
missing, and install-ctl.sh did not list them: a Linux install's QEMU had no
usb-host device, so passing a host's USB device to a guest failed with
"'usb-host' is not a valid device model name" (issue #134). Installing the
headers afterwards changed nothing either, since the script configures again
only when its options change.

The script now installs libusb's headers (libusb-1.0-0-dev; libusb on
pacman) and configures QEMU with --enable-libusb, so a build without it stops
at configure. The new option also makes every existing build configure again
once, picking libusb up.
2026-10-26 17:38:07 +02:00
Anees Iqbal 104a35272f 📝 Show the GPU arm choice at the top of install-ctl.sh --help [ci skip]
--help named GPU_ARM only inside its Environment paragraph, so how to install
QEMU on Vulkan or Metal on a Mac was easy to miss. The help now gives both
commands under the usage line, with how switching and updates treat the arm.
2026-10-26 14:27:13 +02:00
Anees Iqbal ecca5cb76d 🐛 Move an installed reims-util to the pin on every host
reims-ctl __record-install installed reims-util on Linux alone, so on a Mac a
reims-util beside reims-ctl, such as one installed from its own checkout,
stayed at whatever it was through every install and update. It now installs
reims-util wherever one is beside reims-ctl too.

The install no longer passes --force: without it cargo 1.98.1 replaces a
reims-util from another commit or from a path, and leaves one already at the
pin as it is, building nothing (measured: 12 s to move a path install to
381f913, 0.07 s the second time). The target directory is still emptied first,
against cargo installing an earlier commit's build as a later one's.
2026-10-26 14:26:54 +02:00
Anees Iqbal 4fb0b6179d 🆕 Choose the Mac's GPU arm in install-ctl.sh with GPU_ARM
On a Mac the installer built QEMU on the Metal platform alone, and running a
VM on the Vulkan platform (on MoltenVK) took a QEMU configured by hand.
GPU_ARM=vulkan now builds the library with --platform vulkan and QEMU on it,
in a build directory of its own, and installs it as qemu/<build>-vulkan;
GPU_ARM=metal goes back. Unset, it keeps the installed QEMU's arm, read from
that suffix, so reims-ctl update does not switch it. The Vulkan arm also
checks for Homebrew's vulkan-loader and molten-vk, which metal2vulkan opens.
Linux builds as before: vulkan is its only arm.
2026-10-26 14:02:55 +02:00
Anees Iqbal afdd0494b4 🐛 Guard reims-ctl's VM files, sockets, settings and updates
reims-ctl could lose or clobber a VM's files and settings, run a VM twice on
its disks, or fail on long names and paths:
- QEMU writes the pid file itself, so a VM never runs twice; a start
  refuses a disk another running VM uses, and a delete finds a running VM
  by its pid file and keeps other VMs' files;
- settings stay saved while an installer or OpenCore image is made, and
  the logs toggle and the edit form's GPU follow the settings as saved;
- deletes take only the VM's own installer copy and old OpenCore image,
  and the installer's prune spares the QEMU builds running VMs execute;
- a QMP socket path fits a long VM name or TMPDIR, in a directory of the
  user's, and a view removes the frame directories killed viewers left;
- an update follows a force-pushed branch, a stop timeout of 0 waits for
  the guest, and create takes an SSH port of 0 as no forward, a MAC only in
  QEMU's form, and refuses an environment name the printed script breaks on.

Source: a8d5f7360 6e068ce7f 312574d62 eff723328 1a782184d 15a911eb5 a74547d99
        742e84995 c1692789c 72f4aef4a 49b7a366f 10a39d613 7e8a207b1 1bd4a5fad
        189bfe60b 00dc3769d 56bf0e527 8bb6451a0 3f48a7893 1675dce1f 15bc7d5cf
2026-10-26 12:24:31 +02:00
Anees Iqbal c099dd5a4d 🐛 Put the committed Cargo.lock back before an update moves the tree
A user's build rewrites Cargo.lock: cargo adds the metal2vulkan git sources
the committed lock leaves out. A changed lock then stops both ways an update
moves the checkout: reims-ctl's channel switch (git switch) and the script's
git pull --ff-only, as soon as the target changes the lock too. The update
failed with "commit or set aside its local changes".

The lock is the build's to write, so nothing is lost: reims-ctl's switch and
install-ctl.sh --update check the committed one out before they move, and
the next build writes it again. The switch test now has branches whose locks
differ and a clone whose lock the build rewrote.
2026-10-15 00:26:09 +03:00
Anees Iqbal 11f6a6ef4b 🐛 Configure QEMU again when a library its build names is gone
meson writes the system libraries QEMU links into build.ninja by their paths,
some by their versioned file (/usr/lib/libsnappy.so.1.2.2; Homebrew's carry
the version in the Cellar path). Removing or upgrading one left the cached
build naming a file ninja cannot make, and since the installer configured
again only when its options or reims-vgpu.pc changed, every later
install-ctl.sh and reims-ctl update stopped there until the user removed the
build directory.

The installer now configures again when ninja's dry run fails, which recovers
in the same run. When build.ninja is itself out of date (a QEMU update that
touches meson files, or a newer /bin/chmod), the dry run passes without
checking, and meson's regeneration reuses the dependencies it found before, a
removed one too; so a build that fails also makes the next run configure
again. configure starts meson afresh and keeps the objects already built.
2026-10-14 22:02:56 +03:00
Anees Iqbal 7685e5027a 🆕 Let x86-64 VMs run on VMware SVGA in QEMU's own window
An x86-64 VM's edit form (e) and reims-ctl set --graphics now choose between
reims-vgpu and QEMU's VMware SVGA II, for when a guest should come up without
the library: the firmware's framebuffer, one display, no GPU acceleration.

With VMware SVGA the library takes no part: vmware-svga takes apple-gfx's slot
and its id, gfx, which the terminal viewer's screendumps and input name, the
library's window and GPU variables and warnings are left out, and QEMU's own
GTK window shows the display. install-ctl.sh builds Linux QEMU with GTK for
it; on a QEMU without it, start refuses and names reims-ctl update. With no
Wayland compositor or X server in QEMU's environment (reims-ctl's, under the
VM's extra environment), GTK would end QEMU at its start, so the VM runs
headless under -display none there, as the library's window does. The edit
form hides the display and GPU fields on VMware SVGA and keeps their values
for a switch back; a test pins that a field following one the form lacks (an
arm64 VM's, with no graphics choice) still shows.

Booted on msi-laptop (docs/qemu.md): macOS 26.6.1 reaches its desktop at
1280x720 in QEMU's window, the viewer's screendump and input work, and stop
shuts it down.
2026-10-14 00:33:10 +03:00
Anees Iqbal 39d6ca78ef 🆕 Make new x86-64 VMs from reims-util's macOS downloads
A new x86-64 VM needed an OpenCore image and an installer made by hand with
OSX-KVM or ULTMOS. reims-ctl now runs reims-util for both: pick a macOS
version (n in the interface, create --macos on the command line) and it
downloads the installer from Apple, makes the VM's OpenCore image with OVMF
and a Mac identity of its own, and makes the disk.

- create --macos VERSION downloads Apple's recovery image (about 1 GB), or
  with --offline an installer of one release (13 to 20 GB). Installers are
  kept in the data directory's installers for the next VM, one reims-util at
  a time writes there, and a stopped download continues. The download comes
  before the VM's directory, so stopping it leaves no VM half made, and
  reims-util ends with reims-ctl on Linux. What create is given (a disk, an
  installer, an OpenCore image and the OVMF beside it, reims-util itself) is
  checked before the download and the disk's copy, and the VM list is read
  again before the VM joins it, so VMs made or deleted during a download
  stay as they are.
- --opencore is optional: without it reims-util makes the image, with the
  VM's MAC as its ROM, and an iMacPro1,1 for macOS 10.13 and 10.14. An image
  of the user's brings OVMF_CODE.fd and OVMF_VARS.fd beside it, as
  reims-util writes them.
- The interface's form asks where macOS comes from, the version first; with
  no name, the VM takes the version's, skipping names a VM or a leftover
  directory has. A VM with an installer says in its details, and create
  prints, how to install macOS from it; one made from a disk is reminded to
  set Metal's error mode.
- A new disk needs an installer or a download: a VM of an empty disk and no
  installer is refused.
- Every installer attaches as a read-only disk (snapshot=on), a DMG
  converted to a raw image in the VM's directory, so the CD drive is gone: a
  change of installer applies at the next start. vm.toml's installer_kind
  is no longer written, and is ignored where an older vm.toml has it. A
  missing installer says how to eject it.
- reims-ctl __record-install, which scripts/install-ctl.sh runs last,
  installs reims-util at the commit reims_util.rs pins, so the update that
  brings this reims-ctl installs it too, though it runs the script it
  started with. doctor checks for it in place of the system's OVMF, and the
  install no longer adds the ovmf or edk2-ovmf package.
- vm.max_map_count: a new VM's default of up to 16 GiB needs about 1.13
  million mappings, more than the 1048576 suggested (CachyOS's stock
  value). The README, the install script, doctor and the start warning
  suggest 2097152, which covers 30 GiB, and check against what the VM, the
  largest VM or a new one's default needs.
- Updating from the interface while a create runs says the restart stops
  it, as quitting does.

Dropped, as reims-util's images leave nothing for them to cover:
- create --from-script and the interface's launch-script import, which read
  OSX-KVM's and ULTMOS's QEMU scripts. A VM made from one keeps working; its
  vm.toml names its own copies.
- The search for OVMF beside a user's OpenCore image in those projects'
  layouts, QEMU's edk2 build and the distributions' packages, and
  --firmware-code and --firmware-vars.
- create --disk-mode overlay: copy, a reflink where the file system can, or
  in-place covers an existing disk. A VM made with an overlay keeps working.
- --cpu-model and --cpu-flags on create and set, and the edit form's CPU
  fields: new VMs take Skylake-Client-noTSX-IBRS. vm.toml keeps cpu_model
  and cpu_flags, so an older VM keeps its model; docs/qemu.md says how to
  change it there.
- --installer's --iso and --cdrom aliases.

README, the help and the docs no longer point at OSX-KVM or ULTMOS. README
step 3 describes reims-util's OpenCore picker (5 seconds, which an arrow key
stops, measured on homelab-ms01), and architecture.md 11.4 counts its image
among those that keep AvoidRuntimeDefrag on.
2026-10-12 19:37:12 +03:00
Anees Iqbal 88c9d3e72d 🐛 Import pages RADV refuses as host memory as udmabuf dma-bufs
RADV imports host memory as an amdgpu userptr, which Mesa asks for with
AMDGPU_GEM_USERPTR_ANONONLY, so the kernel refuses every page with a file
behind it. The guest's RAM and every view the library makes are memfd pages,
so on an AMD GPU a macOS guest died at its first no-copy buffer.

The runtime (metal2vulkan 11715e2a3f) now asks the caller for dma-bufs of
the pages wherever the pointer import is refused, on any driver. The library
answers with /dev/udmabuf: it resolves the range through the backing table,
gives the shared block of zeros' pieces a file of the import's own, cuts the
runs into chunks within udmabuf's limits as the host has them (1024 pieces
and 64 MiB by default, which no one is asked to raise) at the runtime's bind
granule, and pads several chunks to the granule. The runtime binds them
behind one sparse buffer, and asks again for a texture's own pages. Its own
memfds are sealed against shrinking, which udmabuf requires. A refusal names
its cause in the death line.

reims-ctl and the installer warn when a VM that would run on an AMD GPU
cannot open /dev/udmabuf (the kvm group's on Ubuntu), and reims-ctl's logs
show the device and its limits.

On the Radeon 780M (RADV of Mesa 26.0.8, udmabuf at its defaults) the guest
now cold-boots to its desktop, and Safari loads a page and quits: 5,119
dma-buf requests, none refused. NVIDIA, which imports the pointer, and macOS
are unchanged.
2026-10-12 11:50:33 +03:00
Anees Iqbal 98fe2a3bd5 🆕 Replace the tree with libreims_vgpu and its C API
This repository now holds libreims_vgpu, a Rust library that is the host
side of the paravirtualized GPU macOS guests drive, in place of Apple's
ParavirtualizedGraphics.framework: the library and its C API
(reims_vgpu.h), the PCI device's option ROM, QEMU's apple-gfx on that API
(vendor/qemu), the behaviour-lock suite that drives the C API as QEMU
does, and reims-ctl, the VM manager users run. README.md says what it is
and how it is laid out, and AGENTS.md how to change it.

Every file of the earlier tree is replaced. vendor/qemu moves to the
steelbrain/reims-vgpu branch of the same public repository.
2026-10-11 20:27:17 +03:00