Sudden issues with macOS on KVM/qemu

Until last week, my carefully set up instance of macOS 12.3 was running rather fine on kvm/qemu. All of a sudden, the VM kernel panics on start. Error message contains something about non-monotonic time.

Some googling led me to issues with the Time Stamp Counter (TSC), which would lead to such behavior. dmesg output contained:

[ 2.188035] tsc: Marking TSC unstable due to clocksource watchdog
[ 2.188039] TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'.

so I added that boot param. Now kvm issues during startup:

[24202.270045] kvm: SMP vm created on host with unstable TSC; guest TSC will not be reliable

and that’s pretty much it. Any idea how I could set this by fixing the time source for macOS?

… try disabling the watchdog (instead of what you did)
the boot parameter is: “nowatchdog”

… I do have this set in my /etc/default/grub -
don’t remember why anymore - it’s been too long ago that I set this
probably because 1) I don’t need it and 2) wanted to get rid of some useless log spam messages
and I do not have an actual, physical, watchdog hardware device

If that does not work you’d likely have to adapt your macOS settings
as it has been set up with that watchdog device
but now the (virtual) hardware that it sees
changed on it …

here’s an article related to this

I don’t use kvm/qemu, but I run Monterey 12.3 on Virtualbox. Using more than 1 CPU, I also had problems like boot loops and sudden crashes until I set this parameter for the Virtualbox machine:

VBoxManage setextradata "macos" "VBoxInternal/TM/TSCMode" "RealTSCOffset"

(Instead of “macos”, use your VM name.)

Hope this helps, maybe there is a similar setting for your virtualizer. I assume this is not a Manjaro issue, because I had the same problems on Linux Mint 20.3 (and could use the same fix).