Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

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
salimsaid
Space Cadet
Posts: 7
Joined: Fri Sep 21, 2018 2:06 pm

Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by salimsaid »

Installed Lubuntu using below command

Code: Select all

qemu-system-ppc -L pc-bios -boot d -M mac99 -m 1024 -prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -prom-env 'vga-ndrv?=true' -drive file=lubuntu-14.04.5-desktop-powerpc.iso,format=raw,media=cdrom -drive file=lubuntu.img,format=raw,media=disk -device usb-mouse -device usb-kbd
Trying to boot using below code

Code: Select all

qemu-system-ppc -hda lubuntu.img
When i boot, things get stuck on a screen displaying

no valid state has been set by load or init-program

What am i missing ? Pls note that i have installed lubuntu successfully on the image mentioned above.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by adespoton »

From https://wiki.qemu.org/Documentation/Platforms/PowerPC :

Lubuntu 14

Installation:

./qemu-system-ppc -L pc-bios -boot d -M mac99,via=pmu -m 1024 -net nic,model=sungem -net user -sdl -hda lubuntu14.qcow2 -cdrom lubuntu-14.04.5-desktop-powerpc.iso

Running:

./qemu-system-ppc -L pc-bios -boot c -prom-env "boot-device=hd:,\yaboot" -prom-env "boot-args=conf=hd:,\yaboot.conf" -M mac99,via=pmu -m 1024 -net nic,model=sungem -net user -sdl -hda c:\Linux-disks\lubuntu14.qcow2 -cdrom c:\Linux-images\lubuntu-14.04.5-desktop-powerpc.iso
salimsaid
Space Cadet
Posts: 7
Joined: Fri Sep 21, 2018 2:06 pm

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by salimsaid »

Ok i've tried reinstalling using instructions from the official Qemu webisite.

Running

Code: Select all

qemu-system-ppc -L pc-bios -boot d -M mac99,via=pmu -m 1024 -net nic,model=sungem -net user -sdl -hda lubuntu14.qcow2 -cdrom lubuntu-14.04.5-desktop-powerpc.iso
gives me the following errors

Code: Select all

qemu-system-ppc: Property '.via' not found

qemu-system-ppc: Unsupported NIC model: sungem
so i omitted the via option, and removed the NIC model: sungem option as well, my install command looks as below

Code: Select all

qemu-system-ppc -L pc-bios -boot d -M mac99 -m 1024 -net nic -net user -sdl -hda lubuntu14.qcow2 -cdrom lubuntu-14.04.5-desktop-powerpc.iso
Should i proceed installing with the above options missing vai and nic model ?

Also, i've seen on running the installation, the image path is

Code: Select all

c:\Linux-disks\lubuntu14.qcow2

Is that not windows file system structure ? is it mandatory to mount the lubuntu14.qcow2 image on c:\Linux-disks\lubuntu14.qcow2 ?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by Cat_7 »

Hi,

How old is your qemu build? Not being able to recognise mac99,via=pmu points to an older build, as does the problem with the sungem device.

Code: Select all

c:\Linux-disks\lubuntu14.qcow2
That is a copy and paste error from my side ;-) I'll fix it right-away.
It should just point to the hard disk /cd images as appropriate for your platform.

I cannot know for sure whether your Qemu build will run successfully, as the instructions are valid from a certain point in Qemu development.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by Cat_7 »

This command line should boot the hd image, if, as said above, your Qemu build supports it:

qemu-system-ppc -L pc-bios -boot c -M mac99 -m 1024 -net nic -net user -prom-env "boot-device=hd:,\yaboot" -prom-env "boot-args=conf=hd:,\yaboot.conf" -hda lubuntu.img

Best,
Cat_7
salimsaid
Space Cadet
Posts: 7
Joined: Fri Sep 21, 2018 2:06 pm

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by salimsaid »

running

Code: Select all

qemu-system-ppc --version
gives me
QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.31), Copyright (c) 2003-2008 Fabrice Bellard
should be i fine with 2.5.0 ? or i'll need to obtain a newer version of qemu ?at least for my current requirement (installing lubuntu 14 on ppc ) emulated on linux ?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by Cat_7 »

2.5 should be from 2015?

We are at 3.0 right now. There might be other issues besides network and via=pmu problems. I have no way of knowing.

Can you compile your own version of Qemu?

Best,
Cat_7
salimsaid
Space Cadet
Posts: 7
Joined: Fri Sep 21, 2018 2:06 pm

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by salimsaid »

