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"
About these ads

3 Comments

Filed under Uncategorized

3 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: https://fedoraproject.org/wiki/Fedora_17_Beta_PPC_Announcement
    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.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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