utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
27.3k stars 1.35k forks source link

4.3.0 Beta, M1 Host, OS 10.11 guest - hangs in terminal window when booting #5371

Closed beowulff closed 1 week ago

beowulff commented 1 year ago

BEFORE SUBMITTING YOUR ISSUE, PLEASE LOOK AT THE PINNED ISSUES AND USE THE SEARCH FUNCTION TO MAKE SURE IT IS NOT ALREADY REPORTED. ALWAYS COMMENT ON AN EXISTING ISSUE INSTEAD OF MAKING A NEW ONE.

Describe the issue
Trying to get El Capitan (OS 10.11) to run under emulation in UTM on MacBook Pro M1, Ventura. Even under UTM 4.1 and 4.2, this never really worked, but 4.3 is even worse. When the the VM boots, before the login screen appears, the VM gets stuck in some type of Terminal window, with a white block cursor in the upper left corner, and a completely black screen. The window will accept typing from the keyboard, but nothing seems to have any effect, and after a few seconds, the input is erased and the cursor comes back. The only way out is to force a shutdown.

Configuration
4.3.0 beta Ventura, 13.4 M1 Pro

No crash log - the VM just hangs.

config:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

Backend QEMU ConfigurationVersion 4 Display DownscalingFilter Linear DynamicResolution Hardware virtio-vga-gl NativeResolution UpscalingFilter Linear Drive Identifier 0 ImageName OVMF.bin ImageType Disk Interface None ReadOnly Identifier 1 ImageName EFI-LEGACY.qcow2 ImageType Disk Interface USB ReadOnly Identifier 4 ImageType CD Interface IDE ReadOnly Identifier 1D547750-23BC-414E-B67F-60D3C385DE6A ImageName 1D547750-23BC-414E-B67F-60D3C385DE6A.qcow2 ImageType Disk Interface IDE ReadOnly Information Icon OSX10.11.png IconCustom Name OS X 10.11 (config only) Notes OS X 10.11.6 Download installer from https://support.apple.com/en-us/HT211683 . Run https://github.com/BITespresso/createinstalliso with proper arguments to convert "Install El Capitan.app" into InstallElCapitan.iso . To configure, use the CD/DVD drop-down to select InstallElCapitan.iso. Then boot from the image, install onto the existing virtual HD, and reboot into your newly installed OS. OVMF.vbin and EFI-LEGACY.img are from https://github.com/khronokernel/khronokernel.github.io/tree/master/Binaries UUID FB173E32-2AE3-4EC6-847E-EC5C3B360212 Input MaximumUsbShare 8 UsbBusSupport 3.0 UsbSharing Network Hardware e1000-82545em IsolateFromHost MacAddress 36:E6:08:03:F3:9D Mode Bridged PortForward QEMU AdditionalArguments -usbdevice keyboard BalloonDevice DebugLog Hypervisor MachinePropertyOverride vmport=off PS2Controller RNGDevice RTCLocalTime TPMDevice UEFIBoot Serial Sharing ClipboardSharing DirectoryShareMode None DirectoryShareReadOnly Sound Hardware intel-hda System Architecture x86_64 CPU Penryn CPUCount 4 CPUFlagsAdd ssse3 sse4.1 sse4.2 CPUFlagsRemove ForceMulticore JITCacheSize 0 MemorySize 8192 Target q35
adespoton commented 1 year ago

@osy , I've verified that the update to QEMU 8.0 has done something odd to the X86_64 TCG core. OS X 10.7 through OS X 10.9 boot correctly as expected, but OS X 10.10 and later seem to be failing during boot. 10.10 and 10.11 show no informative message in debug logs or OS boot debug logs, but I've got a 10.12 image with VMWare drivers, and it gets into an infinite loop at hgfs: Debug: RpcOut: couldn't open channel with RPCI protocol after loading com.vmware.kext.vmhgfs version 1672.44.64. After failing to open RPC channel, it throws two IOConsoleUsers messages and loops to attempting to load the vmhgfs kext.