I see,
I will compile qemu from source and try building a power pc target;
I'll let you guys know how it all goes. I appreciate your input.
salimsaid
Space Cadet
Posts: 7
Joined: Fri Sep 21, 2018 2:06 pm

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by salimsaid »

Ok good news :razz:

So i managed to install lubuntu as instructed by the official qemu site..

I was also successful running the installation; the system boots and starts successfully. I appreciate your help till this point.

The thing is, my installation is terribly slow, very very slow.

I tried running with the

Code: Select all

-enable-kvm 
option, but i get this error message

Code: Select all

"kvm" accelerator not found.
No accelerator found!
I verified that kvm is installed in my machine by running

Code: Select all

salim@salim-ThinkPad-E570:~/Desktop/qemu3.0$ kvm-ok 
INFO: /dev/kvm exists
KVM acceleration can be used
Is there any chance that i have the wrong version of kvm installed ? Can kvm be used to speed up qemu on ubuntu 16.04 ?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by Cat_7 »

Hi,

The slowness is of course due to the emulation needed to run the ppc version.
kvm can only help you when accelerating on the same architecture. I tried that once running on an old Mac with Debian installed, but the result was still almost unusable.

Best,
Cat_7
salimsaid
Space Cadet
Posts: 7
Joined: Fri Sep 21, 2018 2:06 pm

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by salimsaid »

OK, i guess i'll have to work with the current speed.

I still can't get internet on the vm .

I've tried

Code: Select all

-net nic -net user
but i still can't access the internet, how do i get my get internet from within qemu ?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by Cat_7 »

If you compiled from recent source, the sungem device should work.
So adding
-net nic,model=sungem -net user
to the command line should do the trick.

Best,
Cat_7
salimsaid
Space Cadet
Posts: 7
Joined: Fri Sep 21, 2018 2:06 pm

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by salimsaid »

Ok Good news again, running the latest version of Qemu v3 i've been able to get internet connectivity from inside the qemu..

One more thing, i need to be able to ping the guest from the host . How can i access the guest network from the host ? I have a tcp server running on the guest that i want to access from the client.

How do i achieve that ?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by Cat_7 »

Ping will not work with user networking without some tinkering. User networking provides a DHCP server, and by default the Qemu guest receives the IP address 10.0.2.15 from that server, with dns 10.0.2.3 and router 10.0.2.2

If you need full access to the host network, there are several option for user networking:

from: https://wiki.qemu.org/Documentation/Net ... ng_options
The -netdev user parameter has some more useful options:

The DHCP address and name for the guest can be set with -netdev user,id=n0,host=addr,hostname=name
You can specify the guest-visible virtual DNS server address with -netdev user,id=n0,dns=addr
QEMU can simulate a TFTP server with -netdev user,id=n0,tftp=xxx,bootfile=yyy
To share files between your guest and host, you can use -netdev user,id=n0,smb=dir,smbserver=addr
To forward host ports to your guest, use -netdev user,id=n0,hostfwd=hostip:hostport-guestip:guestport

If that can't solve your issue, you could try the tap networking option. See the same documentation.
and here: https://qemu.weilnetz.de/doc/qemu-doc.h ... rk-options

Best,
Cat_7
darthnvader
Mac Mechanic
Posts: 178
Joined: Sun Feb 07, 2016 4:40 pm

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by darthnvader »

Running linux in qemu-system-ppc on an X86 host, even a fast one, is painfully slow.

I suppose linux tries to use the FPU and AltiVec units to speed things up, the Mac OS doesn't really rely on them to run the basic desktop.

The FPU and Vec units benchmark out at 90Mhz and 70Mhz on my Ryzen 7 CPU, where as the integer performance benchmarks out at 1.18Ghz, in Apple's SkidMarks GT.

I'm fairly sure that's why Linux is so slow.

A lot of work needs to be done in Qemu PPC with the FPU and AltiVec units, I've looked into it, but haven't really been able to make heads or tails of the code for that. If we could get the speed up to SheepShaver performance it would be useable, but at this point it really isn't.
win.exe
Tinkerer
Posts: 42
Joined: Tue Apr 07, 2020 4:59 pm

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by win.exe »

You could also compile a custom Linux kernel for the PowerPC with the FPU and AltiVec Units disabled to speed it up.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Emulating Mac Power PC(Lubuntu 16.04) on Ubuntu 16.04

Post by adespoton »

There's also a custom build of QEMU-PPC on here with an FPU speedup; it's compiled for Windows and macOS, but you could probably use the same fork for a Linux compile.
Post Reply