OS X 10.10.3 Yosemite or later; a 2010 or later Mac (i.e. A CPU that supports EPT: sysctl kern.hvsupport = 1) Installation. If you have homebrew, then simply: $ brew update $ brew install -HEAD xhyve The -HEAD in the brew command ensures that you always get the latest changes, even if the homebrew database is not yet updated. Mac OS 10.4 (PowerPC) in QEMU. Now that Apple has ended supporting PowerPC applications having Mac OS 10.4 around can be a life saver. With it you can continue to use your favorite PowerPC applications. Suggested command-line: qemu-system-ppc -hda image file -boot c -netdev user,id=mynet0 -device rtl8139,netdev=mynet0.
Blog 2020/5/7
<- previous |index |next ->
Here are some notes on how I set up an installation of OS X Tiger (10.4)on an emulated PowerPC G4 using QEMU,on a modern x86_64 Mac.
This setup was performed using QEMU 5.0.0 (obtained via brew install qemu
).
Note: at some point during this process -cdrom /dev/cdrom
seems to have stopped working, but -cdrom /dev/disk2
works.
In this step we will format the disk and perform the initial OS X installation.
Download a copy of the2Z691-5305-A OS X Tiger installation DVDand burn it to a physical DVD.
Note: for some reason qemu does not seem to be able to boot .iso
files of the OS X installation DVD (using -cdrom tiger.iso
),but if you burn that .iso
to a physical DVD and then use -cdrom /dev/disk2
, it works.
Boot the DVD to verify it works:
If you see the grey Apple logo, the DVD is working correctly with QEMU:
Quit QEMU and create a 127GB QEMU disk:
Boot the install DVD with the disk attached and being the installation. QEMU will exit when the installer reboots.
When the installer reaches the disk selection screen, there will be no disks to choose from, because the disk has not been partitioned yet:
Start up Disk Utility:
'Erase' the disk to partition and format it:
![For For](http://i.imgur.com/1qoXixE.png)
Quit Disk Utility and the installer should now see the newly formatted partition:
The install will take quite some time (over an hour). When it completes, it will reboot, which will cause QEMU to exit (due to the -no-reboot
flag).
At this point you may (physically) eject the installation DVD (from your host Mac).
Mark the disk as read-only to prevent any accidental writes to it (which would cause any snapshots based on this disk to become corrupt):
Step 2: User account creation, system updatesIn this step we will create a user account and install all of the system updates.
Create a snapshot of the disk (think of this as forking the hard drive):
The system updates can either be installed using the Software Update utility (iteratively repeated across many reboots),or you can download and install them manually.
The manual route is quicker because some of the updates are bundled, and you don't have to wait on Software Update to detect which updates have / haven't been installed yet.
To install the updates manually,download (on your host Mac) item #29 (Tiger_Updates.dmg_.zip)from the 'Mac OS X for PPC' pageof macintoshgarden.org.
Unzip that file and convert the dmg to a DVD image:
We can now use tiger-updates.cdr
as a virtual DVD with QEMU.
Boot the G4 and create a user account:
Note: if you plan on using Software Update rather than tiger-updates.cdr, you man omit the -cdrom tiger-updates.cdr
line from the above command.
Note: this boot may take several minutes to get started.
This install was set up with user macuser
and password macuser
:
This installation was set up with the Central timezone:
Disable the screen saver and power-saving features:
![Qemu Qemu](http://www.wikihow.com/images/6/6d/Install-macOS-on-a-Windows-PC-Step-20-Version-2.jpg)
Open up System Preferences and:
- Display & Screen Saver -> Screensaver -> Start screen saver -> Never
- Energy Saver
- Put the computer to sleep when it is inactive for -> Never
- Put the display to sleep when the computer is inactive for -> Never
If you did not use Software Update, open up the Tiger_Updates 'DVD' and install all of the updates:
If you go with the updates DVD route, make sure you run Software Update at the end just to be sure you've covered everything.
Mark the snapshot read-only to prevent accidental writes to it:
Step 3: Web browser, video player, text editor CachedIn this step we will install TenFourFox, VLC and TextWrangler.
Create a snapshot of the disk:
TenFourFox is a fork of the Firefox web browser which is currently supported on Tiger/PPC.Their website links to the latest version,FPR22.
The latest version of VLCfor Tiger/PPC is 0.9.10,which is still available from their downloads page.
The latest version of TextWranglerfor Tiger/PPC is 3.1,available via Bare Bonesor macintoshgarden.org.
Strangely, no combination of using Disk Utility and hdiutil to create .dmg
or .cdr
images of TenFourFox.app
seemed to work with Tiger:
Note: in retrospect, perhaps this was an APFS vs. HFS+ issue?
I resorted to burning TenFourFox, VLC, and TextWrangler to a physical DVD and passing it through to QEMU.
Note: even burning to a physical CD-ROM didn't work -- it had to be a DVD.
Drag the applications into /Applications
.
Shutdown the G4 and mark the disk read-only:
Step 4: Xcode, TigerbrewIn this step we will set up a development environment for building modern Unix software.
Create a snapshot of the disk:
The latest version of Xcode Tools for Tiger/PPC is 2.5,which is still available via Apple (search for 'xcode 2.5' at https://developer.apple.com/download/more/, requires login),or via macintoshgarden.orgfrom their Xcode page.
Again, I had to burn this to a physical DVD in order to use it with QEMU.
Boot the G4 and install the Xcode Tools:
Tigerbrewis a fork of Homebrewfor PowerPC Macs running Tiger or Leopard.
Open up a terminal on the emulated G4 and use the following commands to install Tigerbrew:
Also, change Terminal.app to spawn a 'login' bash shell:
- Terminal -> Preferences -> Execute this command ->
/bin/bash -l
Don't forget to mark the disk image read-only:
Using these QEMU hard drive imagesAt this point we've created a series of four chained hard drive images:
We can squash these images into a single, combined, stand-alone hard drive image:
We can then boot using that combined image directly, without the use of any snapshots.This is analogous to having a real Mac with a physical hard drive:
Or, we could treat combined.qcow2
as a 'golden master'and create snapshots based off of it, perhaps to try out some experimental tigerbrew packages:
Perhaps in experiment-1.qcow2
we try out gcc-7
, and in experiment-2.qcow2
we try out llvm
, etc.
Each of these snapshots can be used with the above command line as the -hda
argument:
qemu-system-ppc ... -hda experiment-2.qcow2
We could even create further branches off of e.g. experiment-2.qcow2
:
Perhaps we decide that experiment-2B.qcow2
was the keeper and the rest can be gotten rid of?
combined.qcow2
now contains the changes from experiment-2.qcow2
and experiment-2B.qcow2
.
Thus far we've been branching off of the 'tip',but we could just as easily branch off several points in the snapshot tree.For example, if we hadn't merged the images into combined.qcow2
,we could make a 'daily driver' snapshot for web browsing based off of 3-browser.qcow2
,and a 'dev box' for doing development work based off of 4-tigerbrew.qcow2
:
Let's say we accidentally hosed our dev box with a careless rm -rf /
. Starting over with a new dev box is trivial:
Etc :)
Resources:(Updated Dec 11, 2018)
I recently got an urge to revisit old computer media from the late 90s and early 2000s. Growing up around that time, I remember reading a lot of MacAddict and MacWorld to learn what I could do with a Mac. Building websites, graphic design, hacking the appearance of the UI, all these were explained in the pages of magazines.
These magazines are freely available on the Internet Archive, including their cover discs. I was curious to see what applications were around back then — what about emulating Classic Mac OS to see?
Creative variations in UI design
My first instinct was to reach for VirtualBox, but that is a no go as I need to emulate a Motorola 68K or IBM PowerPC architecture. I recalled that QEMU could emulate other architectures, surely someone has already tried to emulate Mac OS 9.
Yes, many people have already written about emulating Mac OS 9, but only recently (2018) did experimental audio support come out for QEMU. Here is a short guide on how I got it running with MacOS High Sierra as the Host OS.
Note that while QEMU is available in Homebrew, it does not have the experimental audio support (yet).
Internet ArchiveMagazines can be browsed right on the archive site, or downloaded as archives or PDFs (or a torrent containing all formats). Cover discs can be downloaded directly as ISO files or a torrent for the ISO. Don’t worry about seedless torrents; these ones are backed with web seeding.
RequirementsDevTools: I already have homebrew and XCode installed; because of this I was not prompted for missing command line tools. If you don’t have them, you might be prompted (by MacOS) to install them.
Hardware: I am not sure about hardware requirements, as most modern Macs will probably eclipse the power needed to run the guest OS. However if you have a low-power CPU (e.g. MacBook) then there may be some struggling.
Windows/Linux: These instructions should probably work there too, although you will probably have to substitute something else for coreaudio
in the configuration step.
These instructions are adapted from Cat_7 from the Emaculation forums
I started by creating a directory for all this emulation stuff.
Next clone the fork of QEMU with experimental audio support:
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).
Next use make to compile QEMU. (If you have more processor cores, use make -j 4
or however many cores to speed up the process.)
This will create a binary in qemu-screamer/ppc-softmmu/qemu-system-ppc
that we can use.
Optionally you can install these binaries to /usr/local/bin
or wherever. I kept them in the ~/emulation
directory to separate them from the Homebrew QEMU binaries.
We will need to have a hard drive image for our guest OS. I made mine 5 GB in size, which would be typical at the time for Mac OS 9.
In our qemu-screamer
directory, we will use qemu-img
to create the disk image.
If you have an ISO of a Mac OS 9 install disc (a Mac OS X classic install disc will not work — it must be bootable), 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.
Install Mac OS 9The Mac OS 9 Lives method won’t install quite like an original Mac OS 9 installer would, but instead will use Apple System Restore to restore an image onto the hard drive.
Qemu Os XStart up QEMU with the following options:
A breakdown of that command:
-L qemu-screamer/pc-bios
sets the BIOS-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-device usb-kbd
enable USB keyboard emulation/support-device usb-mouse
enable USB mouse input, will improve cursor tracking somewhat
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 (Special Menu -> Shut Down).
Boot Mac OS 9Similar to the last command, except we start up from the disk we created.
It should boot up and you will have a running Mac OS 9 with audio! I recommend saving this command as a shell script in your ~/emulation
directory.
Boots much faster than it did in 2001
Tips![Qemu Qemu](https://1.bp.blogspot.com/-750QM0sf4gc/Xn41YKt3CII/AAAAAAAAMXI/B5TNZwepXIgHbkJUfuZhTBlGqppVVm7rACLcBGAsYHQ/s1600/Screenshot%2Bfrom%2B2020-03-27%2B19-44-43.png)
Here are some notes on how I set up an installation of OS X Tiger (10.4)on an emulated PowerPC G4 using QEMU,on a modern x86_64 Mac.
This setup was performed using QEMU 5.0.0 (obtained via brew install qemu
).
Note: at some point during this process -cdrom /dev/cdrom
seems to have stopped working, but -cdrom /dev/disk2
works.
In this step we will format the disk and perform the initial OS X installation.
Download a copy of the2Z691-5305-A OS X Tiger installation DVDand burn it to a physical DVD.
Note: for some reason qemu does not seem to be able to boot .iso
files of the OS X installation DVD (using -cdrom tiger.iso
),but if you burn that .iso
to a physical DVD and then use -cdrom /dev/disk2
, it works.
Boot the DVD to verify it works:
If you see the grey Apple logo, the DVD is working correctly with QEMU:
Quit QEMU and create a 127GB QEMU disk:
Boot the install DVD with the disk attached and being the installation. QEMU will exit when the installer reboots.
When the installer reaches the disk selection screen, there will be no disks to choose from, because the disk has not been partitioned yet:
Start up Disk Utility:
'Erase' the disk to partition and format it:
Quit Disk Utility and the installer should now see the newly formatted partition:
The install will take quite some time (over an hour). When it completes, it will reboot, which will cause QEMU to exit (due to the -no-reboot
flag).
At this point you may (physically) eject the installation DVD (from your host Mac).
Mark the disk as read-only to prevent any accidental writes to it (which would cause any snapshots based on this disk to become corrupt):
Step 2: User account creation, system updatesIn this step we will create a user account and install all of the system updates.
Create a snapshot of the disk (think of this as forking the hard drive):
The system updates can either be installed using the Software Update utility (iteratively repeated across many reboots),or you can download and install them manually.
The manual route is quicker because some of the updates are bundled, and you don't have to wait on Software Update to detect which updates have / haven't been installed yet.
To install the updates manually,download (on your host Mac) item #29 (Tiger_Updates.dmg_.zip)from the 'Mac OS X for PPC' pageof macintoshgarden.org.
Unzip that file and convert the dmg to a DVD image:
We can now use tiger-updates.cdr
as a virtual DVD with QEMU.
Boot the G4 and create a user account:
Note: if you plan on using Software Update rather than tiger-updates.cdr, you man omit the -cdrom tiger-updates.cdr
line from the above command.
Note: this boot may take several minutes to get started.
This install was set up with user macuser
and password macuser
:
This installation was set up with the Central timezone:
Disable the screen saver and power-saving features:
Open up System Preferences and:
- Display & Screen Saver -> Screensaver -> Start screen saver -> Never
- Energy Saver
- Put the computer to sleep when it is inactive for -> Never
- Put the display to sleep when the computer is inactive for -> Never
If you did not use Software Update, open up the Tiger_Updates 'DVD' and install all of the updates:
If you go with the updates DVD route, make sure you run Software Update at the end just to be sure you've covered everything.
Mark the snapshot read-only to prevent accidental writes to it:
Step 3: Web browser, video player, text editor CachedIn this step we will install TenFourFox, VLC and TextWrangler.
Create a snapshot of the disk:
TenFourFox is a fork of the Firefox web browser which is currently supported on Tiger/PPC.Their website links to the latest version,FPR22.
The latest version of VLCfor Tiger/PPC is 0.9.10,which is still available from their downloads page.
The latest version of TextWranglerfor Tiger/PPC is 3.1,available via Bare Bonesor macintoshgarden.org.
Strangely, no combination of using Disk Utility and hdiutil to create .dmg
or .cdr
images of TenFourFox.app
seemed to work with Tiger:
Note: in retrospect, perhaps this was an APFS vs. HFS+ issue?
I resorted to burning TenFourFox, VLC, and TextWrangler to a physical DVD and passing it through to QEMU.
Note: even burning to a physical CD-ROM didn't work -- it had to be a DVD.
Drag the applications into /Applications
.
Shutdown the G4 and mark the disk read-only:
Step 4: Xcode, TigerbrewIn this step we will set up a development environment for building modern Unix software.
Create a snapshot of the disk:
The latest version of Xcode Tools for Tiger/PPC is 2.5,which is still available via Apple (search for 'xcode 2.5' at https://developer.apple.com/download/more/, requires login),or via macintoshgarden.orgfrom their Xcode page.
Again, I had to burn this to a physical DVD in order to use it with QEMU.
Boot the G4 and install the Xcode Tools:
Tigerbrewis a fork of Homebrewfor PowerPC Macs running Tiger or Leopard.
Open up a terminal on the emulated G4 and use the following commands to install Tigerbrew:
Also, change Terminal.app to spawn a 'login' bash shell:
- Terminal -> Preferences -> Execute this command ->
/bin/bash -l
Don't forget to mark the disk image read-only:
Using these QEMU hard drive imagesAt this point we've created a series of four chained hard drive images:
We can squash these images into a single, combined, stand-alone hard drive image:
We can then boot using that combined image directly, without the use of any snapshots.This is analogous to having a real Mac with a physical hard drive:
Or, we could treat combined.qcow2
as a 'golden master'and create snapshots based off of it, perhaps to try out some experimental tigerbrew packages:
Perhaps in experiment-1.qcow2
we try out gcc-7
, and in experiment-2.qcow2
we try out llvm
, etc.
Each of these snapshots can be used with the above command line as the -hda
argument:
qemu-system-ppc ... -hda experiment-2.qcow2
We could even create further branches off of e.g. experiment-2.qcow2
:
Perhaps we decide that experiment-2B.qcow2
was the keeper and the rest can be gotten rid of?
combined.qcow2
now contains the changes from experiment-2.qcow2
and experiment-2B.qcow2
.
Thus far we've been branching off of the 'tip',but we could just as easily branch off several points in the snapshot tree.For example, if we hadn't merged the images into combined.qcow2
,we could make a 'daily driver' snapshot for web browsing based off of 3-browser.qcow2
,and a 'dev box' for doing development work based off of 4-tigerbrew.qcow2
:
Let's say we accidentally hosed our dev box with a careless rm -rf /
. Starting over with a new dev box is trivial:
Etc :)
Resources:(Updated Dec 11, 2018)
I recently got an urge to revisit old computer media from the late 90s and early 2000s. Growing up around that time, I remember reading a lot of MacAddict and MacWorld to learn what I could do with a Mac. Building websites, graphic design, hacking the appearance of the UI, all these were explained in the pages of magazines.
These magazines are freely available on the Internet Archive, including their cover discs. I was curious to see what applications were around back then — what about emulating Classic Mac OS to see?
Creative variations in UI design
My first instinct was to reach for VirtualBox, but that is a no go as I need to emulate a Motorola 68K or IBM PowerPC architecture. I recalled that QEMU could emulate other architectures, surely someone has already tried to emulate Mac OS 9.
Yes, many people have already written about emulating Mac OS 9, but only recently (2018) did experimental audio support come out for QEMU. Here is a short guide on how I got it running with MacOS High Sierra as the Host OS.
Note that while QEMU is available in Homebrew, it does not have the experimental audio support (yet).
Internet ArchiveMagazines can be browsed right on the archive site, or downloaded as archives or PDFs (or a torrent containing all formats). Cover discs can be downloaded directly as ISO files or a torrent for the ISO. Don’t worry about seedless torrents; these ones are backed with web seeding.
RequirementsDevTools: I already have homebrew and XCode installed; because of this I was not prompted for missing command line tools. If you don’t have them, you might be prompted (by MacOS) to install them.
Hardware: I am not sure about hardware requirements, as most modern Macs will probably eclipse the power needed to run the guest OS. However if you have a low-power CPU (e.g. MacBook) then there may be some struggling.
Windows/Linux: These instructions should probably work there too, although you will probably have to substitute something else for coreaudio
in the configuration step.
These instructions are adapted from Cat_7 from the Emaculation forums
I started by creating a directory for all this emulation stuff.
Next clone the fork of QEMU with experimental audio support:
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).
Next use make to compile QEMU. (If you have more processor cores, use make -j 4
or however many cores to speed up the process.)
This will create a binary in qemu-screamer/ppc-softmmu/qemu-system-ppc
that we can use.
Optionally you can install these binaries to /usr/local/bin
or wherever. I kept them in the ~/emulation
directory to separate them from the Homebrew QEMU binaries.
We will need to have a hard drive image for our guest OS. I made mine 5 GB in size, which would be typical at the time for Mac OS 9.
In our qemu-screamer
directory, we will use qemu-img
to create the disk image.
If you have an ISO of a Mac OS 9 install disc (a Mac OS X classic install disc will not work — it must be bootable), 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.
Install Mac OS 9The Mac OS 9 Lives method won’t install quite like an original Mac OS 9 installer would, but instead will use Apple System Restore to restore an image onto the hard drive.
Qemu Os XStart up QEMU with the following options:
A breakdown of that command:
-L qemu-screamer/pc-bios
sets the BIOS-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-device usb-kbd
enable USB keyboard emulation/support-device usb-mouse
enable USB mouse input, will improve cursor tracking somewhat
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 (Special Menu -> Shut Down).
Boot Mac OS 9Similar to the last command, except we start up from the disk we created.
It should boot up and you will have a running Mac OS 9 with audio! I recommend saving this command as a shell script in your ~/emulation
directory.
Boots much faster than it did in 2001
TipsBackups: 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.
Discs: 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.
Compatibility: This is emulating Mac OS 9.2.2, released in late 2001. The emulated hardware is more or less of the same vintage, meaning software from the mid-to-late 90s will have some trouble running (as I found). The most common problem is not being able to drop down to 256 colours, although I later found a solution (link below). I have not tried emulating Mac OS 8/8.5; a cursory reading of forums has mentioned that doesn’t work yet.
Easter Egg in Finder
256 ColoursTo support 256 colours you will need to add a bios driver. See the EMaculation forums for instructions; it involves replacing a file in the pc-bios
directory with an older version that still supports 256 colours.
I removed the extra arguments from configure
as by default it will enable everything it can. make
should use -j
instead of -J
. Using USB devices for mouse/keyboard improves mouse performance, but it still is a bit sluggish compared to the host machine. I found a way to get 256 colours working; see that section for a guide.