PowerMac G5 running Linux with a PowerPC virtual machine

Discussion in 'PowerPC Macs' started by LightBulbFun, Nov 21, 2015.

  1. LightBulbFun macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #1
    A few days ago I decided to install ubuntu mate 15.10 on my PowerMac G5 dual 2Ghz (with a Radeon 9200) I got everything working Sound, Graphics and even wireless and CPU speed stepping so I decided to try setting up QEMU with KVM for those who don't know QEMU is a emulator/virtualiser that can do many different machines normally it emulates the guest system but combined with KVM (witch is a type of virtualiser like Virtual box etc) QEMU can act like a Virtual machine program now this works on PPC but last time I tried I could not get it to work but this time i decided to have another go and what do you know I got it working i was able to make a virtual machine of a Sawtooth PowerMac3,1 and run tiger in it since its a virtual machine it runs at near native speeds (in this case it only used 1 of the 2 G5s) since the PPC CPU of the guest was being virtualised instead of emulated, also a result of this is a couple more CPUs worked like 604 and 7410 (I can set the CPU to host witch in this case is a PPC 970 but OS X craps it self when it run on a sawtooth with a G5) so the end result was I was able to install Linux on my G5 and still run OS X in a virtual machine with not bad speed (the lack of Graphics acceleration in the guest hits a bit tho) I will be trying to run Leopard in the next day or 2. I know this is quite a niche subject but i figured id make a post about since theres not many on the internet about it :) I hope this all made sense to you im not very good at putting things on paper so to speak :D
    qemu-kvm-screen-shot-1.png
     
  2. flyrod macrumors 6502

    flyrod

    Joined:
    Jan 12, 2015
    #2
    Nice, thanks for sharing your result! Supposedly mac-on-linux is faster than qemu:

    ubuntuforums.org/showthread.php?t=2245041
     
  3. LightBulbFun thread starter macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #3
    I have seen that thread before indeed I plan to play with MOL at some point. the 2 things that hurt QEMU in my testing seems to be Disk IO in the guest is quite slow and the lack of any graphical acceleration (its just a basic 16MB Frame buffer) I should run xbench and see what i get heh
     
  4. LightBulbFun thread starter macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #4
    I played around with it a bit more today and I got MOL with KVM running indeed it is a bit faster then QEMU (again this is running on 1 of the 2 G5s) QEMU is more flexible then MOL tho (For example MOLs guest mac is a Grakle machine where as QEMU can do both a Grackle machine and a Uninorth machine as well as a couple of other non Mac PPC machines) also QEMU can do quite a few more CPUs then MOL. (it shows 1.3Ghz as the CPU speed since my 2Ghz G5s step down to 1.3Ghz when they are not under load)
    MOL-MR-1.png
     
  5. tdbmoss macrumors regular

    tdbmoss

    Joined:
    Dec 4, 2011
    Location:
    UK
    #5
    I have a very similar G5 that I acquired recently (early 2005 dual 2.0 GHz with a Radeon 9600) and have been wanting to try Linux to see how it deals with a brand new OS (with Leopard being a few years old now) and to try PPC virtualisation like this. Do you have any tips on installing Linux and getting the various G5 system functionality working from your experience with it - was it difficult? I already have 10.3, 10.4 and 10.5 installed on separate partitions, with a spare 20 GB partition set aside that is currently formatted as HFS+.

    Also where did you get MOL from, as the sites that come up on a Google search seem to be the very old versions rather than the recently-relaunched KVM version?
     
  6. LightBulbFun thread starter macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #6
    depending on how confident you are with a command line its not that hard to install Linux a few things I can recommend is this : http://ppcluddite.blogspot.co.uk/2012/03/installing-debian-linux-on-ppc-part-iv.html this is a Debian guide but it mostly goes for ubuntu too (if it helps in my case my Radeon 9200 Need the radeon.agpmode=-1 to stop it freezing otherwise Graphics acceleration was working OOB) I also found this to be very helpful as well https://wiki.ubuntu.com/PowerPCFAQ (one thing that I am not sure if its covered or not is when your at the CD yaboot prompt type live-powerpc64 this will enable 64 bit mode on G5s and 64 bit capable PPC CPUs if you want at that prompt hit tab to see all the options) I mostly followed those guides with my knowledge of Linux and was able to get everything working on my G5 Sound Wifi Graphics CPU speed stepping etc KVM should be working OOB (in the past it was not and i never got it to work but now it is heh) You have to compile QEMU your self from the latest sources but thats not hard to do in my case I did sudo apt-get build-dep qemu (sudo apt-get install qemu installs a version thats kinda broken) then I CDed into my source directory and did ./configure --enable-kvm --target-list=ppc64-softmmu and then sudo make install and that compiled and installed it (one thing to check at the configure list is that SDL is set to yes and so is KVM) thats mostly how I got QEMU working for MOL I got the KVM enabled version as a .deb from here http://ubuntuforums.org/showthread.php?t=2245041&page=2 then I used parts of this howto https://help.ubuntu.com/community/MacOnLinuxHowto and configured the installed MOL to point to my OS X image and boot it and thats how I got MOL working. now for booting real HDDs inside the Virtualizer I was able to boot my 10.2.8 G5 install in MOL by pointing it at the physical HDD its on in this case /dev/sdb but when I tried the same thing in QEMU while once OS X is booted (say tiger) it has no issue seeing/browsing that HDD but for some reason at Open firmware I cant boot from it /browse the file system. one last thing that iv played with QEMU as an emulator (on my 10.11 hackintosh) but not in KVM on my G5 is this http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=d18d50817ec620311e4d46bbd4edc93a this has some info on QEMU in it and its quite cool seeing OS 9.2.2 booting in an emulator id like to try it with my G5 in KVM mode some time.
    I hope this all made sense and helps you in your quest in this stuff (it was not easy for me in the beginning :) ) BTW my 2Ghz G5 is a June 2004 8 slot 970 7,3 G5
     
  7. gtackett macrumors newbie

    Joined:
    May 19, 2011
    Location:
    USA
    #7
    LightBulbFun, maybe you can help me to get mol-kvm working on my PowerMac G5 that has ubuntu 15.10 installed on it.

    I'll post a lot of details below, but then maybe we can find a way to communicate more directly and not clutter up the forum here.

    I've gone through the config files in /etc/mol. I think I understand them, mostly, and I've edited them accordingly.

    When I try to boot from my OS X install DVD (or from an iso image of it) it's telling me this:
    $ sudo startmol -X
    Mac-on-Linux 0.9.73-SVN [Apr 27 2014 19:21]
    Copyright (C) 1997-2004 Samuel Rydh
    Starting MOL session 1
    Using timebase frequency 33.334 MHz [from config file]
    KVM mapped 00000000 - 0xdac00000 to 0x1ceed000 flags 0
    Unknown processor id (0000).
    Running in PowerPC 750 mode, -596 MB RAM
    Timebase: 33.33 MHz, Bus: 1000.00 MHz, Clock: 1304 MHz
    Using USB mouse on /dev/input/mice
    Could not open '/var/local/mol/x11.kbd'
    Serving VNC on port 5900
    Video driver(s): [xvideo] [vnc]

    640* 480, depth 8,15,32 { 0.0 } Hz
    800* 600, depth 8,15,32 { 0.0 } Hz
    1024* 768, depth 8,15,32 { 0.0 } Hz
    1152* 864, depth 8,15,32 { 0.0 } Hz
    1280*1024, depth 8,15,32 { 0.0 } Hz
    1440* 960, depth 8,15,32 { 0.0 } Hz
    1600*1024, depth 8,15,32 { 0.0 } Hz
    1600*1200, depth 8,15,32 { 0.0 } Hz
    1680*1050, depth 8,15,32 { 0.0 } Hz


    Available Disks:
    Unembedded HFS+ /dev/sdb9 <rw> 128 MB
    Unembedded HFS+ /dev/sdb10 <rw> 75298 MB
    Disk /etc/mol/leopa.. - Partioned - <read-only> 7687 MB BOOT
    CD /dev/sr0 CD/DVD <read-only> ------

    SCSI devices:
    [SCSI auto-probing disabled]

    SCSI /dev/sr0 [CDROM/DVD driver]

    KVM mapped 0x81000000 - 0x81500000 to 0x1c9b4000 flags 38

    >> ==================================================
    >> MacOS X Boot Loader 0.9.73-SVN
    >> Candidate boot volume: /mol-blk@0/disk@0:3
    >> /mol-blk@0/disk@0:3,\mach_kernel (10256044 bytes)
    >> Ignoring cmd type 27.
    > KVM patched: _bcopy_physvir_32
    >> KVM advanced inst patch: success
    >> /mol-blk@0/disk@0:3,\System\Library\Extensions.mkext
    >> Failed to load mkext!
    >> Loading from /mol-blk@0/disk@0:3,\System\Library\


    And then it just appears to hang until I press Control-C a few times.

    That was booting from an actual DVD. it's almost exactly the same booting from a ISO image of the DVD.
     
  8. LightBulbFun, Apr 8, 2016
    Last edited: Apr 8, 2016

    LightBulbFun thread starter macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #8
    couple things that stand out is failed to Load mkext it could be then loading the kext manually without cache witch would take a while (but you should see the Apple Logo at this point and there be a bunch of activity) also just getting OS X to boot can be very hit and miss sometimes it works some times it just refuses to work (if you see my youtube video on it you can see it refused to play ball with tiger in that session so i switched it to 10.2.8) some screen shots of what its doing would be nice too (btw full screen mode is not quite working i tried for a little bit but decided i was happy with windowed mode) I also see mention of Leopard that wont work in MOL
     
  9. gtackett macrumors newbie

    Joined:
    May 19, 2011
    Location:
    USA
    #9
    I gave up on full screen too.

    Maybe Leopard is the main problem. Before I try anything else, next time I have some time to play I'll try an earlier version of OS X or maybe even older 9.x or 8.x

    Have you tried Leopard in Qemu?
     
  10. LightBulbFun thread starter macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #10
    I Was the first guy to run Leopard in QEMU (well at least in PowerPC mode) :) Read here http://forums.macrumors.com/threads/leopard-booted-in-a-powerpc-emulator-qemu.1907447/ in the more recent builds of QEMU they mostly fixed the Mac99 (Sawtooth) emulation so you no longer have to fudge with Kexts etc stock Leo should work but when not using KVM, G4 emulation seems to be semi broken (was working fine in 2.3/4 or so but broke in 2.5) but if your going to be using QEMU with KVM on your G5 it should work fine (maybe a bit sluggish LOL )
     
  11. Lastic, May 29, 2016
    Last edited: May 29, 2016

    Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #11
    LightBulbFun Did you ever get get networking working in your QEMU guest ?

    My host is Leopard and I'm running the MacPorts QEMU version to boot a Debian Jessie guest.

    I need to be able to SSH/SCP to the Debian guest but I can't get it to have a network interface visible to the host.

    Currently I'm playing around with TAP devices but no luck yet.
     
  12. LightBulbFun thread starter macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #12
    I played a bit with networking (not much since im still wrapping my head around it and i dont have that much use for it inside the guest) but a big hindrance is with the QEMU Sawtooth/G3 beige emulation the PCI "Slots" kinda get broken in anything above 10.4.2 running in the guest (I did kinda get somewhere when using 10.2.8 in QEMU) and finally i know your talking about QEMU on a PPC OS X host which i have not been able to play with (getting it compiled never worked for me I will have to look into MacPorts...) when it comes to QEMU on an OS X host i have only played with it on intel systems running a PPC Guest as thats where my main interest lies tho would be fun to boot el cap in a QEMU Guest on a G4 or something :) all in all I cant help you much with networking my self. But check out this thread on emaculation http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=2d5c1f2fb7d03501f5996dd5b57de5bc they touch on networking in the later posts in pages 18+ or so but its well worth crawling through all the posts from page 1 :)
     
  13. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #13
  14. Ulli63 macrumors newbie

    Joined:
    Aug 23, 2016
    Location:
    Basel, Switzerland
    #14
    Hello LightBulbFun,
    we were in contact on youtube. Thx again for your answer.

    I just tested Ubuntu Mate 16.04 on my PowerMac G5 (PowerMac7,3; Dual 2 Ghz; 4.5 GB RAM) with a Live-CD. Everything works perfect so far: screen resolution, video, mouse, keyboard, LAN. Amazing!! As I outlined in my replay to your post on youtube, my idea is to use the G5 as a file and print server and only occasionally fire up the existing OS X 10.5.8 installation to use some creative apps. I had already moved this data (10 GB, mainly pics, office, pdf, ...) to the G5 box where they are stored in the /home directory in the HFS+ partition.

    A question before go on and install Ubuntu Mate parallel to the existing OS X 10.5.8 installation: would you recommend to create a separate partition for the data so that they could be accessed both locally from the OS X 10.5.8 machine in the other partition and from other clients (Linux, OS X, Windows) over the LAN?? Or should I leave them in the HFS+ partition? I am not sure if this format is future proof.

    thx for your advise
    Ulrich
     
  15. LightBulbFun thread starter macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #15
    if its over the LAN and Linux Host is handling that part then HFS should be fine assuming you have it mounted as Read write
     
  16. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #16
    Since I still have a G5 standing here which has no use for me yet, I thought of using it as a host for
    VM's using QEMU since it has 6 GB of RAM and an SSD .

    I tried to boot an x86_64 qcow image with Qemu 2.2.0 (install from Macports 2.3.4 PPC ) on OS X
    10.5.8 PPC but it only allows the guest to have 1256 Mb of RAM ?

    Could be that QEMU from MacPorts which was compiled on my G4 Powerbook 1,25 GB RAM has
    installed that restriction and I need a clean install on the G5.

    Before I go through the hassle of installing Ubuntu or Debian, could you check what the maximum
    number of memory is that you can allocate to :

    qemu-system-x86_64
    qemu-system-i386

    if you off course got time, still have Ubuntu on your G5 ?

    Thanks in advance
     
  17. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #17
    In the meanwhile I reinstalled OS X 10.5.8 from scratch on the G5 and reinstalled Macports 2.3.4
    and Qemu 2.2.0.

    With :

    qemu-system-i386 I can allocate a maximum of 1412M RAM
    qemu-system-x86_x64 I can allocate a maximum of 1387M
     
  18. LightBulbFun, Dec 10, 2016
    Last edited: Dec 10, 2016

    LightBulbFun thread starter macrumors 6502a

    LightBulbFun

    Joined:
    Nov 17, 2013
    Location:
    London UK
    #18
    well your playing with QEMU for x86 emulation I have not played around much with x86 emulation on my Linux G5. but next time I fire it up ill update qemu to the latest and report back what i can allocate. (PS I did end up figuring out how to get networking with my QEMU guests) I mostly mess with QEMU for its PPC emulation/virtualization :)
     
  19. Lastic macrumors 6502

    Joined:
    Mar 19, 2016
    Location:
    North of the HellHole
    #19
    Well I found out today there is no logic in the maximum memory allocation of Qemu.

    qemu-system-i386 debian host VHD file with 1400M RAM allocated
    qemu-system-x86_84 debian netinstall with 1389M RAM allocated
    qemu-system-x86_64 Fortigate QCOW2 image with 1024M RAM allocated
    ( yes I forgot the password aargh )

    QEMU FTW.png
     

Share This Page