Attempting to run the same OS X 10.11 config via vanilla qemu-system-x86_64 version 8.0.2 (without SPICE of course) leads to a loop at usb_desc_get_descriptor: 3 unknown type 33 (len 10) usb_desc_get_descriptor: 2 unknown type 33 (len 10) usb_desc_get_descriptor: 1 unknown type 33 (len 10) usb_desc_get_descriptor: 1 unknown type 33 (len 10) at a similar location in the boot process.

With macOS 10.13, I get the more informative: crashed: WindowServer. Too many corpses being created.

So this appears to be an issue with QEMU 8 and OpenCore, and not an issue with UTM. Next up, I'll try to do a clean boot of an install DVD on vanilla QEMU 8 with OpenCore and see if that gets any further.

osy commented 1 year ago

I’ve think I had issues with MacOS 9.2.1 as well. There was a compiler issue that broke TCG but I’ve built 4.3.0 beta with the older compiler. Just to confirm, neither of you are using a custom built version right?

adespoton commented 1 year ago

Correct. Using both homebrew 8.0.2 and UTM 4.3.0 beta, I'm getting the same results. I've re-tested now with everything stripped back, and with just the OpenCore EFI and the install image, I can't get WindowServer to load without crashing.

Others have complained of issues with 9.2.1 on homebrew qemu-system-ppc 8.0.2 as well in the emaculation forums, but I haven't been able to replicate those issues with the emaculation builds of regular or screamer.

beowulff commented 1 year ago

Sorry, I was away. Correct - I downloaded the 4.3.0 beta pre-built binary.

adespoton commented 1 year ago

I’ve verified that it’s a QEMU 8 issue, and made Osy aware.  Any further reporting/tracking will need to be to the QEMU project itself.-Em On Jun 12, 2023, at 12:21 PM, beowulff @.***> wrote: Sorry, I was away. Correct - I downloaded the 4.3.0 beta pre-built binary.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

osy commented 1 year ago

Can you try v4.3.5? We reverted back to QEMU 7.2.0 so it would be interesting to see if QEMU is the issue.

beowulff commented 1 year ago

I’m out of town, but I will try it and report back in a day or so.-RZSent from my iPhoneOn Aug 4, 2023, at 5:51 PM, osy @.***> wrote: Can you try v4.3.5? We reverted back to QEMU 7.2.0 so it would be interesting to see if QEMU is the issue.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

adespoton commented 1 year ago

I’ll try soon — when I was testing before, the issue was irrespective of UTM; cropped up with QEMU 8.0+ in any form; I’ll let you know how things go with 4.3.5.I also flagged it up to Mark Cave-Ayland including the PPC bits; he didn’t have any insight on the x86_64 side, but requested we figure out what version broke things so they could track down what changed.If anyone has reproducible issues with ppc, we should definitely get those to Mark.-Em On Aug 4, 2023, at 6:03 PM, beowulff @.> wrote: I’m out of town, but I will try it and report back in a day or so.-RZSent from my iPhoneOn Aug 4, 2023, at 5:51 PM, osy @.> wrote:

Can you try v4.3.5? We reverted back to QEMU 7.2.0 so it would be interesting to see if QEMU is the issue.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

beowulff commented 1 year ago

OK - On 4.3.5

10.11 boots to the login screen. After typing a few characters of my password, it crashed and re-loaded the login screen. I was eventually able to type my entire password in, but then the screen went black, and the login screen came up again. So the Emulated machine seems to work, but Mac OS 10.11 is crashing.

10.13 boots, and loads Finder. One of my apps that I need to run launched, and actually worked for awhile, but eventually crashed, and now it won’t open again. I think I might be able to fix this - it might have something to do with no printer being available.

I will report back when I have a chance to play with it.

But, all in all, much improved from 4.3

-RZ

On Aug 4, 2023, at 5:51 PM, osy @.***> wrote:

Can you try v4.3.5? We reverted back to QEMU 7.2.0 so it would be interesting to see if QEMU is the issue.

