Tag Archives: qemu-system-ppc

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"
Advertisements

10 Comments

Filed under Uncategorized