-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for macOS runners #3
Comments
Installed ok with default approach in the README:
Runs fine after moving to zvol: diff --git a/OpenCore-Boot.sh b/OpenCore-Boot.sh
index e027851..047a910 100755
--- a/OpenCore-Boot.sh
+++ b/OpenCore-Boot.sh
@@ -56,7 +56,8 @@ args=(
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
- -drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
+ # -drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
+ -drive id=MacHDD,if=none,file="/dev/zvol/cuffs/base/servo-macos13.clean",format=raw
-device ide-hd,bus=sata.4,drive=MacHDD
# -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-netdev user,id=net0,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27 |
All three boot menu options crash qemu when moving to libvirt, using the changes below plus this process: diff --git a/macOS-libvirt-Catalina.xml b/macOS-libvirt-Catalina.xml
index 05cb13f..b92bfcc 100644
--- a/macOS-libvirt-Catalina.xml
+++ b/macOS-libvirt-Catalina.xml
@@ -1,4 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
+<!-- Based on <https://github.com/kholia/OSX-KVM/blob/182e2dd0715175801521f6342ac7cc715044cb12/macOS-libvirt-Catalina.xml> -->
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!--
macOS libvirt XML configuration.
@@ -34,17 +35,19 @@
give the clock a tsc timer for kvm to pass to the guest.
See comments on the <kvm> and <clock> attributes.
-->
- <name>macOS</name>
- <uuid>2aca0dd6-cec9-4717-9ab2-0b7b13d111c3</uuid>
- <title>macOS</title>
- <memory unit='KiB'>4194304</memory>
- <currentMemory unit='KiB'>4194304</currentMemory>
- <vcpu placement='static'>4</vcpu>
+ <name>servo-macos13.init</name>
+ <uuid>281ecffa-204e-4528-9ccf-12948f4cb78f</uuid>
+ <memory unit="KiB">25165824</memory>
+ <currentMemory unit="KiB">25165824</currentMemory>
+ <memoryBacking>
+ <hugepages/>
+ </memoryBacking>
+ <vcpu placement='static'>16</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
<!-- We don't need patched OVMF anymore when using latest OpenCore, stock one is okay -->
- <loader readonly='yes' type='pflash'>/home/CHANGEME/OSX-KVM/OVMF_CODE.fd</loader>
- <nvram>/home/CHANGEME/OSX-KVM/OVMF_VARS.fd</nvram>
+ <loader readonly='yes' type='pflash'>/var/lib/libvirt/images/OSX-KVM/OVMF_CODE.fd</loader>
+ <nvram>/var/lib/libvirt/images/OSX-KVM/OVMF_VARS.fd</nvram>
</os>
<features>
<acpi/>
@@ -59,24 +62,26 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/run/libvirt/nix-emulators/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writeback' io='threads'/>
- <source file='/home/CHANGEME/OSX-KVM/OpenCore/OpenCore.qcow2'/>
+ <source file='/var/lib/libvirt/images/OSX-KVM/OpenCore/OpenCore.qcow2'/>
<target dev='sda' bus='sata'/>
<boot order='2'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
- <disk type='file' device='disk'>
- <driver name='qemu' type='qcow2' cache='writeback' io='threads'/>
- <source file='/home/CHANGEME/OSX-KVM/mac_hdd_ng.img'/>
+ <disk type='block' device='disk'>
+ <!-- TODO: can we benefit from these OSX-KVM defaults? -->
+ <!-- <driver name='qemu' type='qcow2' cache='writeback' io='threads'/> -->
+ <driver name='qemu' type='raw' cache='none' io='native' discard='unmap'/>
+ <source dev='/dev/zvol/path/to/servo-macos13'/>
<target dev='sdb' bus='sata'/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="raw" cache="writeback"/>
- <source file="/home/CHANGEME/OSX-KVM/BaseSystem.img"/>
+ <source file="/var/lib/libvirt/images/OSX-KVM/BaseSystem.img"/>
<target dev="sdc" bus="sata"/>
<boot order="3"/>
<address type="drive" controller="0" bus="0" target="0" unit="2"/>
@@ -141,7 +146,7 @@
<!-- Make sure you put your nic in bus 0x0 and slot 0x0y(y is numeric), this will make nic built-in and apple-store work-->
<interface type="bridge">
<mac address="52:54:00:e6:85:40"/>
- <source bridge="virbr0"/>
+ <source bridge="cinet"/>
<model type="vmxnet3"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x00" function="0x0"/>
</interface>
Maybe there’s a discrepancy in the effective qemu configs? Top is with OpenCore-Boot.sh, bottom is with libvirt:
|
We can’t get a core dump due to “resource limits”:
This is true even if ulimit and systemd-coredump are configured as follows:
systemd.coredump.extraConfig = ''
Storage=external
Compress=yes
ProcessSizeMax=200G
ExternalSizeMax=200G
JournalSizeMax=0
MaxUse=0
KeepFree=0
''; Per this blog post, this is because the qemu process had its limit set to zero:
We get the core dump summary below. It’s for process 1545846, but it’s not clear to me which thread crashed:
The segfault happened in kvm_virtio_pci_vector_use_one, on thread 1545895:
|
Found the bug:
The fix commit seems to be in qemu 9.1.0 only, and we have qemu 8.2.5. We’ll need to update or patch our qemu. |
Fixed in d177616: |
Injecting files into the boot volume may be impossible:
Enabling SSH access:
Logging in automatically:
Running stuff on boot:
|
We may be able to run macOS on libvirt/KVM, thanks to https://github.com/kholia/OSX-KVM!
The text was updated successfully, but these errors were encountered: