QEMU with PowerPC64 Guests


For a fully functioning Debian Sid PPC64 guest image, follow the README.txt here: http://npmccallum.fedorapeople.org/qemu/ppc64/debian/

QEMU 1.4.0

With QEMU 1.4.0, PPC64 guests are close to working out of the box. It took some exploration to figure out exactly how to make this work, but it is mostly simple once you figure it out. In short, PPC64 emulation has a flakey IDE controller. This causes random lockups. You can work around this on Debian Sid.

Things that Don’t Work

  • virtio disks: This appears to be a QEMU problem as I can’t get it to work without random lockups on numerous distros, most notably Fedora 18.
  • graphical console: The only way to get the system to boot is with -nographic.
  • boot-loader after install: I’m not sure why, but this crashes QEMU. The workaround is to load the kernel/initrd directly and bypass the boot-loader.
  • power management: There are no fancy features like rebooting or powering off. You’ll have to do it manually.
  • Fedora 18: The PPC64 ISO appears not to have drivers for either the ATA or SCSI controllers that QEMU supports. Since virtio support doesn’t appear to work (see above), that means Fedora 18 has no disk driver support.

Installing Debian Sid

  1. Create a temporary directory:

    mkdir ppc64; cd ppc64

  2. Download the Debian Sid kernel image:

    wget http://ftp.us.debian.org/debian/dists/sid/main/installer-powerpc/current/images/powerpc64/netboot/vmlinux

  3. Download the Debian Sid initrd image:

    wget http://ftp.us.debian.org/debian/dists/sid/main/installer-powerpc/current/images/powerpc64/netboot/initrd.gz

  4. Create a disk image:

    qemu-img create -f qcow2 debian-sid-ppc64.qcow2 10G

  5. Start QEMU:

    qemu-system-ppc64 -nographic -hda debian-sid-ppc64.qcow2 -kernel vmlinux -initrd initrd.gz -append “console=ttyPZ0 libata.dma=0 debian-installer/allow_unauthenticated=true”

    1. console=ttyPZ0 – This is needed to make the console work when using -nographic.
    2. libata.dma=0 – This disables DMA on the ATA controller. It makes the controller more stable (NOTE: I didn’t say perfectly stable…).
    3. debian-installer/allow_unauthenticated=true – When I tried to install the first time through, I got to the end and got complaints about unsigned packages. This is likely a simple error in the repo. NOTE WELL: this option disables security.
  6. Follow install instructions.
  7. When the OS tries to reboot, it won’t work. Just shut down the VM.
  8. Start QEMU again:

    qemu-system-ppc64 -nographic -hda debian-sid-ppc64.qcow2

  9. Notice that QEMU crashes: Uh oh!
  10. Use qemu-nbd to mount your boot/root partition and extract the kernel and initrd images. Alternatively, just download them from here.
  11. Start QEMU again:

    qemu-system-ppc64 -nographic -hda debian-sid-ppc64.qcow2 -kernel vmlinux-3.2.0-4-powerpc64 -initrd initrd.img-3.2.0-4-powerpc64 -append “console=ttyPZ0 libata.dma=0 root=/dev/sda3”

  12. Bask in all the PPC64 guest glory!




6 thoughts on “QEMU with PowerPC64 Guests

  1. Debian don’t have official ppc64 ports. You use 32bit userland, but 64bit kernel space.
    I’ve use ‘qemu-system-ppc64 -cpu POWER7 -machine pseries -m 1024’ to install RHEL 6.4 PPC64, it is 64bit userland and 64bit kernel space.

      1. When I tried to install the RHEL 6.4 on ppc64 qemu, it always failed with creating the swap lv, saying short of one extent: something like, need 504, but only 503. This is even after I increased the size of the disk img file.

Leave a Reply

Your email address will not be published. Required fields are marked *