Here is a short guide on how to build QEMU to run Mac OS 9 with working audio. These instructions work for MacOS High Sierra as the host OS, although with some tweaking they may run under Linux/Windows. You should be comfortable compiling software from source before attempting.
Adapted from instructions from Cat_7
You may need to install XCode and/or the XCode command line tools. If you do not have them, then this process may prompt you to install them (MacOS will do that).
Start by cloning the fork of QEMU with experimental audio support:
$ git clone -b screamer https://github.com/mcayland/qemu qemu-screamer
$ cd qemu-screamer
Then configure the source to use MacOS CoreAudio. I have also enabled LibUSB, KVM, HyperVirtualization Framework, and the Cocoa UI. In this case I am only compiling the emulator for PPC (32-bit).
$ ./configure --target-list="ppc-softmmu" --audio-drv-list="coreaudio" --enable-libusb --enable-kvm --enable-hvf --enable-cocoa
Then compile:
$ make
$ cd ..
This will create a binary in qemu-screamer/ppc-softmmu/qemu-system-ppc
that we can use.
We will need to have a hard drive image for our emulated system. I made mine 5 GB in size, which is plenty for Mac OS 9.
In our qemu-screamer
directory, we will use qemu-img
to create the disk image.
$ ./qemu-screamer/qemu-img create -f qcow2 macos92.img 5G
If you have an ISO of a Mac OS 9 install disc (a Mac OS X classic install disc won't work), then you can use that in the next step. If you don't have one, you can download one from Mac OS 9 Lives: Mac OS 9.2.2 Universal Install.
This won't install quite like Mac OS 9 did, but instead use Apple System Restore to restore an image onto the hard drive.
Start up QEMU with the following options:
$ ./qemu-screamer/ppc-softmmu/qemu-system-ppc -L qemu-screamer/pc-bios -cpu "g4" -M mac99,via=pmu -m 512 -hda macos92.img -cdrom "~/Downloads/Mac OS 9.2.2 Universal Install.iso" -boot d -g 1024x768x32
A breakdown of that command:
-L qemu-screamer/pc-bios
sets the BIOS. May not actually need this.-cpu "g4"
emulate a G4 CPU-M mac99,via=pmu
will define the Mac model and enable USB support-m 512
use 512 MB of RAM, could go lower probably-hda macos92.img
use our generated disk image for the hard drive-cdrom "~/Downloads/Mac OS 9.2.2 Universal Install.iso"
use the ISO for the cdrom-boot d
boot from the disk drive-g 1024x768x32
default to 1024x768 resolution and 32 bit colour
Once it starts up, you will be able to run Disk Initializer to format your hard drive image. Go ahead and do that, using Mac OS HFS Extended as the file system. One partition is good.
After initializing the disk, run Apple System Restore with the Mac OS 9 lives disk image as the source and your disk as the destination. This will take a minute to restore. Once done, shut down the emulated system.
Similar to the last command, except we start up from the disk we created.
$ ./qemu-screamer/ppc-softmmu/qemu-system-ppc -L qemu-screamer/pc-bios -cpu "g4" -M mac99,via=pmu -m 512 -hda macos92.img -boot c -g 1024x768x32
It should boot up and you will have a running Mac OS 9 with audio!
When the emulator is shut down, just make a copy of the hard disk image to create a backup. If something breaks your Mac OS 9 installation then you can restore the file.
You can dynamically attach CDs/DVDs to the emulated system by going to the menu bar on your host system for the QEMU application and selecting the option to attach to the CD IDE drive. It will open a dialog letting you select your ISO.
With some minor tweaks I got Mac OS 9 also working on Linux including sound support.
After cloning the QEMU fork the necessary build dependencies have to be installed as described here: https://wiki.qemu.org/Hosts/Linux
Including libsdl2-dev for graphics and sound.
The command for configuring QEMU looks as follows. The only things that had to be changed were the audio driver, here sdl, and the UI Library from cocoa to gtk.
Don't forget compile it with
make
.All other steps for installing and running Mac OS 9 remain the same.