— Reply to this email directly, view it on GitHub https://github.com/utmapp/UTM/issues/5371#issuecomment-1666312121, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJYWL7BZUJZENLV32TUG7TXTWKINANCNFSM6AAAAAAY3JKJIQ. You are receiving this because you authored the thread.

beowulff commented 1 year ago

I’ve been playing with 4.3.5 and MacOS 10.13.6 for a few hours.

It was pretty unstable until I changed the video to virtio-vga (no gl). Since I did that, it hasn’t crashed, and the video doesn’t seem any slower. And, as a side benefit, the Emulated Machine can be paused and resumed.

One issue I have found is that FileMaker 10 crashes on launch - some issue with CoreGraphics.

I’m cautiously optimistic that this might be usable.

-RZ

On Aug 6, 2023, at 9:57 PM, Robert Zusman @.***> wrote:

OK - On 4.3.5

10.11 boots to the login screen. After typing a few characters of my password, it crashed and re-loaded the login screen. I was eventually able to type my entire password in, but then the screen went black, and the login screen came up again. So the Emulated machine seems to work, but Mac OS 10.11 is crashing.

10.13 boots, and loads Finder. One of my apps that I need to run launched, and actually worked for awhile, but eventually crashed, and now it won’t open again. I think I might be able to fix this - it might have something to do with no printer being available.

I will report back when I have a chance to play with it.

But, all in all, much improved from 4.3

-RZ

On Aug 4, 2023, at 5:51 PM, osy @.***> wrote:

Can you try v4.3.5? We reverted back to QEMU 7.2.0 so it would be interesting to see if QEMU is the issue.

— Reply to this email directly, view it on GitHub https://github.com/utmapp/UTM/issues/5371#issuecomment-1666312121, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJYWL7BZUJZENLV32TUG7TXTWKINANCNFSM6AAAAAAY3JKJIQ. You are receiving this because you authored the thread.

beowulff commented 1 year ago

OK, I spoke too soon.

I tried my critical app (DesignWorks) and it also crashes on launch - with the same error (CoreGraphics). So, it appears that accelerated graphics is (are?) required for these two apps, and that makes the Emulated Machine unstable.

sigh

-RZ

On Aug 7, 2023, at 11:52 AM, Robert Zusman @.***> wrote:

I’ve been playing with 4.3.5 and MacOS 10.13.6 for a few hours.

It was pretty unstable until I changed the video to virtio-vga (no gl). Since I did that, it hasn’t crashed, and the video doesn’t seem any slower. And, as a side benefit, the Emulated Machine can be paused and resumed.

One issue I have found is that FileMaker 10 crashes on launch - some issue with CoreGraphics.

I’m cautiously optimistic that this might be usable.

-RZ

On Aug 6, 2023, at 9:57 PM, Robert Zusman @.***> wrote:

OK - On 4.3.5

10.11 boots to the login screen. After typing a few characters of my password, it crashed and re-loaded the login screen. I was eventually able to type my entire password in, but then the screen went black, and the login screen came up again. So the Emulated machine seems to work, but Mac OS 10.11 is crashing.

10.13 boots, and loads Finder. One of my apps that I need to run launched, and actually worked for awhile, but eventually crashed, and now it won’t open again. I think I might be able to fix this - it might have something to do with no printer being available.

I will report back when I have a chance to play with it.

But, all in all, much improved from 4.3

-RZ

On Aug 4, 2023, at 5:51 PM, osy @.***> wrote:

Can you try v4.3.5? We reverted back to QEMU 7.2.0 so it would be interesting to see if QEMU is the issue.

— Reply to this email directly, view it on GitHub https://github.com/utmapp/UTM/issues/5371#issuecomment-1666312121, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJYWL7BZUJZENLV32TUG7TXTWKINANCNFSM6AAAAAAY3JKJIQ. You are receiving this because you authored the thread.

xpitt commented 1 year ago

Just tested os x 10.8 and 10.12 on utm 4.3.5. 10.8 works with some glitches: desktop does not appear initially but it does after finder force restart and safari crashes. 10.12 apparently works, so do safari and firefox (1.0.9) but both Adobe CS%.5 (acrobat, illustrator, photoshop) and Office for mac 2011 crash. So, I am going to stick as much as possible with utm 4.1.2

Just tested os x 10.8 on utm 4.4.0. Same behavior as with 4.3.5

AramiCyborg commented 1 year ago

thank you I have been working day in and out trying to get it to work but still does not come up.

On Mon, Aug 28, 2023 at 2:44 AM xpitt @.***> wrote:

Just tested os x 10.8 and 10.12 on utm 4.3.5. 10.8 works with some glitches: desktop does not appear initially but it does after finder force restart and safari crashes. 10.12 apparently works, so do safari and firefox (1.0.9) but both Adobe CS%.5 (acrobat, illustrator, photoshop) and Office for mac 2011 crash. So, I am going to stick as much as possible with utm 4.1.2

Just tested os x 10.8 on utm 4.4.0. Same behavior as with 4.3.5

— Reply to this email directly, view it on GitHub https://github.com/utmapp/UTM/issues/5371#issuecomment-1695121336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQVDPXJG5VMBSDRDJ23DOATXXQ44HANCNFSM6AAAAAAY3JKJIQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

adespoton commented 1 year ago

I've tested 10.10, 10.11 and 10.12 on 4.4.1, and 10.10 and 10.12 are now working correctly.

However, 10.11 consistently has the following segmentation fault, even when using a clean EFI and a clean install DVD and blank target disk: screenshot

When using an already-configured image, this fault always appears shortly after the window manager loads, for the main install or the recovery partition.

xpitt commented 1 year ago

tested 4.4.1, same conclusions as before. Sigh

adespoton commented 1 year ago

Odd; I'm running 10.8 in 4.4.1 with no issues. Maybe your image got corrupted like my 10.10 one did with an earlier UTM version? I haven't attempted to recreate your issues with 10.12 yet, as I only have CS4 and not CS5.

xpitt commented 1 year ago

I tried 10.8 fresh install on 4.4.1. installation ok with glitches: safari crashes and app store is unreachable (but the latter was also true for the latest reinstall of utm 4.1.2, while safari works in it). both office 2011 and adobe cs5.5 work ok. Altogether I have not seen any substantial improvement in 4.4.1 over 4.1.2, as far as os x 10.8 is concerned. I don't know if 4.4.1 improves my other vms, android 4.4, ubuntu 22.04, win 10 x64 and win 11 arm, but they are far less important than os x 10.8 to me, so went back to utm 4.1.2. I'll probably give a try to the coming final version of 4.4 when it will come out.

adespoton commented 1 year ago

I spoke too soon on 10.10; eventually, it always freezes up. 10.8, 10.9 and 10.12 are all functioning for me though.

tbussmann commented 1 year ago

Aren't these compatibility issues mainly a question of the QEMU version and not of the UTM version? I compiled a quick overview on the changes of QEMU in UTM that may help to understand the observations:

UTM QEMU
2.0.10 5.1.0
2.0.12 5.2.0rc3
2.0.14 5.2.0
2.1.0 6.0.0
2.2.0 6.1.0rc1
2.2.1 6.1.0
3.0.0 6.2.0
3.2.0 7.0.0
4.1.0 7.1.0
4.1.3 7.2.0
4.3.0 8.0.0
4.3.1 8.0.2
4.3.5 7.2.0
4.4.1 still 7.2.0
adespoton commented 1 year ago

Originally we thought so, hence the rollback in QEMU versions.  However, this doesn’t appear to have fully fixed the issues, as raw QEMU 7.2 does not exhibit these issues.-Em On Sep 22, 2023, at 1:20 AM, Tobias Bussmann @.***> wrote: Aren't these compatibility issues mainly a question of the QEMU version and not of the UTM version? I compiled a quick overview on the changes of QEMU in UTM that may help to understand the observations:

UTM QEMU

2.0.10 5.1.0

2.0.12 5.2.0rc3

2.0.14 5.2.0

2.1.0 6.0.0

2.2.0 6.1.0rc1

2.2.1 6.1.0

3.0.0 6.2.0

3.2.0 7.0.0

4.1.0 7.1.0

4.1.3 7.2.0

4.3.0 8.0.0

4.3.1 8.0.2

4.3.5 7.2.0

4.4.1 still 7.2.0

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

xpitt commented 1 year ago

I tried installing 10.8 directly on qemu 8.1.1 installed with homebrew using the instructions in https://wiki.qemu.org/Documentation/GuestOperatingSystems/MacOS10.8

Seems pretty snappy, unfortunately the installation has no network and I don't have the knowledge to provide it. Also, I don't think I will test right now if adobe and Office do work. My feeling is that the problem may be in UTM more than in qemu itself.

xpitt commented 1 year ago

Tried 4.4.3 , nothing new

xpitt commented 1 year ago

Tried 4.4.4, apparently no progress. A posteriori an unpleasant bug(?). Upon deleting UTM with appcleaner and reinstalling 4.1.2 the settings remained the same as 4.4.4 and its glitches on os x 10.8 remained present, never happened before. After trying again I had to wipe the hd, reinstall 14.0 and recover from backup. So finally 4.1.2 worked as it used to. I'm wondering: where did the 4.4.4 info remain?

arekkusu42 commented 7 months ago

I spent a day investigating this, because it is blocking me from running many i386 apps on older macOS guests.

Here are three reproduction cases you can try in UTM now:

1) run any 32-bit GUI app, in Mavericks or later guest macOS You can use an app included with the OS, like System Preferences: arch -arch x86_64 "/Applications/System Preferences.app/Contents/MacOS/System Preferences" -> works normally, but arch -arch i386 "/Applications/System Preferences.app/Contents/MacOS/System Preferences" -> crashes in CG::Chunk::apply_transform with the same backtrace as described in #4990.

2) a minimal reproduction case tripping the CG crash by drawing an about box: mini.zip (this was compiled for i386 using Sierra and Xcode 9.2) -> crashes with same CG backtrace

3) a minimal reproduction case isolating the problem to root cause: page.zip This reads one float from the end of a 4k page, but it appears that QEMU's TCG SSE emulation reads an entire 128-bit vector, which spills into the next 4k page, which can SIGSEGV. -> this crashes in UTM 4.4.5, but it works in UTM 4.1.2. Also works on M3 under Rosetta2, and on a physical 2007 MBP running Mavericks. This is x86_64, so it demonstrates that the problem is not 32-bit specific; the crash only depends on page layout. Every application is potentially affected.

The El Capitan login crashes described in this issue are similar. If you look at the WindowServer crash logs (i.e. by letting a new UTM crash, and then using UTM 4.1.2 to log into the same VM) the backtrace shows a different scalar SSE instruction, but the same end-of-4k-page SIGSEGV. Various other reproductions are possible (i.e. by using libgmalloc or MallocGuardEdges to alter page layouts.)

The root cause is in QEMU, introduced between 7.1 and 7.2 (so, UTM 4.1.2 works but later versions do not.) I have not yet set up a build environment to compile QEMU (or UTM), but I suspect the problem was introduced when fixing this bug. Very likely, these changes to trip #GP on mis-aligned vector reads are incorrectly tripping on scalar reads.

adespoton commented 7 months ago

In the meantime, my personal solution has been to move from UTM to mainline QEMU-system-X86_64 - I’m running 10.6 through 10.14 without the instability we’re experiencing under UTM.I’ve got a bit more work to do, but may update my macOS Shells project with preconfigured shells (bring your own QEMU and OS) - not quite as elegant as UTM, but functional.-Em On Apr 16, 2024, at 10:01 AM, arekkusu42 @.***> wrote: I spent a day investigating this, because it is blocking me from running many i386 apps on older macOS hosts. Here are three reproduction cases you can try in UTM now:

run any 32-bit GUI app, in Mavericks or later guest macOS You can use an app included with the OS, like System Preferences: arch -arch x86_64 "/Applications/System Preferences.app/Contents/MacOS/System Preferences" -> works normally, but arch -arch i386 "/Applications/System Preferences.app/Contents/MacOS/System Preferences" -> crashes in CG::Chunk::apply_transform with the same backtrace as described in #4990.

a minimal reproduction case tripping the CG crash by drawing an about box: mini.zip (this was compiled for i386 using Sierra and Xcode 9.2) -> crashes with same CG backtrace

a minimal reproduction case isolating the problem to root cause: page.zip This reads one float from the end of a 4k page, but it appears that QEMU's TCG SSE emulation reads an entire 128-bit vector, which spills into the next 4k page, which can SIGSEGV. -> this crashes in UTM 4.4.5, but it works in UTM 4.1.2. Also works on M3 under Rosetta2, and on a physical 2007 MBP running Mavericks. This is x86_64, so it demonstrates that the problem is not 32-bit specific; the crash only depends on page layout.

The El Capitan login crashes described in this issue are similar. If you look at the WindowServer crash logs (i.e. by letting a new UTM crash, and then using UTM 4.1.2 to log into the same VM) the backtrace shows a different scalar SSE instruction, but the same end-of-4k-page SIGSEGV. The root cause in in QEMU, introduced between 7.1 and 7.2 (so, UTM 4.1.2 works but later versions do not.) I have not yet set up a build environment to compile QEMU (or UTM), but I suspect the problem was introduced when fixing this bug. Very likely, these changes to trip #GP on mis-aligned vector reads are incorrectly tripping on scalar reads.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

arekkusu42 commented 7 months ago

I haven't tried standalone QEMU yet, but it is appealing if only to escape the sandbox and mount real volumes directly. Good to hear that you have many OSes running (but any luck with x86 Tiger??)

adespoton commented 7 months ago

I haven’t tried x86 Tiger and Leopard yet, but it might be possible with the new OpenCore config that lets Snow Leopard boot.  It’s on my list after I get 10.15 and 11 booting cleanly.Snow Leopard still won’t boot under UTM either, even with the OpenCore changes.-Em On Apr 16, 2024, at 7:25 PM, arekkusu42 @.***> wrote: I haven't tried standalone QEMU yet, but it is appealing if only to escape the sandbox and mount real volumes directly. Good to hear that you have many OSes running (but any luck with x86 Tiger??)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

xpitt commented 4 months ago

Adespoton: your remark "In the meantime, my personal solution has been to move from UTM to mainline QEMU-system-X86_64 - I’m running 10.6 through 10.14 without the instability we’re experiencing under UTM.I’ve got a bit more work to do, but may update my macOS Shells project with preconfigured shells (bring your own QEMU and OS) - not quite as elegant as UTM, but functional." is very interesting. How far have you progressed? os x 10.8 and 10.9 are my main focus. Thank you

adespoton commented 4 months ago

My QEMU configs are all happily functional for my own use; I just haven’t done the work yet to update my shell project on GitHub.-Em On Jul 16, 2024, at 7:24 AM, xpitt @.***> wrote: Adespoton: your remark "In the meantime, my personal solution has been to move from UTM to mainline QEMU-system-X86_64 - I’m running 10.6 through 10.14 without the instability we’re experiencing under UTM.I’ve got a bit more work to do, but may update my macOS Shells project with preconfigured shells (bring your own QEMU and OS) - not quite as elegant as UTM, but functional." is very interesting. How far have you progressed? os x 10.8 and 10.9 are my main focus. Thank you

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

xpitt commented 4 months ago

thank you very much, I'm looking forward to see them

arekkusu42 commented 1 month ago

This seems fixed with UTM v4.6.0 and QEMU 9.1.