Running AIX 5.1 on qemu-system-ppc

Shorter entry here which will be mostly copying Artyem  Trasenko’s blog here  

If you have never installed AIX before this howto would help you get going

Installing AIX on Qemu!

A small note on the networking – I have used the following values


I will just add my bits and pieces to get the part I have done and added to the experience. This guide will work also for AIX 4.4.3 but not anything newer than 5.1

One can get  the AIX 5.1 installation media (ISOs) from WinWorld archive here

You will probably only want CD1, CD2 and CD3

IBM AIX 5.1-3 (LCD4_1061_06) (ISO) [PPC] Volume 1 5.1-3 (LCD4_1061_06) English ppc CD 358.71MB
IBM AIX 5.1-3 (LCD4_1061_06) (ISO) [PPC] Volume 2 5.1-3 (LCD4_1061_06) English ppc CD 170.86MB
IBM AIX 5.1-3 (LCD4_1061_06) (ISO) [PPC] Volume 3 5.1-3 (LCD4_1061_06) English ppc CD 303MB

So once you have all in place you can use the following scripts to get networking done

#Setup tap and bridge 
tunctl -t tap0 -u user
ifconfig tap0 up
brctl addbr br0
brctl setfd br0 0
ifconfig br0 netmask broadcast up
brctl addif br0 tap0 
ifconfig tap0
sysctl net.ipv4.ip_forward=1
iptables --table nat -A POSTROUTING --out-interface wlan0 -j MASQUERADE

And this  slightly modified /etc/qemu-ifup  (place it in /etc/qemu-ifup)

#! /bin/sh
# Script to bring a network (tap) device for qemu up.
# The idea is to add the tap device to the same bridge
# as we have default routing to.

# in order to be able to find brctl
ip=$(which ip)

if [ -n "$ip" ]; then
ip link set "$1" up
brctl=$(which brctl)
if [ ! "$ip" -o ! "$brctl" ]; then
echo "W: $0: not doing any bridge processing: neither ip nor brctl utility not found" >&2
exit 0
ifconfig "$1" up

