Mac Wrapper Application

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
User avatar
samdeane
Space Cadet
Posts: 5
Joined: Fri Apr 10, 2020 1:22 pm
Location: The Outer Hebrides

Mac Wrapper Application

Post by samdeane »

I've successfully built the mcayland screamer version, and in fact I forked it and added some minor tweaks to make the Mac version remember the last position of the window when you next relaunch it (which was driving me mad).

I also seem to have accidentally :shock: started writing a Mac application which acts as a wrapper, and allows you to bundle up virtual machines into a single double-clickable file.

I've no doubt that other people have done this too, but some of the attempts I've found look to have been abandoned, or aren't currently supported on MacOS X itself. Does anyone know of any that are alive and active?

I'm wondering how far to go with what I'm doing, and it would probably be pointless if there's a really good app out there already.

That said, I'm quite tempted to continue and to focus my efforts primarily solely on making it as easy as possible to run MacOS inside QEMU on MacOS X (as opposed to making something generic that lets you tweak every bell & whistle and run other guest OSes).

Just floating this idea here right now to see if anyone bites...
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Mac Wrapper Application

Post by emendelson »

This is something that would be VERY useful. I've written AppleScript wrappers for SheepShaver and BasiliskII, but QEMU is beyond my abilities. We would be very glad to have a wrapped QEMU!
almeath
Mac Mechanic
Posts: 170
Joined: Mon Jul 18, 2005 5:42 am
Location: Australia

Re: Mac Wrapper Application

Post by almeath »

emendelson wrote:This is something that would be VERY useful. I've written AppleScript wrappers for SheepShaver and BasiliskII, but QEMU is beyond my abilities. We would be very glad to have a wrapped QEMU!
I’ll second that. QEMU has a steep learning curve, so anything to make it a more user-friendly experience would be welcome.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Mac Wrapper Application

Post by Cat_7 »

Perhaps the qemu options of -writeconfig and -readconfig can help.

This command line:
qemu-system-ppc.exe -L pc-bios ^
-boot c -m 512 -M mac99,via=pmu ^
-bios pc-bios/openbios-ppc ^
-hda C:\Mac-disks\9.2.img ^
-sdl ^
-device VGA,edid=on,romfile=pc-bios/vgabios-stdvga.bin ^
-writeconfig config-macos92.txt

Translates to this:
# qemu config file

[drive]
media = "disk"
index = "0"
file = "C:\Mac-disks\9.2.img"

[device]
driver = "VGA"
edid = "on"
romfile = "pc-bios/vgabios-stdvga.bin"

[machine]
type = "mac99"
via = "pmu"
firmware = "pc-bios/openbios-ppc"

[memory]
size = "512"

[boot-opts]
order = "c"

Qemu can then be started with qemu-system-ppc.exe -readconfig config-macos92.txt

Best,
Cat_7
User avatar
samdeane
Space Cadet
Posts: 5
Joined: Fri Apr 10, 2020 1:22 pm
Location: The Outer Hebrides

Re: Mac Wrapper Application

Post by samdeane »

Cat_7 wrote:Perhaps the qemu options of -writeconfig and -readconfig can help.
Ah, that's handy - I thought something like that would probably exist. Are the options fully documented anywhere?

(I can look through the code of course :lol:)

What I'm doing is equivalent to the .sheepvm files:

Image

It's a folder with a file extension, which is treated as a single file by the Finder. It can contain both the configuration information and the actual drive images. Double-clicking opens it into my app (currently called Maqemu), and optionally then runs it straight away with Qemu.

My app can also potentially let you alter the configuration using a more user-friendly form, but the primary objective is just to have a single double-clickable file that you can share and which contains all of the vm files.
User avatar
samdeane
Space Cadet
Posts: 5
Joined: Fri Apr 10, 2020 1:22 pm
Location: The Outer Hebrides

Re: Mac Wrapper Application

Post by samdeane »

