macOS: guest agent, online templates, virtio-fs shares, persistent home volume
Apple's built-in QEMU guest agent (AppleQEMUGuestAgent, launched by launchd when a virtio console port org.qemu.guest_agent.0 appears; guest-exec as root) is attached by vmix run --macos and the NixOS module. AppleVirtIO.kext on x86 Tahoe drives virtio-fs, block, console, input, net — verified in QEMU. - customizeImage: `bootScript` — online step through the guest agent (driver mode qga): boot the image, run the script as root with the VMIX volume, shut down through the agent. `as_user` runs commands in the logged-in session. - templates.software: pkg/app (offline in the PE), script/homebrew (online). - templates.profile.settings: widgets, wallpaper (pinned desktoppr — Apple Events need TCC consent that a headless session cannot give), dock apps, autohide, dark mode, hidden files. - generalize: persistHome (fstab LABEL=vmix-home /Users), hideWidgets offline. - formatVolume: formats a blank disk image as APFS by booting the PE (~35 s); idempotent. - NixOS module: macos.guestAgent (/run/vmix/qga-<name>.sock), shares via virtiofsd + vhost-user-fs (Apple automount tag for the first share, others mounted through the agent), macos.homeDisk (created + formatted on first start, virtio-blk), SPICE keeps -vga vmware for macOS. - CLI: vmix run --macos --share DIR --home FILE --qga PATH. - qemu.nix helpers; README section. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XsESshRCoBoUVWV9qKURUF
This commit is contained in:
parent
50ad8d521c
commit
0f9373263d
13 changed files with 600 additions and 19 deletions
|
|
@ -93,9 +93,9 @@ with lib;
|
|||
};
|
||||
};
|
||||
displayDevice = mkOption {
|
||||
type = types.enum [ "virtio" "qxl" "std" "none" ];
|
||||
type = types.enum [ "virtio" "qxl" "std" "vmware" "none" ];
|
||||
default = "qxl";
|
||||
description = "QEMU -vga type to use with SPICE (qxl, virtio, std, none).";
|
||||
description = "QEMU -vga type to use with SPICE (qxl, virtio, std, vmware, none). macOS has no QXL/virtio-gpu driver: it always uses vmware (or std).";
|
||||
};
|
||||
vgamem = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
|
|
@ -212,11 +212,11 @@ with lib;
|
|||
};
|
||||
target = mkOption {
|
||||
type = types.str;
|
||||
description = "Target path inside the VM for the shared directory.";
|
||||
description = "Target path inside the VM for the shared directory. macOS: the share named `automount` (or the first one) appears at /Volumes/My Shared Files; others are mounted at target through the guest agent.";
|
||||
};
|
||||
};
|
||||
});
|
||||
description = "Shared directories.";
|
||||
description = "Shared directories (9p for Linux, virtio-fs via virtiofsd for macOS).";
|
||||
};
|
||||
|
||||
disks.bus = mkOption {
|
||||
|
|
@ -265,6 +265,38 @@ with lib;
|
|||
default = null;
|
||||
description = "MAC address of en0. Defaults to the image's macAddress (must match OpenCore's ROM for Apple ID / iMessage).";
|
||||
};
|
||||
guestAgent.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Attach Apple's built-in QEMU guest agent (virtio console port org.qemu.guest_agent.0). Socket: /run/vmix/qga-<name>.sock; guest-exec runs as root.";
|
||||
};
|
||||
homeDisk = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Persistent home volume: a host disk image attached as virtio-blk, formatted APFS with label `label` by the PE on first start. The image must be generalized with persistHome = true (fstab mounts it at /Users), which makes the OS disk safely ephemeral (disks.os.persist = false).";
|
||||
};
|
||||
file = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "Path of the home disk image, e.g. /storage/vms/mac/home.qcow2 (created if missing).";
|
||||
};
|
||||
format = mkOption {
|
||||
type = types.enum [ "qcow2" "raw" ];
|
||||
default = "qcow2";
|
||||
description = "Image format; use raw for a zvol/block device (created only for files).";
|
||||
};
|
||||
size = mkOption {
|
||||
type = types.str;
|
||||
default = "64G";
|
||||
description = "Size when the image is created.";
|
||||
};
|
||||
label = mkOption {
|
||||
type = types.str;
|
||||
default = "vmix-home";
|
||||
description = "APFS volume label (must match generalize's homeVolumeLabel).";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
tpm = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue