GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

About QEMU, 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

PeterHolbrook
Apple Corer
Posts: 247
Joined: Fri Oct 26, 2007 7:56 am

Guest 3D acceleration

Post by PeterHolbrook »

Sorry if this is the wrong thread to post this question. Have there been any improvements in macOS Qemu for OS X guest 3D acceleration? In case there haven't, are there any plans to achieve said acceleration in the foreseeable future?

If such acceleration were to be achieved, I wonder if Qemu would be able to run Snow Leopard (for Intel) as a virtual machine with 3D acceleration. Parallels and VMware Fusion haven't achieved anything in that regard.
Last edited by PeterHolbrook on Sun Jun 18, 2017 8:57 am, edited 1 time in total.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

This thread is about qemu-system-ppc.As for qemu-system-i386 and qemu-system-x86_64 I know that recent versions support Intel haxm (hardware acceleration module) on Windows which should make emulation much faster.Know nothing about 3D graphics acceleration.Sorry.
User avatar
UbuntuXP
Tinkerer
Posts: 67
Joined: Sat Feb 08, 2014 8:15 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by UbuntuXP »

IIRC, GPU have to be emulated in the CPU, unless you passthrough a second GPU to the VM. Of course, with a passthrough GPU, the guest OS would have to support it and then it's not really emulated anyways.
"Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things."

Doug Gwyn
User avatar
Cat_7
Expert User
Posts: 5106
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

Hi,

Video hardware acceleration is possible, but only for intel based OSX and when the host is running Linux and kvm. And even then it seems a daunting task to get it going:
https://bbs.archlinux.org/viewtopic.php?id=162768&p=110
https://blog.ostanin.org/2014/02/11/pla ... -x-on-kvm/

Best,
Cat_7
kikyoulinux
Tinkerer
Posts: 83
Joined: Sun Sep 28, 2014 11:53 am
Location: China

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by kikyoulinux »

Image
Tested with a clean Qemu 2.9 build on my desktop PC running 64-bit Linux.
It really depends on the speed of the host machine. It runs faster on a i3-7100(@3.9GHz) CPU.
Still, FPU performance hits a plateau.
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

Thanks for the benchmarks. Do you think you could add your picture to this page: http://www.emaculation.com/doku.php/benchmarks
User avatar
24bit
Forum All-Star
Posts: 1414
Joined: Wed Nov 11, 2009 5:47 pm
Location: Germany

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by 24bit »

Could we please get back to topic to boot MAC OS 8.5 or higher in Qemu some day soon?

10.X.X is a thrilling thing on Qemu, agreed, but should be discussed in its own thread.
CharlesS
Tinkerer
Posts: 97
Joined: Thu Aug 14, 2008 9:05 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by CharlesS »

9.2.2 and 10.x are both higher than 8.5 :P
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
User avatar
Cat_7
Expert User
Posts: 5106
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

Hi,

I prepared an experimental Qemu build that should run on Mountain Lion and upwards. You can find it here:
http://www.emaculation.com/forum/viewto ... 104#p52104

Please give it a go and report back.

Best,
Cat_7
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Thanks for your builds! A question about your latest bulld with screamer support.As it requires "vga-ndrv?=true" I guess it's based on a recent qemu version.Did you use the new mcayland's screamer repo?
User avatar
Cat_7
Expert User
Posts: 5106
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

As it requires "vga-ndrv?=true" I guess it's based on a recent qemu version.Did you use the new mcayland's screamer repo?
Certainly. When the vga driver became available in the main source, I asked mcayland if he would mind to rebase the screamer code on that code to find out whether the vga driver resulted in a speed increase. He did, so the screamer can now be used with resolution switching. Some "research" on my part revealed that an earlier build of the vga driver did support 256 colours/greyscale, while newer ones don't.

Best
Cat_7
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

I've just tried this version with my MOS 9.0.4 image and found the same issue as we met in the January tested version (with both vga and screamer support). Booting hangs with, no matter, 'vga-ndrv?=true', 'vga-ndrv?=false', -cpu G3, -device usb-mouse... Whereas it boots fine in 21.08.2016 WIP version(without screamer support) with -cpu G3.And it boots in this new version together with an openbios version without screamer support(from 21.08.2016 distribution). There's something in screamer and vga codes that affects MOS 9.0 booting.Though it may be due to G3 code as booting MOS 9.0 requires -cpu G3...
Last edited by alex195812 on Thu Jul 06, 2017 1:20 pm, edited 1 time in total.
User avatar
Cat_7
Expert User
Posts: 5106
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

The screamer does indeed hang Mac OS below 9.2. That hasn't changed. Hence the warning that it only functions "reasonably" well with 9.2....

Best,
Cat_7
User avatar
mabam
Master Emulator
Posts: 322
Joined: Wed Apr 10, 2013 9:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by mabam »

Cat_7 wrote:I prepared an experimental Qemu build that should run on Mountain Lion and upwards. You can find it here:
http://www.emaculation.com/forum/viewto ... 104#p52104
Great, thanks for that!

I used qemu-img from the Qemu_28pre-vga-OSX-Leopard-wip-11082016 build to create a disk image under Mountain Lion. Now I try to use the new build you provided under above URL to install OS 9.2.2 onto the disk image.

The thing is that my 9.2.2 is a multilingual version installer DVD that is not bootable. I have an image from my bootable 9.0.4 CD and try to mount both together with the disk image:

Code: Select all

./qemu-system-ppc -bios ./openbios-ppc -boot c -M mac99 -m 256 -prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -drive file=MacOS9.cdr,format=raw,media=cdrom -drive file=MacOS9.2.2Multilingual.dmg,format=raw,media=disk -drive file=./MacOS9.2.img,format=raw,media=disk -prom-env 'vga-ndrv?=true' -device usb-mouse -device usb-kbd
Qemu displays:

Code: Select all

Welcome to OpenBIOS v1.1 built on May 19 2017 15:49
Trying hd:,\\:tbxi...
It doesn't continue. And as the HDD light of my host computer does not flicker, it doesn't seem to be a matter of having to wait a bit longer, but one of Qemu not going on in the boot process.

If I leave out "-drive file=MacOS9.2.2Multilingual.dmg,format=raw,media=disk", I get the same.

Any suggestions?
User avatar
Cat_7
Expert User
Posts: 5106
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

Yes:

-boot c says boot from hd image.
-boot d says boot from cd image.

In current qemu for OSX you always have to put the entry from which you want to boot as first drive entry in the list, and adjust the -boot parameter according to the type of image: disk or cdrom.

As you do not want to boot from hd but from cd, in your case you use:

Code: Select all

./qemu-system-ppc -bios ./openbios-ppc -boot d -M mac99 -m 256 -prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -drive file=MacOS9.cdr,format=raw,media=cdrom -drive file=MacOS9.2.2Multilingual.dmg,format=raw,media=disk -drive file=./MacOS9.2.img,format=raw,media=disk -prom-env 'vga-ndrv?=true' -device usb-mouse -device usb-kbd
Also please note that your MacOS9.cdr needs to be version 9.0.4 with Mac OS Rom 5.2 or above, otherwise qemu will crash. That version is available at e.g., the macintosh garden as 9.0.4 for the G4 Cube.

Best,
Cat_7
User avatar
mabam
Master Emulator
Posts: 322
Joined: Wed Apr 10, 2013 9:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by mabam »

I copied the ROM from the 9.2.2 multilingual DVD (ROM version 5.8) onto the 9.0.4 CD image. It bombed out during startup of 9.0.4.

It works now with an image from macintosh garden. Networking is fine, without any initial delay. More information will follow.

EDIT:
Well, I can't claim that networking is fine. I'll explain in a separate post.
User avatar
mabam
Master Emulator
Posts: 322
Joined: Wed Apr 10, 2013 9:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by mabam »

Well, AppleTalk is fine. And Print66 in Qemu can be reached via LPR from the host, so it works fine as print server. But I don't have the means to really do further testing. So I can't claim that networking is fine (as I did above in the first place).

I've installed DAVE 5 and tried to establish a Samba-connection between host and OS 9. In the host, I could access the folder shared by DAVE. I put a file in it in Qemu which, after a while, I could see in the host and read (copy) it from the host side. That is, without resource fork.
However, copying a file from the host onto the volume shared from DAVE, would make the file appear on the shared folder with a size of 0 K and produce an error -50 on the host.

From Qemu, I was not able to connect to the host. Instead DAVE reported a NetBIOS error #5.

IIRC I had the exact same results when I tried this between my host machine and SheepShaver. So I don't know whether this is a network issue, an issue with DAVE or an incompatibility between the versions of Samba used by DAVE and OS X, respectively.
Last edited by mabam on Tue Jul 11, 2017 6:01 pm, edited 2 times in total.
User avatar
mabam
Master Emulator
Posts: 322
Joined: Wed Apr 10, 2013 9:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by mabam »

For installation, I used a Mac OS 9.1 image from macintosh garden. For the reference, this was the qemu.command I used for installation:

Code: Select all

#!/bin/bash
cd "$(dirname "$0")"

./qemu-system-ppc \
-bios ./openbios-ppc \
-boot d \
-M mac99 \
-m 256 \
-prom-env 'auto-boot?=true' \
-prom-env 'boot-args=-v' \
-drive file=./MacOSD-9.1.toast,format=raw,media=cdrom \
-drive file=./MacOS9.2HD.img,format=raw,media=disk \
-prom-env 'vga-ndrv?=true' \
-device usb-mouse \
-device usb-kbd
The .iso Cat_7 refers to at http://www.emaculation.com/doku.php/ppc ... networking couldn't be mounted by Qemu, so I created a new .img using qemu-img and formatted that with the above 9.1 installation. I mounted it in the host and copied the Realtek driver onto it. I then again accessed it from 9.1 so I could copy the extension to the system folder.

I started Qemu again with this in my qemu.command file:

Code: Select all

#!/bin/bash
cd "$(dirname "$0")"

sudo ./qemu-system-ppc \
-bios ./openbios-ppc \
-boot c \
-M mac99 \
-m 256 \
-prom-env 'auto-boot?=true' \
-prom-env 'boot-args=-v' \
-drive file=./MacOS9.2HD.img,format=raw,media=disk \
-prom-env 'vga-ndrv?=true' \
-device usb-mouse \
-device usb-kbd \
-device rtl8139,netdev=network0 \
-netdev tap,id=network0,script=./tap-up,downscript=./tap-down
It refers to "tap-up" containing

Code: Select all

#!/bin/bash

ifconfig bridge0 addm $1
and "tap-down" containing

Code: Select all

#!/bin/bash

