dockur/macos

[Bug]: macOS Sonoma does not run on older Intel CPUs

Closed this issue · 4 comments

Operating system

Debian 12 Bookworm

Description

macOS Sonama enters a reboot loop immediately following a supposedly successful install. The docker log suggests this is because some CPU features are not present. This is probably true as the CPU is an Intel Core I5-3470 and quite old.

There seem to be similarities between this and issue #33 (the error message is the same and CPU features are missing).

Big Sur and Monterey work fine in my case. Ventura works but glitches attempting updates at the end of the install or during first boot. It subsequently works fine.

My problem is specifically with Sonoma.

Docker compose

sudo docker run -d
--name macos-sonoma
-e VERSION=sonoma
-e CPU_CORES=2
-e RAM_SIZE=4G
-e DISK_SIZE=32G
-p 5900:5900/tcp
-p 5900:5900/udp
-p 8007:8006
-v /home/macos/macos-sonoma:/storage
--device /dev/kvm
--cap-add NET_ADMIN
--restart unless-stopped
dockurr/macos

I have also tried it with -e CPU_MODEL="Haswell-noTSX" added but without any change.

Docker log

Image verification complete!
❯ Creating a 32G growable disk image in raw format...
❯ Extracting boot image...
❯ Booting macOS 1920x1080 using QEMU v8.2.4...
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.movbe [bit 22]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi1 [bit 3]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi2 [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.invpcid [bit 10]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.movbe [bit 22]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi1 [bit 3]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.bmi2 [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.07H:EBX.invpcid [bit 10]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
3h3h3hBdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
3h3h3hBdsDxe: failed to load Boot0080 "Mac OS X" from PciRoot(0x0)/Pci(0xA,0x0)/VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,F1CCE93706583D45A1DE1A8D92475757)/\B96B4911-A474-483C-ACE7-C9019FBF484C\com.apple.installer\boot.efi: Not Found
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
3h3h3hBdsDxe: failed to load Boot0080 "Mac OS X" from PciRoot(0x0)/Pci(0xA,0x0)/VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,F1CCE93706583D45A1DE1A8D92475757)/\B96B4911-A474-483C-ACE7-C9019FBF484C\com.apple.installer\boot.efi: Not Found
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
3h3h3hBdsDxe: failed to load Boot0080 "Mac OS X" from PciRoot(0x0)/Pci(0xA,0x0)/VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,F1CCE93706583D45A1DE1A8D92475757)/\B96B4911-A474-483C-ACE7-C9019FBF484C\System\Library\CoreServices\boot.efi: Not Found
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
3h3h3hBdsDxe: failed to load Boot0080 "Mac OS X" from PciRoot(0x0)/Pci(0xA,0x0)/VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,F1CCE93706583D45A1DE1A8D92475757)/\B96B4911-A474-483C-ACE7-C9019FBF484C\System\Library\CoreServices\boot.efi: Not Found
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
3h3h3hBdsDxe: failed to load Boot0080 "Mac OS X" from PciRoot(0x0)/Pci(0xA,0x0)/VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,F1CCE93706583D45A1DE1A8D92475757)/\B96B4911-A474-483C-ACE7-C9019FBF484C\System\Library\CoreServices\boot.efi: Not Found
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
3h3h3hBdsDxe: failed to load Boot0080 "Mac OS X" from PciRoot(0x0)/Pci(0xA,0x0)/VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,F1CCE93706583D45A1DE1A8D92475757)/\B96B4911-A474-483C-ACE7-C9019FBF484C\System\Library\CoreServices\boot.efi: Not Found
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
3h3h3hBdsDxe: failed to load Boot0080 "Mac OS X" from PciRoot(0x0)/Pci(0xA,0x0)/VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,F1CCE93706583D45A1DE1A8D92475757)/\B96B4911-A474-483C-ACE7-C9019FBF484C\System\Library\CoreServices\boot.efi: Not Found
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
#[EB|LOG:EXITBS:END] _
#[EB.BST.FBS|-]
#[EB|B:BOOT]
#[EB|LOG:HANDOFF TO XNU] _
======== End of efiboot serial output. ========
3h3h3hBdsDxe: failed to load Boot0080 "Mac OS X" from PciRoot(0x0)/Pci(0xA,0x0)/VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,F1CCE93706583D45A1DE1A8D92475757)/\B96B4911-A474-483C-ACE7-C9019FBF484C\System\Library\CoreServices\boot.efi: Not Found
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
qemu-system-x86_64: terminating on signal 15 from pid 1 (/usr/bin/tini)

Screenshots (optional)

See issue #33. My screenshot would be identical.

I created a new version now (v1.06), but I dont think it will fix your issue.

Sonoma just need certain features from your hardware, like AVX2 extensions, and if your hardware cannot provide them, there is not much we can change about that. I know that for Ventura there are some hacks/patches to make it work on CPU's without AVX, so maybe in the future someone will make a similar patch for Sonoma. But even in that case, the experience will be far from optimal because even if it runs, it will run slower than intended.

So if Ventura works fine on your hardware, I would just stick to that instead.

Many thanks for the quick reply. Totally agree that it is difficult to make something work on hardware that doesn't have the capability to run it. I guess I was hoping that QEMU could be made to emulate a later CPU. It's a little sad if it can't because the I5-3470 is actually still a very capable CPU which can run virtually all modern workloads.

I think I'll take your advice and stick with an earlier macOS version. To be honest having the latest and greatest isn't particularly relevant for my purposes.

I'll give Sonoma one more try with your latest release and then close with comment.

@JOH451 Yes, QEMU can emulate CPU instructions like AVX, but only when you disable KVM (virtualization extensions). That means that all the other instructions that your cpu DOES have, will also not get hardware-accelerated anymore but emulated, causing the whole system to run in slow-motion. So disabling KVM just to get AVX is not a good option.

Okay, that makes sense. You are effectively saying that QEMU has to emulate the whole of the CPU rather than just odd parts. I can see that such emulation would result in a BIG performance hit.

Anyway, I have retried Sonoma with your new release and as expected it made no difference.

In summary. macOS Sonoma will not work on Intel CPU's with a microarchitecture prior to Haswell when AVX was introduced.

Many thanks for your help.