So here's a thread to discuss UTM-related tips, tricks and issues

Moderators: Cat_7, Ronald P. Regensburg
I love UTM and I find it very good, but two things keep me from using this:Running Mac OS
Note: Mac OS currently will not fully boot on qemu-system-m68k
To boot Mac OS, you need a Macintosh Quadra 800 rom. This rom is found when placed in the pc-bios folder and named MacROM.bin, or can be selected by using the -bios command line option.
./qemu-system-m68k -boot d -L pc-bios \
-M q800 -m 64 \
-serial stdio \
-bios Quadra800.rom \
-cdrom 7.6.iso
The parameter ram (pram) can be saved and loaded from a file:
-drive file=pram.img,format=raw,if=mtd
Where pram.img is a file of exactly 256 bytes long. You can create such a file with e.g., "dd if=/dev/zero of=pram.img bs=256 count=1" or "qemu-img create -f raw pram.img 256"
That's the official statement. However, back in August, UTM was using MCAyland's Screamer fork of QEMU-PPC, which is definitely NOT the stable build (as it's incompatible with snapshotting at the moment).
It will not be long now before support for those is in main repository.I thought they might opt to do the same type of fork hopping for 7.x and A/UX emulation of the m68k core.
Yeah, I think it was me who pointed the dev to the screamer fork before, in early 2020 (unless he has heard about it before I came in). But in general, the direction UTM is headed now (especially with Apple Silicon transition) is more towards newer, modern virtual machines than retro machines. He has been doing work to get virgl 3D running (works only for linux vms), by porting another patch from akihikodaki's GitHub repo.adespoton wrote: ↑Fri Oct 29, 2021 10:20 pmThat's the official statement. However, back in August, UTM was using MCAyland's Screamer fork of QEMU-PPC, which is definitely NOT the stable build (as it's incompatible with snapshotting at the moment).
Since they jumped on Screamer, I thought they might opt to do the same type of fork hopping for 7.x and A/UX emulation of the m68k core.
If you only want one, Tiger gives you Classic as well, so most software from the original Mac OS through 10.4 should work. If instead you want to run OS X PPC and 32-bit Intel software, 10.6 is the right choice. 10.5 is more for actual hardware that needs the more recent architectures but is PPC (G5 and high end G4 Macs).Bruninho wrote: ↑Sat Nov 13, 2021 11:59 pm So, what’s the best OS X version to run in UTM? I have been considering the following and want to choose just one, for a better focus:
- OS X Tiger 10.4 (PPC)
- OS X Leopard 10.5 (PPC)
- OS X Snow Leopard (Intel)
Sorbet Leopard (custom PPC Leopard version) from macRumors forums is good, but needs RAM and more than 1gb RAM means that I’ll not have sound![]()
I am leaning towards Tiger, but I like Leopards theme more. Leopard needs optimization (and RAM) though. Tiger is speedy, but needs a few tweaks because I can’t stand the brushed metal Finder theme…
This is where Snow Leopard enters the chat even though it is for Intel.
Yeah, its an interesting take. Tiger IMHO is possibly the "turning point" for OS X history, being the first ever OS X with an Intel build (10.4.4), even though in reality Leopard is the real turning point, but given the conditions I listed above, Tiger is the closest I can get to it. Plus with some themes I can reduce the influence of brushed metal theme (I must confess that I like the pinstripe theme). I think I will have to boot both Tiger (PPC) and Snow Leopard (Intel) and choose one later, based on performance. Here's my take:adespoton wrote: ↑Sun Nov 14, 2021 12:03 am If you only want one, Tiger gives you Classic as well, so most software from the original Mac OS through 10.4 should work. If instead you want to run OS X PPC and 32-bit Intel software, 10.6 is the right choice. 10.5 is more for actual hardware that needs the more recent architectures but is PPC (G5 and high end G4 Macs).
The only useful audio for OS X PPC is Screamer. Unfortunately, there are still some FPU math issues that seem to cause stuttering on the audio; it's WAY better than it used to be, but still not fixed. It doesn't appear to be a CPU cycles issue, but something in the emulation itself and how audio interacts with the FPU. There's a build of QEMU-PPC on here that has modified FPU emulation that helps this significantly. However, doing that makes the FPU results unreliable (for spreadsheets and the like) and Screamer still has some compatibility issues with the main QEMU-PPC branch that are being worked out.Bruninho wrote: ↑Sun Nov 14, 2021 4:32 am
EDIT: Couldn't install Snow Leopard, so I went for Tiger.
EDIT 2: I basically gave up on both. Sound stutters A LOT on Tiger and Leopard PPC, with all the sound types I can use (AC97, USB-Audio, Screamer). I went to cornica.org and I played some movie trailers. I had even downloaded one and played it on QuickTime to make sure it was not connection speed. Same output: When people talks in video, sound is clear, but when there is background music, the stuttering is unbearable. Well, I guess that I will have to wait a bit longer until it is improved (or if it will be). Personally I don't see much difference between Tiger, Leopard and current modern MacOS, so probably there is not much point in emulating them, except for historical purposes. I'll just focus on my MacOS 9.2.1 install which has been working flawlessly. Thanks for the tips, though.
Thanks Cat_7; I've got configurations using our builds that all run just fine. It's when I try running those in UTM with the same custom flags that things start to break. Mark's comment about the USB hub is the same conclusion I came to -- UTM uses -nodefaults but then explicitly adds in a USB hub and a bunch of USB routing. The mouse and keyboard appear to be grabbed by the first set of (non-working) bindings every time.Cat_7 wrote: ↑Thu Jan 20, 2022 6:34 am Our builds have their issues with usb and adb as well
Mac OS 9.0.4 wil not boot with mac99,via=pmu (which defaults to usb bus with usb-mouse and usb-kbd)
It will also have a problem with mac99 (which defaults to adb with adb-mouse and adb-kbb) and additional usb bus: -usb -device usb-mouse -device kbd (here only the device mentioned first on the command line will work
When adding only -usb -device usb-mouse you can see it fall back to the adb mouse until you use e.g. usb prober from the DDK to get the mouse going.
Same issue with 10.0 and 10.1. Mac OS 9.1 and particularly 9.2 do better.
Only recently I took this up with Mark again when I traced usb traffic on the bus, and he replied:
"It looks like adding the extra USB arguments to the command line is adding additional
input devices and also a USB hub. My guess is that QEMU/OpenBIOS end up choosing the
wrong input device in these cases so the chosen device doesn't match the one that
gets connected to QEMU's host keyboard/mouse handlers."
Too bad UTM does not run without Metal support, otherwise I could try in one of my VMs.
I assume UTM defaults to the safe mac99 option, as only 10.5 requires via=pmu. And so you run into the problem I described above when adding a usb bus and devices
With which Mac OS versions do you have issues?
I believe UTM allows you to see the qemu command line it uses? Can you provide two command lines? One with mac99 and and one mac99,via=pmu?
Best,
Cat_7
Code: Select all
Running: -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:127.0.0.1:4000,server,nowait -nodefaults -vga none -spice "unix=on,addr=/Users/ludgates/Library/Group Containers/WDNLXAD4W8.com.utmapp.UTM/4D6EFE89-3FF4-4110-8E05-7FE7A930FE6D.spice,disable-ticketing=on,image-compression=off,playback-compression=off,streaming-video=off,gl=off" -device VGA -smp cpus=1,sockets=1,cores=1,threads=1 -machine mac99,via=cuda -accel tcg,tb-size=64 -boot menu=on -m 256 -audiodev coreaudio,id=audio0 -name "OS X Server 10.0" -usb -device usb-tablet,bus=usb-bus.0 -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 -device ich9-usb-ehci1,id=usb-controller-0 -device ich9-usb-uhci1,masterbus=usb-controller-0.0,firstport=0,multifunction=on -device ich9-usb-uhci2,masterbus=usb-controller-0.0,firstport=2,multifunction=on -device ich9-usb-uhci3,masterbus=usb-controller-0.0,firstport=4,multifunction=on -chardev spicevmc,name=usbredir,id=usbredirchardev0 -device usb-redir,chardev=usbredirchardev0,id=usbredirdev0,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=usb-controller-0.0 -device ide-hd,bus=ide.0,drive=drive0,bootindex=0 -drive "if=none,media=disk,id=drive0,file=~/Library/Containers/com.utmapp.UTM/Data/Documents/OS X Server 10.0.utm/Images/OS X 10.0 Server.qcow2,cache=writethrough" -device ide-cd,bus=ide.1,drive=drive1,bootindex=1 -drive if=none,media=cdrom,id=drive1 -device sungem,mac=C6:F8:CC:03:A4:E2,netdev=net0 -netdev user,id=net0 -uuid 4D6EFE89-3FF4-4110-8E05-7FE7A930FE6D -rtc base=localtime -g 1280x720x32 -usbdevice keyboard
Yeah; unfortunately the USB bits are hard-coded into the UTM system. I've raised a bug about it.
When using UTM, you can do manual mouse and keyboard capture by pressing a hot key combo -- by default, it's control-option. In order for capture to result in a movable mouse, sometimes you need to press that combination once to toggle on, once off, once on, once off, once on, in order to actually get a movable mouse in the guest.When you say: "takes a few tries to capture it correctly -- possibly it's cycling through the different possible input/output combinations?" you mean you have to wiggle the mouse a bit to get it to continue to boot?
I figured due to -nodefaults I shouldn't assume any default actions, and there's a trailing comma after mac99, so I wanted to ensure it wasn't attempting to feed a null or similar. Essentially, it's my way of ensuring that even with the custom build and config, I'm certain we're using CUDA because it will either work or QEMU will fail to load with a complaint about the option."-M mac99," -- so I've explicitly added via=cuda so qemu is happy."
mac99 already defaults to via=cuda, so is that needed?
That's the odd thing here; probably due to the baked-in USB setup, swapping the custom flag values at the end, or leaving the mouse entry off altogether, still results in the same mouse behaviour and no keyboard."- this results in a functional mouse but never results in a functional keyboard".
Yes that is explained above. If you reverse keyboard and mouse entries, you get a kbd, but no mouse.
Me too. I'm guessing the tablet being on the bus but also a mouse being on the bus is what's enabling mouse input, but the keyboard input is being bound to the wrong device. I should see if I can force in a qemu debug flag so I can dump the device tree to see what qemu thinks is being presented. Unfortunately, UTM doesn't seem to provide access to the monitor (or the ability to properly eject floppy disk images, but that's a different issue).I'm surprised it boots 9.0 and 9.1 at all with the screamer enabled.
A tablet driver only became available somewhere in the 10.2 versions, or perhaps in 10.3 (but there now also is one for 9.x, but obviously only functional for those guest that have no usb issues)
It's worse than just attempting to cater for all Mac OS PPC guests... the same config is also used for all UTM hosts: that is, it's set up the same for macOS x86, macOS M1, iOS and iPadOS.It looks like UTM is trying to cater for all Mac OS PPC guests, but that is not possible with either via=cuda or via=pmu with the default consequences of having an usb bus or not.
For 9.0 and 10.0, 10.1, you could try with mac99,via=cuda,usb=off
Best,
Cat_7
So possibly UTM is binding the keyboard to one of these, and QEMU is rejecting it?C>> annot manage 'EHCI USB controller' PCI device type 'usb':
>> 8086 293a (c 3 20)
>> Cannot manage 'UHCI USB controller' PCI device type 'usb':
>> 8086 2934 (c 3 0)
>> Cannot manage 'UHCI USB controller' PCI device type 'usb':
>> 8086 2935 (c 3 0)
>> Cannot manage 'UHCI USB controller' PCI device type 'usb':
>> 8086 2936 (c 3 0)
I believe this just means these devices are not in the openbios pci devices list.C>> annot manage 'EHCI USB controller' PCI device type 'usb':
>> 8086 293a (c 3 20)
>> Cannot manage 'UHCI USB controller' PCI device type 'usb':
>> 8086 2934 (c 3 0)
>> Cannot manage 'UHCI USB controller' PCI device type 'usb':
>> 8086 2935 (c 3 0)
>> Cannot manage 'UHCI USB controller' PCI device type 'usb':
>> 8086 2936 (c 3 0)
I can imagine it becoming a nightmare to support various qemu versions separately, but part of the problem is in Qemu.It's worse than just attempting to cater for all Mac OS PPC guests... the same config is also used for all UTM hosts: that is, it's set up the same for macOS x86, macOS M1, iOS and iPadOS.
Is this grab option the same as default Qemu Ctrl-Alt-G?When using UTM, you can do manual mouse and keyboard capture by pressing a hot key combo -- by default, it's control-option. In order for capture to result in a movable mouse, sometimes you need to press that combination once to toggle on, once off, once on, once off, once on, in order to actually get a movable mouse in the guest.
Interestingly, the mouse works fine with no capture on 10.4 and above. On 10.3, the mouse vanishes until capture is cycled on and off, and then is captured incorrectly, resulting in two mouse pointers in very different locations at different ramping speeds; capturing again fixes this. On 10.2 and below, the mouse needs to be captured for mouse and keyboard to work at all. This is all the case no matter which via is selected.
It seems subtly different; it doesn't behave quite the same way, but the general concept seems the same. That could be down to the USB device tree that's pre-loaded though. UTM lets you choose between control-option and command-option. Neither really seems like a good choice, as you lose those modifier key combos; there's a ticket in about that.Cat_7 wrote: ↑Fri Jan 21, 2022 7:13 pmIs this grab option the same as default Qemu Ctrl-Alt-G?When using UTM, you can do manual mouse and keyboard capture by pressing a hot key combo -- by default, it's control-option. In order for capture to result in a movable mouse, sometimes you need to press that combination once to toggle on, once off, once on, once off, once on, in order to actually get a movable mouse in the guest.
Interestingly, the mouse works fine with no capture on 10.4 and above. On 10.3, the mouse vanishes until capture is cycled on and off, and then is captured incorrectly, resulting in two mouse pointers in very different locations at different ramping speeds; capturing again fixes this. On 10.2 and below, the mouse needs to be captured for mouse and keyboard to work at all. This is all the case no matter which via is selected.
Is UTM running the Spice client to access the VM?Mouse modes
Spice supports two mouse modes: server and client. The mode can be changed dynamically and is negotiated between the client and the server.
Server mouse
When a user clicks inside the Spice client window, the client mouse is captured and set invisible. In this mode, the server controls the mouse position on display. However, it might be problematic on WAN or on a loaded server, where mouse cursor might have some latency or non-responsiveness.
Client mouse
Not captured and is used as the effective pointing device. To enable client mouse, the VDI host application must register an absolute pointing device (e.g. USB tablet in QEMU). This mode is appropriate for WAN or for a loaded server, since cursor has smooth motion and responsiveness. However, the cursor might lose synchronization (position and shape) for a while.
UTM is using the SPICE server and client framework to manage a lot of the hardware, irrespective of what features are available in the guest environment.