🐛 Leave out the video devices while an installer is attached

macOS 26's Recovery hung at its first screen on x86-64 VMs: the display's mode
was set and nothing was ever drawn. In the installer and in Recovery, the GPU
port's loader finds the System KC's libraries absent and leaves its GPU and
IOSurface mapper drivers unbound, so the mapper's service never appears. The
ported VideoToolbox and M2 scaler drivers wait for that service in their start
with no timeout, and WindowServer never draws behind them.

While an installer is attached, an x86-64 VM now has neither video device, so
both drivers load and match nothing. The kexts in the OpenCore image stay as
they are. Lilu's installer-or-recovery mode cannot make that choice in the
guest: it does not see this Recovery, since VtWaitPatch, which Lilu starts in
its normal mode alone, ran in it.

Checked on msi-laptop with a 26.7 Recovery and the image's full kext set:
before, it hung; with the scaler driver alone it hung, with no type 1 request
reaching the host; with this build, Recovery came up and Disk Utility showed
the SATA disk.
This commit is contained in:
Anees Iqbal committed 2026-10-29 19:08:13 +02:00
1 parent a456daf003
commit 4defad9bd6
3 files changed
+28 -4

No files matched your search

+2 -1
View File
@@ -338,7 +338,8 @@ pub struct SetArgs {
#[arg(long)]
pub gpu: Option<String>,
/// On reims-vgpu: the host's hardware video decode, encode and scaling for the guest. Off,
/// the guest does them in software
/// the guest does them in software. An x86-64 VM goes without it while an installer is
/// attached, where macOS Recovery would hang on it
#[arg(long, num_args = 0..=1, default_missing_value = "true")]
pub video_acceleration: Option<bool>,
#[arg(long, num_args = 0..=1, default_missing_value = "true")]
+24 -2
View File
@@ -60,6 +60,14 @@
//! A VM whose settings turn video acceleration off (`video_acceleration = false`) has neither,
//! and its guest decodes, encodes and scales video in software.
//!
//! An x86-64 VM has neither while an installer is attached either. In macOS 26's installer and
//! Recovery, the port's loader finds the System KC's libraries absent and leaves its GPU and
//! mapper drivers unbound, so the mapper's service never appears. Both video drivers' starts wait
//! for it with no timeout, and WindowServer then never draws: Recovery hangs at its first screen,
//! with the display's mode set and nothing drawn (msi-laptop, a 26.7 Recovery, 2026-10-29). Without
//! the devices the drivers load and match nothing. Lilu's installer-or-recovery mode does not
//! see that Recovery: VtWaitPatch, which Lilu starts in its normal mode alone, ran in it.
//!
//! `vmapple-arm64` follows scripts/internal/run_vmapple.sh, with the video devices besides.
use crate::host::{Host, Os, Profile};
@@ -300,8 +308,9 @@ fn q35(vm: &Vm, ctx: &Ctx, a: &mut Vec<String>) -> Result<()> {
"-device",
"apple-gfx-iosurface-pci,id=iosfc,gpu=gfx,bus=pcie.0,addr=0x6",
]);
// The video devices, whose guest drivers link the mapper's (the module doc).
if c.video_acceleration {
// The video devices, whose guest drivers link the mapper's, and none while an installer
// is attached (the module doc).
if c.video_acceleration && q.installer.is_none() {
push(&[
"-device",
"apple-videotoolbox-pci,id=video,bus=pcie.0,addr=0x8",
@@ -773,6 +782,19 @@ mod tests {
}
}
/// While an installer is attached, an x86-64 VM with video acceleration on has the command
/// line of one with it off: neither video device.
#[test]
fn an_attached_installer_leaves_out_both_video_devices() {
let mut on = q35_vm();
on.config.q35.as_mut().unwrap().installer = Some("installer.img".into());
let mut off = on.clone();
off.config.video_acceleration = false;
let a = invocation(&on, &ctx(linux())).unwrap().args;
assert_eq!(a, invocation(&off, &ctx(linux())).unwrap().args);
assert!(has(&a, &["-device", "ide-hd,bus=sata.4,drive=installer"]));
}
/// A disk moved to NVMe is on a controller of its own, off the AHCI controller.
#[test]
fn a_disk_on_nvme_has_a_controller_of_its_own() {
+2 -1
View File
@@ -1499,7 +1499,8 @@ impl App {
"Video acceleration",
c.video_acceleration,
"The guest decodes, encodes and scales video on the host's hardware. Off, it \
does all of that in software.",
does all of that in software. An x86-64 VM goes without it while an installer \
is attached, where macOS Recovery would hang on it.",
)
.show_if("graphics", library),
Field::toggle(