powerpc G4 virtualization with kvm

Thanks to the help of Alexander Graf that in 2009 inform me that in that days kvm for powerpc was supporting only the G5, and now on the 2013 tell me that kvm now support G4 . To be onest I haven’t found any information around the web talking about the possibility of the powrerpc G4 to virtualize, even if from the time of born of Mac-on-Linux application in fact mol was virtualizing mac os x 10.3.x and 10.4.x

Writing this post I hope to share something useful for you.

I have wrote this post first on my italian blog . Now I have rewrite it here in my english….

Needed steps to compile kvm and qemu on powerpc

Debian Qemu Kvm Powerpc G4

Debian Qemu Kvm Powerpc G4

Kvm module compile for powerpc (debian way)
I have followed the steps of Debian Kernel HowTo

Download  kernel source ( on my test the 3.9.10 version )
uncompress the source on /usr/src/
make symbolic link in to /usr/src/ to /usr/src/linux

Installs needed package to compile linux kernel
apt-get install module-init-tools kernel-package libncurses5-dev fakeroot
cd /usr/src/linux
and copy the lubuntu config
cp /boot/config-`uname -r`.

make menuconfig
go into the processor option , unset SMP support
go into virtualization option and activate KVM

sudo fakeroot make-kpkg –initrd –append-to-version=kvm_th kernel_image kernel_headers

I have choosed the kvm_th append-to-version
It will create the .deb packages to install with dpkg -i .deb

After installed the generated deb files you will se on  /boot folder  the new  vmlinux e initrd that on my case was:

Now to boot with the generated new linux kernel you need to create the references into /etc/yaboo.conf , you could copy the old paragraph and rename it in “new” and substitude the reference from initrd.old e vmlinux.old to the new installed initrd and vmlinux.

After that you need to install the new yaboot configuration doing sudo ybin -v

At reboot when appear yaboot boot load you need to press tab and choose new option.

In my case, that I have choosed to compile kvm as module after boot with the new kernel I need to type: sudo modprobe kvm

Qemu 1.6.0 Compile

Download qemu 1.6.0 source
sudo apt-get install pkg-config zlib-devel

apt-get build-dep qemu
Check sdl support on configure result

Unstinall qemu-common package
sudo make install

We need to create a virtual disk into install lubuntu virtualized:

qemu-img create -f qcow2 hdppc.qcow2 5G

To start the installation process:

qemu-system-ppc -enable-kvm -m 384 -vga std -hda hdppc.qcow2 -cdrom Scaricati/lubuntu-13.04-desktop-powerpc.iso -boot d


Doing installation is needed to create the newworld boot partition of 1Mb as I have descripted on my old post (in italian)

The virtual disc now is not bootable with qemu and openbios 1.1 , I need to investigate a way to fix it.

I have the solution provided from Richard WM Jones that is to extract vmlinux and initrd from the virtual disc thanks to the guestfish package that is not included in lubuntu/debian powerpc, so I was able to compile guestfish from source form the libguestfs website  and even from the source package of lubuntu, but what I wasn’t able to prepare is the appliance with a qemu vmlinux and initrd runnable on powerpc architecture.

So I have installed guestfish on my ubuntu x86 machine

sudo apt-get install guestfish

After installed and updated you can start guestfish on virtual disc ( in my case hdppc.qcow2 )
guestfish –ro -a hdppc.qcow2

From guestfish console you can activate the qemu appliance, adding virtual disc only read and have a list of partition
add-ro hdppc.qcow2
With this command you can see the partition on the virtual disc, in this way I have see the boot partition ( on my case /dev/vda5 ) and the root partition to specify to qemu ( on my case /dev/vda3 )
The next step is to download from the virtualdisc the vmlinux and initrd , here the command:
sudo guestfish –ro -a hdppc.qcow2 -m /dev/vda5 download /vmlinux vmlinux : download /initrd.img initrd.img
Now we can start the lubuntu powerpc virtualized and install on the virtual disc:

qemu-system-ppc -enable-kvm -m 384 -hda hdppc.qcow2 -kernel hdppc_kernel/vmlinux  -initrd hdppc_kernel/initrd.img -append “ro root=/dev/sda3″

Now we can help testing different gnu/linux distro for powerpc on our powerpc G4 machines.

About these ads

5 comments on “powerpc G4 virtualization with kvm

  1. Pingback: Does we port Dolphin Emulator to Powerpc? | Humanize Technology

  2. Pingback: G4 and G5 powerpc virtualization with qemu 2.0 and kvm | Humanize Technology

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 )

Google+ photo

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

Connecting to %s