674
edits
No edit summary |
|||
(11 intermediate revisions by the same user not shown) | |||
{{DISPLAYTITLE:How to install Mac OS 9 in QEMU}}
[[File:MacOS9.2 Desktop.png|thumb|Mac OS 9.2 desktop]]
This page details how to install Mac OS 9 in QEMU. '''Mac OS 9''' is an operating system created
This article will describe in detail how to install Mac OS 9.2 with mouse drivers, sound, networking, and graphics. This tutorial should work with Mac OS 9.0 and 9.1 (which needs an additional flag; more details below).
==Prerequisites==
===QEMU===
You need [[QEMU/Installation|QEMU]] installed, specifically the PowerPC version since old Macs used PowerPC instead of x86. On Arch you can install it with <code>pacman -S qemu-system-ppc</code> and on Debian/Ubuntu you can install it with <code>apt install qemu-system-ppc</code>. The Windows version should come with it already installed.
===Mac OS 9.2.1 CD===
You will need a Mac OS 9.2.1 CD. You can either use a physical disc or download one from [https://winworldpc.com/product/mac-os-9/92 WinWorldPC].
==
===
As always, the first thing we want to do is create the hard disk image by opening the Terminal or Command Prompt and typing this:
<pre>qemu-img create -f qcow2 macos9.img 2G</pre>
'''2G''' can be replaced with however big you want the hard drive to be (with G standing for Gigabytes). Mac OS 9 is a very old OS and thus does not take up a lot of space. [[How to create a disk image in QEMU|See this page for more information on how this command works.]]
When that's done, we can start up QEMU with the following command:
<pre>qemu-system-ppc -M mac99 -m 512 -hda macos9.img -cdrom /path/to/macos-9-cd.iso -netdev user,id=mynet -device sungem,netdev=mynet -device usb-mouse -device usb-kbd -boot d</pre>
This sets the machine type to "mac99" (basically a G4 Mac). You can also set it to <code>-M g3beige</code> which is a Power Mac G3. We also add a USB mouse and keyboard for far smoother input.
We set the RAM to 512 MB, though you can run it with as little as 40 MB and as high as 768 MB. The OS starts becoming severely unstable if more than a GB of RAM is given.
If you are installing Mac OS 9.0 or 9.1, you'll also need to add <code>-cpu G3</code> to the flags for it to work.
When you start QEMU, you should see a yellow screen with some details like this:
You may have a "Setup Assistant" appear. You can go through and set everything up or close it, it doesn't matter much, though it will help you set up some basic network functions like shared folders and the like, so I recommend it. It's a very simple wizard.
Note: You may have to right click some of the links and click "Save link as...". This is due to a recent change in policy in browsers such as Chrome regarding HTTP links.
*[https://macintoshgarden.org/apps/classilla Classilla (Firefox 2 fork)]
*[http://files.mac-attic.com/downloads/internet/browsers/Internet-Explorer-5.1.7.hqx Internet Explorer 5.1.7 (final version of IE for OS 9)]
*[https://macintoshgarden.org/apps/official-macintosh-garden-sherlock-plugins Official Macintosh Garden Sherlock Plugins]
*[http://files.mac-attic.com/downloads/utilities/Virtual-CD.hqx Virtual CD/DVD-ROM Utility]
*[https://www.macintoshrepository.org/809-stuffit-deluxe-1-5-x-8-x StuffIt Deluxe] (for HQX/SIT files)
*[https://winworldpc.com/product/microsoft-office/2001-mac Microsoft Office 2001]
==Sound support==
Unfortunately, the stock QEMU does not come with proper sound drivers for Mac OS 9, so we'll need to build a fork of QEMU that adds these sound card drivers. This section will be technically advanced and is only recommended for more experienced users. The instructions change depending on your OS.
====Compiling on Linux====
Clone the source code tree like so:
<pre>git clone --recursive -b screamer https://github.com/mcayland/qemu.git qemu-screamer
cd qemu-screamer/</pre>
Install the proper build dependencies. This varies from distro to distro, so I included a table with a few example commands:
{| class="wikitable"
|-
! Distribution
! Command
|-
| Arch Linux
| <code>pacman -S libffi gettext glib2 pkgconf autoconf automake pixman ninja mesongnutls libjpeg-turbo libpng libslirp libssh libusb lzo ncurses nettle snappy vde2</code>
|-
| Debian/Ubuntu
| <code>apt install libglib2.0-dev libgcrypt20-dev zlib1g-dev autoconf automake libtool bison flex libpixman-1-dev</code>
|-
|}
<code>cd</code> into the folder. We'll configure the build here. We're only going to compile the PowerPC version of QEMU to save time, though if you want to build every version, just remove the <code>--target-list=ppc-softmmu</code> flag at the very end. Execute the following command:
<pre>./configure --target-list=ppc-softmmu</pre>
Finally, build QEMU:
<pre>cd build/
make -j$(nproc)
</pre>
Afterwards, you'll find the proper <code>qemu-system-ppc</code> in the <code>build/</code> folder.
====Compiling on macOS====
First things first, this requires Homebrew. If you don't have it, install it by following the guide [https://brew.sh/ on the official website].
Clone the source code tree like so:
<pre>git clone --recursive -b screamer https://github.com/mcayland/qemu.git qemu-screamer
cd qemu-screamer/</pre>
Then, install all the build dependencies through Homebrew:
<pre>brew install libffi gettext glib pkg-config autoconf automake pixman ninja meson gnutls jpeg libpng libslirp libssh libusb lzo ncurses nettle snappy vde</pre>
Now, <code>cd</code> into the folder. We are going to configure the build. We are only going to compile the PowerPC version of QEMU to save time, though if you want to build every version of QEMU, just remove the <code>--target-list=ppc-softmmu</code> flag at the very end. Execute the following command:
<pre>PKG_CONFIG_PATH="$(brew --prefix)/opt/ncurses/lib/pkgconfig" ./configure --target-list=ppc-softmmu</pre>
Finally, build QEMU:
<pre>cd build/
make -j$(sysctl -n hw.ncpu)
</pre>
Afterwards, you'll find the proper <code>qemu-system-ppc</code> in the <code>build/</code> folder.
====Compiling on Windows====
We will need to download and install the latest version of [https://www.msys2.org/#installation MSYS2]. Follow the instructions on the page.
A terminal should open when the installation finishes, if not just open it from the Start menu. When the terminal is open, we'll update MSYS2's packages by running:
<pre>pacman -Syu</pre>
When the updates are installed, the terminal will close. Open it again and run the following command to finish updating the packages:
<pre>pacman -Su</pre>
Now, install the build dependencies for QEMU:
<pre>pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-glib2 mingw64/mingw-w64-x86_64-gtk3 mingw64/mingw-w64-x86_64-SDL2 git python python-setuptools ninja</pre>
When this is finished, close the MSYS2 terminal and open the MinGW terminal (should be in the Start menu), and run the commands below to prepare the build environment for QEMU's build scripts:
<pre>
cp -v /mingw64/bin/x86_64-w64-mingw32-gcc-ar.exe /mingw64/bin/x86_64-w64-mingw32-ar.exe
cp -v /mingw64/bin/x86_64-w64-mingw32-gcc-ranlib.exe /mingw64/bin/x86_64-w64-mingw32-ranlib.exe
cp -v /mingw64/bin/windres.exe /mingw64/bin/x86_64-w64-mingw32-windres.exe
cp -v /mingw64/bin/nm.exe /mingw64/bin/x86_64-w64-mingw32-nm.exe
cp -v /mingw64/bin/objcopy.exe /mingw64/bin/x86_64-w64-mingw32-objcopy.exe
</pre>
Now it's time to clone the source tree like so:
<pre>git clone --recursive -b screamer https://github.com/mcayland/qemu.git qemu-screamer
cd qemu-screamer/</pre>
Now we'll configure the build. To save time we only build the PowerPC QEMU target, but if you want to build all of them, just remove the <code>--target-list=ppc-softmmu</code> flag from the end. Also, unlike with macOS/Linux builds, we'll be disabling the GTK UI since it has mouse input issues, as well as DirectSound audio backend because it results in audio issues with OS X (though not Mac OS 9).
<pre>./configure --cross-prefix=x86_64-w64-mingw32- --disable-gtk --enable-sdl --audio-drv-list=sdl --target-list=ppc-softmmu</code>
Now we build QEMU:
<pre>cd build/
make -j$(nproc)</pre>
Afterwards, you'll find the proper <code>qemu-system-ppc</code> in the <code>build/</code> folder.
==Credits==
*[https://gist.github.com/akemin-dayo/0e9bdcd74b2ad7f0bcf56e0680256103 akemin-dayo's QEMU Screamer guide]
[[Category:OS Installation guides]]
[[Category:Tutorials]]
[[Category:QEMU guides]]
|