ifconfig bridge0 deletem $1
These are specific to my network settings, as bridge0 permanently exists on my host machine and is connected to the NIC (I have taken all this from http://drupal.bitfunnel.net/drupal/macosx-bridge-qemu ). In a "regular" network setting tap-up should read:

Code: Select all

#!/bin/bash

ifconfig bridge0 create
ifconfig bridge0 addm en0
ifconfig bridge0 addm $1
ifconfig bridge0 up
But I doubt the latter would work for network access between host and Qemu (with SheepShaver it didn't). The former does, though possibly in a limited way as explained one post above.

An advantage of using "script" and "down script" as above is that Qemu automatically determines an available tap interface number and assigns it to the VM it is starting up. One could then have Qemu start another VM and automatically assign a tap interface with a different number to it, using the same tap-up and tap-down scripts.

In my setting Qemu and SheepShaver, both on the same host machine, could connect to each other via the network without any problem.

This is all on Mountain Lion. Since a few days I have a VirtualBox VM running Sierra. I want to test this on that VM. Others have reported that with this network setup on Sierra they could not achieve what works for me on Mountain Lion. So my expectations are somewhat limited.
User avatar
Cat_7
Expert User
Posts: 5106
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

In sierra, I created a bridge in network preferences and added en0. That is now my permanent configuration.
Whenever I start qemu with tap networking I only have to add the tap device to the bridge.

If you set the correct rights on the tap device, you do not need tap up and tap down scripts or run qemu as root to activate the tap device. But you still need to add the tap device to the bridge with sudo.

sudo chmod 0666 /dev/tap0
(please note that it seems that tuntaposx randomly selects a tap device to activate? I just ran qemu with tap networking and tap9 was activated....)

And if you add mac addresses to the tap devices, you can run multiple qemu instances that can talk to eachother.

Best,
Cat_7
User avatar
Cat_7
Expert User
Posts: 5106
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

The .iso Cat_7 refers to at http://www.emaculation.com/doku.php/ppc ... networking couldn't be mounted by Qemu
That is strange, I just download the iso and added it to the command line and could read it just fine.
-drive file=~/QemuOSX/MacOSRealtekDrivers.iso,format=raw,media=cdrom

Best,
Cat_7
User avatar
mabam
Master Emulator
Posts: 322
Joined: Wed Apr 10, 2013 9:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by mabam »

Cat_7 wrote:In sierra, I created a bridge in network preferences and added en0. That is now my permanent configuration.
Whenever I start qemu with tap networking I only have to add the tap device to the bridge.
That's what I do in Mountain Lion (tweaked) and in my Sierra VM.
If you set the correct rights on the tap device, you do not need tap up and tap down scripts or run qemu as root to activate the tap device. But you still need to add the tap device to the bridge with sudo.

sudo chmod 0666 /dev/tap0
(please note that it seems that tuntaposx randomly selects a tap device to activate? I just ran qemu with tap networking and tap9 was activated....)

And if you add mac addresses to the tap devices, you can run multiple qemu instances that can talk to eachother.
I don't mind running Qemu as root. Using script and downscript I don't need to open a second Terminal window for adding the tap device to bridge0. But maybe chmod the tap device and pass the adding to bridge0 to a launch daemon would prevent any password entry.

So then it is tuntaposx choosing the device number. Thought it was Qemu. So far I have only seen tap0 and tap1, using two instances of Qemu simultaneously. But I just began playing around with that today.

I can't fully test it as VirtualBox won't transport DDP based AppleTalk between the VM and the physical network. But when I connect from one "Qemu OS 9" to the other on the same host, I can do that using DDP-AppleTalk.
I can't see my Banana Pi AppleTalk server (serving via DDP and TCP/IP) in the chooser, but I can connect to it when I enter its IP address manually.

On https://www.linux-kvm.org/page/Networking I have found an entry to have Qemu assign the tap device a random mac address. The respective line in qemu.command then reads like this:

Code: Select all

-device rtl8139,netdev=network0,mac=$(printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))) \
Last edited by mabam on Tue Jul 11, 2017 10:32 pm, edited 1 time in total.
User avatar
mabam
Master Emulator
Posts: 322
Joined: Wed Apr 10, 2013 9:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by mabam »

Cat_7 wrote:
The .iso Cat_7 refers to at http://www.emaculation.com/doku.php/ppc ... networking couldn't be mounted by Qemu
That is strange, I just download the iso and added it to the command line and could read it just fine.
-drive file=~/QemuOSX/MacOSRealtekDrivers.iso,format=raw,media=cdrom
I see. I had added it as media=disk rather than media=cdrom. That way it works! Maybe something to mention in the guide?
MVoloshin
Space Cadet
Posts: 2
Joined: Thu Jul 20, 2017 6:28 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by MVoloshin »

Can I boot MacOS DP1/2/3/4 on QEMU 2.9?
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

I think no, you can't boot them in official qemu versions earlier than 10.05.2017 as MacDrivers patches had been missing untill that point.Cat_7's 19.05 versions can do it(as well as Mac OS X Server 1.2).
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

Has anyone been able to make sharing work on Mac OS X? I wanted to open up an Appleworks file on my host system in the guest. Working with one set of files would make things easier than having to copy between guest and host. I have tried AFP, FTP, and SMB. All of them failed with my Mac OS 10.4 guest.
Post Reply