Installing Ubuntu 12.04 PowerPPC on qemu

Fedora gave up building on ppc as a primary architecture a while back [edit: see comments], but Ubuntu has a working ppc build. This is useful for testing software because it’s a big endian architecture, and therefore breaks some assumptions made by software that has only seen an Intel (little endian) architecture.

Fortunately it’s very simple to install Ubuntu/ppc as a qemu guest. Here is how I did it:

  1. Download mini.iso from here.
  2. Compile qemu from git (it’s easy!) so you have a qemu-system-ppc binary with a working bios.
  3. Create a virtual hard disk: truncate -s 10G disk.img
  4. Boot the ISO: ./qemu-system-ppc -m 1024 -hda disk.img -cdrom mini.iso -boot d
  5. At the first prompt, type install and go through the installation.

At the end of the installation, it won’t install a boot loader, so the guest won’t be bootable without an external kernel and initrd. This is easy to arrange:

$ guestfish --ro -a disk.img -m /dev/sda2 \
    download /vmlinux vmlinux : \
    download /initrd.img initrd.img

With the external files vmlinux and initrd.img you can now boot your guest:

$ ./qemu-system-ppc -m 1024 \
    -hda disk.img \
    -kernel vmlinux -initrd initrd.img \
    -append "ro root=/dev/sda3"


Filed under Uncategorized

10 responses to “Installing Ubuntu 12.04 PowerPPC on qemu

  1. Karsten

    Fedora has working PPC distributions, too. F16 was released back in December 2011, the F17 release is lagging only 1 week behind the Fedora primary archs:
    Anyway, thanks for your writeup. I’ll try to do an F17 PPC installation with those steps.

  2. Frustrated

    Can you give more details on step 2, I’m stuck trying to get qemu to run without erroring. Building from source seems to be failing, using the apt-get binary complains about not being able to load openbios-ppc.

    • rich

      Firstly, compiling from source rather than using the qemu package from your Linux distro is the right way to go. qemu usually compiles from source easily. However occasionally it fails for one reason or another. In this case I’ve no idea why it would fail because you give no information at all about the error message, the git-commit version of qemu or anything else.

      • Paul Bolle

        > Firstly, compiling from source rather than using the qemu package from > your Linux distro is the right way to go.

        Why is that actually? Why doesn’t “/usr/share/qemu/openbios-ppc” just, well, work? (That file is shipped in F20’s openbios package. That package is a dependency for F20’s qemu-system-ppc.)

      • rich

        This article was written 20 months before Fedora 20 was released.

  3. Pingback: lubuntu 13.04 powerpc virtualizzato su G4 con Qemu e kvm | NUTesla | The Informant

  4. Pingback: powerpc G4 virtualization with kvm | Humanize Technology

  5. How long is it supposed to take before the boot screen appears? I have this message “Trying cd:,\\:txbi…” and nothing more happens. The CPU load for that process is at 100 percent but I have waited for 15 minutes and nothing happens.

  6. Paul Bolle

    I can’t reply to rich’s reply, but it seems the advice to complie fromn source still stands for Fedroa 20. See .

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.