On a related note, does anyone know what the licensing policy is for Qemu and all its dependencies? Qemu looks to be GPLv2, but who knows about all the things it depends on?

Would I get away with bundling the executable (and required libraries) for Qemu? Given that there seem to be websites where you can download a pre-built executable, I assume that this is ok - but maybe those sites are playing fast and loose with the rules?

If necessary I can have my app download it rather than bundling it (or even build it, though then there's a requirement on homebrew etc), but I might want to use a custom build of Qemu so I'd probably still end up having to host that.

For the best UI it would be nice if you could just download Maqemu and have everything you needed.

If I do this, Maqemu itself will be open source, and likely free. I might conceivably look to make a premium version with some extra features if there was enough interest, but I doubt if it would ever prove worth it (and even then I'd try to keep it open source).
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mac Wrapper Application

Post by adespoton »

Just came to say I'm still maintaining my QEmu wrappers. Mine work with a shell script inside the Resources folder; nothing fancy. I just bundle a static build into each wrapper so that they're stand-alone. I believe I built the original framework using Platypus, although it's possible to do the same thing just by hacking the QEmu app bundle itself. I just like to be able to upgrade by dropping new builds into the Resources folder :)

The config file looks like a nice idea; I might try migrating my wrappers over to that method.

However, one thing my wrappers do is use sparse bundles -- the script mounts the bundle, and then QEmu loads raw data from the mounted device instead of directly from a file. This allows me to keep my images sparse, and means Time Machine only backs up the slices that have changed instead of the entire image.
User avatar
samdeane
Space Cadet
Posts: 5
Joined: Fri Apr 10, 2020 1:22 pm
Location: The Outer Hebrides

Re: Mac Wrapper Application

Post by samdeane »

adespoton wrote:Just came to say I'm still maintaining my QEmu wrappers.
Sounds good - where can these wrappers be found? :)
User avatar
samdeane
Space Cadet
Posts: 5
Joined: Fri Apr 10, 2020 1:22 pm
Location: The Outer Hebrides

Re: Mac Wrapper Application

Post by samdeane »

For anyone wanting to follow my progress (or lack of), the code is on GitHub.

I will upload releases there for now (I'll set up a proper Sparkle feed for automatic updates later).

I've put up a very sketchy first build, which does work, but has barely no UI.

See the README on Github for more information.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mac Wrapper Application

Post by adespoton »

samdeane wrote:
adespoton wrote:Just came to say I'm still maintaining my QEmu wrappers.
Sounds good - where can these wrappers be found? :)
Older versions are in https://github.com/adespoton/macosemushells -- I haven't updated against my personal ones recently due to general lack of interest.
User avatar
celebi23
Granny Smith
Posts: 101
Joined: Wed Jun 18, 2008 5:53 am

Re: Mac Wrapper Application

Post by celebi23 »

I've been using this super easy setup with Qemu for awhile. For example, here's what I use for my Mac OS 9.2.2 (and for Qemu-4.2-OSX-Screamer-11-02-2020):

Mac OS 9.2.2.app/
Contents/
  • *Info.plist
Contents/MacOS/
  • *AdobeMac.dmg
    *launcher
    *Libs
    *MacintoshHD.dmg
    *pc-bios
    *qemu-img
    *qemu-system-ppc
    *tap-scripts
Contents/Resources/
  • *Mac OS 9.icns
And here's what I have in the launcher script

Code: Select all

#!/bin/sh
mypath=`dirname "$0"`
cd "$mypath"
./qemu-system-ppc -L pc-bios -boot c -M mac99 -cpu G4 -m 768 -prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -drive file=MacintoshHD.dmg,format=raw,media=disk -drive file=AdobeMac.dmg,format=raw,media=disk -netdev user,id=network01 -device sungem,netdev=network01 -device VGA,edid=on
And if you set the "Executable file" option in the Info.plist file to the launcher script, you've got a super easy wrapper setup :eek:
Post Reply