switch=$(ip route ls |
awk '/^default / {
for(i=0;i<NF;i++) { if ($i == "dev") { print $(i+1); next; } }


# only add the interface to default-route bridge if we
# have such interface (with default route) and if that
# interface is actually a bridge.
# It is possible to have several default routes too
for br in $switch; do
if [ -d /sys/class/net/$br/bridge/. ]; then
if [ -n "$ip" ]; then
ip link set "$1" master "$br"
brctl addif $br "$1"
exit # exit with status of the previous command

echo "W: $0: no bridge for guest interface found" >&2

Here is my loader script to make things easier

./qemu-system-ppc -m 192 -M 40p -bios q40pofw-serial.rom -serial telnet::4441,server -hda aix-hdd.qcow2 -cdrom ./cd.iso -net nic -net tap -vga none -nographic

So once we have AIX 5.1 installed we can start setting it up a little, I will include only short work-log notes I have made during my experimentation (which is still ongoing) so will probably add more as time goes by. I assume you have at least basic knowledge of some sort of UNIX environment.

You will need a good deal of additional software installed (I have used Michael Perzl’s legendary AIX Open Source Packages repo) from here ->

To save some time I have collected all the needed RPMs (You will love the RPM dependency hell on these legacy UNIX systems, trust me) to my repository,  which can be downloaded from here you should install all the RPMs from there. To transfer these packages to the emulated AIX 5.1 you can use ftp for example.

# rpm -Uvh name-or-package.rpm

To get a nice remote X11 desktop I use Xephyr (this will only work if your network is configured and works)

On AIX run 
# /usr/X11/bin/xdm

On Linux 
$ Xephyr -screen 980x640 -ac -query :3

Compiling OpenSSH on AIX 5.1

Since AIX 5.1 does not have any kernel support for prng pseudodevices, there is no /dev/rand or /dev/urandom   So in order to compile OpenSSH we need to first download and build prngd

You can download it from my repo from  here Or get it from Sourceforge project page

Unpack the sources e.g.:

# gunzip -c prngd-0.9.29.tar.gz | tar xvf -
# cd prngd-0.9.29

Modify the Makefile according to the OS version:

# ln -s /usr/bin/gcc /usr/bin/cc

then build it

# gmake clean
# gmake

Install into some convenient directory, e.g.:

# cp contrib/AIX-4.3/prngd.conf.aix43 /etc/prngd.conf # entropy gathering commands
# cp in/prngd /usr/sbin/prngd

Configure it next  and create a subsystem:

# cat /var/adm/wtmp > /etc/prngd-seed # random seed
# mkssys -s prngd -p /usr/sbin/prngd -a '-f -c /etc/prngd.conf -s /etc/prngd-seed /dev/egd-pool' -u 0 -S -n 15 -f 9 -R -G local
# startsrc -s prngd

Add to /etc/rc.local:

startsrc -s prngd # start the subsystem on boot

Next we can download/compile OpenSSH , latest version that builds and works well is 6.9p1

OpenSSH 3.5p1 –> builds fine and works

# ./configure --with-prngd-socket=/dev/egd-pool
# gmake
# mkuser -m sshd
# gmake install

OpenSSH 4.9p1 — OK
OpenSSH 5.9p1 — OK
OpenSSH 6.9p1 — OK

# ./configure --with-prngd-socket=/dev/egd-pool
# gmake
# mkuser -m sshd
# gmake install
0509-150 Dependent module libcrypto.a( could not be loaded.
# ln -s /opt/freeware/lib/libcrypro.a /usr/lib
# gmake install

Next I have added some hints that migth get one going more

To get libm.a match libraries installed mount CD1 of AIX 5.1 and upload the bos.adt from CD1/intallp/ppc/bos.adt to the virtual AIX 5.1 and install it

# installp -acF -d . bos.adt

Additionally one can install more stuff like IBM C compilers and X11.motif X11.adt ..

# installp -acF -d . X11.adt 
# installp -acF -d . X11.motif

You can then do many things … one of the experients was compiling Prboom

You can try the binaries here

Latest Elinks 0.13 

You can download the compiled RISC System/6000 binary+source here , just untar and gmake install

Latest stable PKGSRC Q1-2019 fails to bootstrap with the following error

To install CDE and run it instead of the boring mwm get the following packages from the CD1

Nice command to list last installed AIX packages via installp (from

lslpp -qch | awk -F: '{printf "%-14s %-40s %-15s\n",$7,$2,$3}' |
sort | uniq | sed 's/70/-70/' | sort -t '/' -k 3,3n -k 1,1n -k 2,2n |
sed 's/-70/70/'

Here are the Dt relevant ones one needs

05/03/19 OpenGL.GL32.adt.demos 
05/03/19 OpenGL.GL32.adt.include 
05/03/19 OpenGL.GL32.adt.samples 
05/03/19 OpenGL.GL32.rte.base 
05/03/19 OpenGL.OpenGL_X.adt.include 
05/03/19 OpenGL.OpenGL_X.adt.samples 
05/03/19 OpenGL.OpenGL_X.rte.base 
05/03/19 OpenGL.OpenGL_X.rte.base+ 
05/03/19 OpenGL.OpenGL_X.rte.base_mp 
05/03/19 OpenGL.OpenGL_X.rte.pipe++ 
05/03/19 OpenGL.OpenGL_X.rte.pipe64++ 
05/03/19 OpenGL.OpenGL_X.rte.soft 
05/03/19 X11.adt.bitmaps 
05/03/19 X11.adt.ext 
05/03/19 X11.adt.imake 
05/03/19 X11.adt.include 
05/03/19 X11.adt.lib 
05/03/19 X11.adt.motif 
05/03/19 X11.vfb 
05/05/19 X11.Dt.ToolTalk 
05/05/19 X11.Dt.bitmaps 
05/05/19 X11.Dt.helpinfo 
05/05/19 X11.Dt.helpmin 
05/05/19 X11.Dt.helprun 
05/05/19 X11.Dt.lib 
05/05/19 X11.Dt.rte 
05/05/19 X11.apps.aixterm 
05/05/19 X11.apps.clients 
05/05/19 X11.apps.config 
05/05/19 X11.apps.custom 
05/05/19 X11.apps.msmit 
05/05/19 X11.apps.rte 
05/05/19 X11.apps.util 
05/05/19 X11.apps.xdm 
05/05/19 X11.apps.xterm 
05/05/19 X11.base.common 
05/05/19 X11.base.lib 
05/05/19 X11.base.rte 
05/05/19 X11.base.smt 
05/05/19 X11.fnt.Gr_Cyr_T1 
05/05/19 X11.fnt.coreX 
05/05/19 X11.fnt.defaultFonts 
05/05/19 X11.fnt.ibm1046 
05/05/19 X11.fnt.ibm1046_T1 
05/05/19 X11.fnt.iso1 
05/05/19 X11.fnt.iso2 
05/05/19 X11.fnt.iso3 
05/05/19 X11.fnt.iso4 
05/05/19 X11.fnt.iso5 
05/05/19 X11.fnt.iso7 
05/05/19 X11.fnt.iso8 
05/05/19 X11.fnt.iso8_T1 
05/05/19 X11.fnt.iso9 
05/05/19 X11.fnt.iso_T1 
05/05/19 X11.fnt.ksc5601.ttf 
05/05/19 X11.fnt.util 
05/05/19 X11.motif.lib 
05/05/19 X11.motif.mwm 
05/05/19 X11.vsm.lib 
05/05/19 bos.txt.bib 
05/05/19 bos.txt.hplj.fnt 
05/05/19 bos.txt.ibm3812.fnt 
05/05/19 bos.txt.ibm3816.fnt 
05/05/19 bos.txt.spell 
05/05/19 bos.txt.tfs 
05/05/19 bos.txt.ts 
05/05/19 xlC.aix50.rte 
05/05/19 xlC.cpp 
05/05/19 xlC.rte

Once we have these on place we create a backup of a few files

# mv /usr/lib/X11/xdm/Xsession  /usr/lib/X11/xdm/Xsession.mwm
# cp /usr/dt/bin/Xsession /usr/dt/bin/Xsession.cde

Now the CDE (dt) Xsession has some strange keboard configurations that 
will effectively mess up the CDE session if you would want to use 
the keyboard (which we want) so I have modified it a little and uploaded 
to my site which you can get here

# cp Xsession.cde /usr/lib/X11/Xsession 
# /usr/bin/X11/xdm

And on the Linux machine that runs qemu-system-ppc 

$ Xephyr -screen 980x640 -ac -query :3

We get a nice CDE desktop finally

Be patient, full CDE takes about 1 minute to load


About astr0baby

Please run Adblock or similar... we have been told to do so since Carl Sagan wrote the Contact .
This entry was posted in Uncategorized. Bookmark the permalink.

19 Responses to Running AIX 5.1 on qemu-system-ppc

  1. MJ says:

    Next step: Crysis

  2. MJ says:

    AIX 5.1 do have OpenGL support? I remember that 5.2 does have.

  3. MJ says:

    Isn’t the Quake port an official one that IBM requested?

  4. thomas says:

    The en0 network adaptor did not work, the error message was 0821-510 ifconfig: error calling entry point for /usr/lib/drivers/if_en: Cannot establish a connection to a remote service.

    • astr0baby says:

      Networking in AIX 5.1 under QEMU works

      Please read Artyom’s original entry here

      It looks like the PCNet driver (aka kent) is broken in AIX 5.1. I think the “busio” value used to look different in the previous versions. The networking can still be set up. After performing the install login as root and do the following (^D and ^C are Control-D and Control-C respectively):

      # cat > lance-chg.asc
      name = “ent0”
      attribute = “busio”
      value = “0x01000000”
      type = “O”
      generic = “D”
      rep = “nr”
      nls_index = 3
      # odmchange -o CuAt -q “name=ent0 and attribute=busio” lance-chg.asc
      # rmdev -l ent0
      # mkdev -l ent0
      # ifconfig en0
      # ping
      PING ( 56 data bytes
      64 bytes from icmp_seq=0 ttl=255 time=4 ms
      64 bytes from icmp_seq=1 ttl=255 time=3 ms

  5. Vasileios Skouras says:

    Does this guide apply for setting AIX through qemu on Windows as well ?
    Thank you.

  6. megastallman says:

    Hi guys! Please help, I still can’t get Xephyr working
    === On my side:
    :~/AIX$ Xephyr -screen 980×640 -ac -query :3
    Fatal server error:
    (EE) XDMCP fatal error: Session failed Session 3 failed for display 19
    :~/AIX$ Xephyr -screen 980×640 -ac -query :3
    XDM: too many retransmissions, declaring session dead
    XDM: too many retransmissions, declaring session dead
    === On AIX:
    * Suspending Desktop Login…
    * Press [Enter] for a login prompt.
    * Log in. Desktop Login will resume shortly after you log out.

    * Resuming Desktop Login…

    * Suspending Desktop Login…
    * Press [Enter] for a login prompt.
    * Log in. Desktop Login will resume shortly after you log out.
    I just see this banner in a loop. Looks like X fails to start because no video hardware found.

    • astr0baby says:

      You need to run Xephyr on a X11 Linux environment, if you don’t have Xephyr you can use Xming

      • megastallman says:

        I’m running Linux. Kubuntu 18.04.
        ‘:~/AIX$’ – is actually a directory with AIX images on my Kubuntu system.
        The problem is, that it still drawing me a black window when I try to connect to both aix an hpux qemu-VMs.

      • astr0baby says:

        Worst case you can try Xming through wine – it works as well, but generally Im not sure why you not getting the remote X11 from the Xephyr/Xnest connection. Can you send over some screenshots how it looks like when you try to connect to it ?

  7. megastallman says:

    I don’t know why it happens either, here is my screenshot:
    Network works, xdmcp seems started, but still I get the black screen.

  8. Pingback: The Server Room Show – Episode 67 – AIX – The Server Room Show

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 )

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.