Installing AIX on Qemu!

YES it’s real!

I’m using the Linux subystem on Windows, as it’s easier to build this Qemu tree from source. I’m using Debian, but these steps will work on other systems that use Debian as a base.

First thing first, you need to get your system with the needed pre-requisites to compile:

apt-get update;apt-get upgrade apt-get install build-essential pkg-config libz-dev libglib2.0-dev libpixman-1-dev libfdt-dev

Great with those in place, now clone Artyom Tarasenko’s source repository

git clone --branch 40p-20190406-aix-boots --single-branch https://github.com/artyom-tarasenko/qemu.git

Since the frame buffer apparently isn’t quite working just yet, I configure for something more like a text mode build.

./configure --target-list=ppc-softmmu --disable-sdl --disable-vnc --disable-gtk

Now for me, GCC 7 didn’t build the source cleanly. I had to make a change to the file config-host.mak and remove all references to -Werror. Also I removed the sound hooks, as we won’t need them. remove the following lines:

CONFIG_AUDIO_DRIVERS=oss CONFIG_AUDIO_OSS=m

Now you can build Qemu. it’ll happily build in parallel so feel free to build using the -j parameter with how many cores you have. I have 32, so I use

make -j32

Okay, all being well you now have a Qemu. Now following the steps from
Artyom Tarasenko’s blog post, we can get started on the install!

First we create a 8GB disk

qemu-img create -f qcow2 aix-hdd.qcow2 8G

Next we need the custom BIOS with serial as the console.

wget https://github.com/artyom-tarasenko/openfirmware/releases/download/40p-20190413/q40pofw-serial.rom

You’ll need some AIX. I tried a 3.2.5 CD-ROM and it didn’t pick up, but AIX 4.3.3 did.

Now with all those bits in place, it’s time to run Qemu.

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

Now telnet to your localhost on port 4441 and you will see the console doing it’s BIOS initialize and eventually drop to the OK prompt.

One trick I’ve found is that from the Open Firmware prompt you can find out what partitions are recognized from the firmware. If it see’s partitions then there is some hope that the image you have is valid enough to boot. In the last few days I’ve found quite a few AIX images, which are lacking the partition table, and unable to boot.

.partitions cdrom

simply type in boot cdrom:2 to kick off the installer. It may take a minute or so for the installer to kick off.

If all goes well, you’ll see the BIOS reload itself, then after a minute you’ll be prompted to press 1 to select the console

It doesn’t echo, don’t panic!

Next select your language. I’m doing English.

Next it’ll ask about installation type. Default ought to be fine.

Because this will destroy the contents of the disk (which doesn’t matter as it’s blank) it’ll prompt for confirmation.

After this it’ll begin the installation. Depending on how fast your disk & CPU is this will take a while.


For me, the installation took about 11 minutes. This is using my Xeon E5-2667 v2. It took 17 minutes on my 2006 Mac Pro, with X5365’s it .

After it’s done, right around the 96% time it’ll reboot back to the BIOS

Once you are back at the OK prompt, you can now boot disk:

it’ll look like it’s hung for a minute, then it’ll start booting from disk!

Once the OS is booted up, you select the terminal type. I’m using putty but I’ll select the vt100. Of note the function keys are selected by hitting escape and then the number key. So F3 is ESC 3.

I’m just going to finish the install, as we can always run smitty to mess with the system more, but right now I’m just interested in a base install of the BOS (Base Operating System, and IBM ISM).

A few moments later, you’ll get dumped to the login prompt.

By default there is no password, so just login as root, and there you go, your very own virtual AIX 4.3 system.

# uname -a AIX localhost 3 4 000000004C00

So there you go! All thanks to Artyom’s hard work!

39 thoughts on “Installing AIX on Qemu!

  1. AIX 4.1 was the first version to support PCI, which was the bus type starting with the PowerPC range. Version 3.2 and older require Micro Channel.

    It’s interesting that 4.1 installs directly. Chris Gibson at IBM wrote an article on how to get AIX 7.2 running under QEMU but this requires restoring a mksysb image so you need to already have an AIX LPAR running from where you can collect a mksysb backup.

    • Its because AIX would display an error code on the hardware LCD display, which Sun hardware did not have. I wrote a clock program that displayed current time on the LCD. Lets just say IBM service technicians did not approve.

    • mount an aix4 installer .iso install image, mount it with appropriate fs specitication when invoking mount, and then find some binaries and “file” them from your favourite host system – if neozeed remained unreachable ๐Ÿ™‚

    • If AIX has ELF it must be something much later, as I recall it always being COFF.

      # file /bin/sh
      /bin/sh: executable (RISC System/6000) or object module

      I know this isn’t what you are looking for.

  2. Oooh, thanks for the QEMU hacks Artyom and thanks for the find Jason.

    I started working with this in the mid to late 90s on Bull DPX/20s (think drawer cabinet with a block of concrete at the bottom). I bootstrapped Samba on it to manage classrooms with NT4 workstations. It hosted ghost images, $HOME to H:\, web pages (via~/public_html), shell accounts with mail, JDK, C-compilers. It ran Oracle instances and a GCOS 6 emulators too while that poor windows server was sulking in a corner trying not to blue-screen whilst playing BDC.

    My current shop tossed the AIX blades for RedHat VMs a few years ago and damn I miss that OS. What is it with AIX that grows on you? The 400+ day uptimes despite patches? The perfect blend of SYSV and BSD? The Rockwell grade of closed source? The absence of Bostic and Stallman’s smelly socks? The admins it attracts? I don’t know.

    Probably have to network it over serial, but I’ll give 4.3 a spin. Thanks again.

    • I got my start on version 3.2(1) on the POWER 520 in college. It was the first time I saw an actual class on learning UNIX as a user, and it was super valuable. During the class I was on one of my local BBS and found this weird thing called SLS Linux. It took about a week to download enough @ 2400 baud to get enough where I could bootstrap it.

      The price gulf between consumer 32bit machines (which were still pretty expensive!) and the RISC machines of the day was just so incredibly high. Not to mention the incredible expense of getting your own UNIX @home was just insurmountable to me. If I’d known 386BSD was a thing I’d have used that, but I don’t recall a single peep about it on usenet. For better or worse groups stayed on topic pretty well, so you would learn new things about something, but not necessarily learn about new things.

      But AIX was the first real Unix I messed around with for real. Even though in highschool we did have that QNX garbage network on the Unisys ICONs, but I didn’t have any books or resources on Unix, nor did the teachers have any idea how to really use the stuff. Sadly back in the 80’s if it wasn’t in the library it was like being SOL as I just didn’t know enough to order stuff I didn’t know about. Electronic card catalogs just didn’t exist, and I couldn’t order stuff that I just didn’t know about. I really should have paid the $99 and mail ordered coherent, but I was brought up to distrust mail-order stuff. So stupid.

      the AMD PCnet driver will load on 4.1.5 but as soon as I try to telnet in, it’ll lock Qemu up hard. I’ll have to build it on a native Linux machine to see if it’s Qemu or what. I tried the following flags:

      ./ppc-softmmu/qemu-system-ppc -M 40p -bios q40pofw-serial.rom -serial telnet::4441,server -hda aix0.vmdk -vga none -nographic -L pc-bios -net nic,model=pcnet -net user,hostfwd=tcp::42323-:23

      or

      ./ppc-softmmu/qemu-system-ppc -M 40p -bios q40pofw-serial.rom -serial telnet::4441,server -hda aix0.vmdk -vga none -nographic -L pc-bios -netdev user,id=ethernet.0,hostfwd=tcp::42323-:23 -device pcnet,netdev=ethernet.0

      Oh well.

      • I think it’s a hostfwd bug. I hit it a couple of times with qemu-system-sparc, but had no reliable way to reproduce. Usually it worked like months with no problems. Would be cool if you could make a bug report for it (maybe it’s easier to wait till my patches are accepted in the upstream first though).

        The workaround would be a ssh reverse tunnel. You gonna need the ssh client for AIX 4.3.3 though. Don’t know if there is one compatible with the current servers.

        BTW, why are you using vmdk? qcow2 has compression and snapshots. Does vmdk have any advantages for non x86 guests?

        • VMDK will slip into VMWare okay. I always wanted to see if those JFS patches for Linux could actually read a disk from an RS/6000. I suspect the answer is no, but it seemed easier to to use VMDK.

          I think it was somewhere in the 0.9-1.0 days that qcow2 broke stuff badly, but I’ve been gunshy on that one for years now….

          I noticed that outbound seemed okay, but as soon as I went to go in, it went off the rails.

          I have that GNAT GCC thing somewhere, I guess I can go through the motions and build a gcc 2.something chain. pass1 is fine by me.

            • It’s more so a call back to sing ADA to fix your systemโ€ฆ, where I had re-created the painful steps of getting a bare bones GCC to a RS/6000 over dialup when I was in college, to get something kicked off on the SUN/SPARC emulation in Qemu.

              I’m always glad when people make binaries (along with sources/patches) available as this stuff does tend to fall off the face of the earth once people decide it’s all garbage. I just recently found the patches to GAS to generate COFF objects, and the Xenix patches for GCC 1.x, which is another source of frustration in the open source past obliteration efforts.

              Speaking of.. there is a lot of gems on this CD-ROM, although they are naturally missing all the big stuff like GCC gnu libs, G++, etc etc.

    • Nice blog! I see we have some overlap which is always a good thing.

      I need to update all the gunkies stuff. SIMH 4.0 is never going to really happen…

  3. 0821-510 ifconfig: error calling entry point for /usr/lib/drivers/if_en: Cannot establish a connection to a remote service.
    I tried to make the network adaptor work, but got the message, any idea?

  4. I try to use the configure step but it won’t work. Can you please help me ?
    Below is a copy-paste of the cmd window

    [email protected]:/home/skoubi# ls
    qemu
    [email protected]:/home/skoubi# cd qemu
    [email protected]:/home/skoubi/qemu# ls
    CODING_STYLE bootdevice.c exec.c migration qemu-io.c scripts
    COPYING bsd-user fpu module-common.c qemu-keymap.c scsi
    COPYING.LIB bt-host.c fsdev monitor.c qemu-nbd.c slirp
    Changelog bt-vhci.c gdb-xml nbd qemu-nbd.texi stubs
    HACKING capstone gdbstub.c net qemu-option-trace.texi target
    LICENSE chardev hmp-commands-info.hx numa.c qemu-options-wrapper.h tcg
    MAINTAINERS config-temp hmp-commands.hx os-posix.c qemu-options.h tests
    Makefile config.log hmp.c os-win32.c qemu-options.hx thunk.c
    Makefile.objs configure hmp.h pc-bios qemu-seccomp.c tpm.c
    Makefile.target contrib hw po qemu-tech.texi trace
    README cpus-common.c include qapi qemu.nsi trace-events
    VERSION cpus.c io qdev-monitor.c qemu.sasl ui
    accel crypto ioport.c qdict-test-data.txt qga util
    arch_init.c default-configs iothread.c qemu-bridge-helper.c qmp.c version.rc
    audio device-hotplug.c job-qmp.c qemu-deprecated.texi qobject vl.c
    backends device_tree.c job.c qemu-doc.texi qom win_dump.c
    balloon.c disas libdecnumber qemu-edid.c qtest.c win_dump.h
    block disas.c linux-headers qemu-ga.texi replay
    block.c dma-helpers.c linux-user qemu-img-cmds.hx replication.c
    blockdev-nbd.c docs memory.c qemu-img.c replication.h
    blockdev.c dtc memory_ldst.inc.c qemu-img.texi roms
    blockjob.c dump.c memory_mapping.c qemu-io-cmds.c rules.mak
    [email protected]:/home/skoubi/qemu# ./configure –target-list=ppc-softmmu –disable-sdl –disable-vnc –disable-gtk

    ERROR: Python not found. Use –python=/path/to/python

    [email protected]:/home/skoubi/qemu#

    • So you need a Python. Probably all kinds of other things too.

      Don’t panic just read the last line.

      What OS is that? You’ll want their instructions on installing Python.

      • Thanks for the fast reply !
        I have Linux Subsystem on Windows and downloaded and installed from the App Store the Ubuntu 18.04 LTS. I have read that Ubuntu is based on Debian, so I chose that distro.

          • Or try this:
            apt-get build-dep qemu-system-ppc

            Read the manpage pls before, HTH:

            [email protected]:0:~$ dpkg -l | grep qemu-system-ppc | tr -s ‘ ‘
            ii qemu-system-ppc 1:2.5+dfsg-5ubuntu10.39 amd64 QEMU full system emulation binaries (ppc)
            [email protected]:0:~$ man apt-get | sed ‘/^ *build-dep *$/,/^$/!d’
            build-dep
            build-dep causes apt-get to install/remove packages in an attempt
            to satisfy the build dependencies for a source package. By default
            the dependencies are satisfied to build the package natively. If
            desired a host-architecture can be specified with the
            –host-architecture option instead.

            [email protected]:0:~$

          • Indeed .
            /.configure run smoothly, then I used vim to remove the the CONFIG lines but make returned errors. I deleted qemu folder, started again and used make (without -j, it gave me errors). That went ok too. Then I tried to create the image with the qemu-img and the below message came up. Strange though since the qemu folder contains the qemu-img.

            [email protected]:~/qemu# qemu-img create -f qcow2 aix-hdd.qcow2 8G
            Command ‘qemu-img’ not found, but can be installed with:
            apt install qemu-utils
            [email protected]:~/qemu#

              • I did it !
                Thanks neozeed and everyone else for their advice.
                A couple of points, that i ran into, since I’m not an experienced linux user and would like to mention for anyone else interested..
                1. I used WSL (Linux Subsystem on Windows). It is easily available from Microsoft herself.
                2. From the Windows App store , I chose Ubuntu and it was installed automatically. (note: It installs the bare minimum for terminal purposes)
                3. Installed Python (per neozeed): apt-get install build-essential python
                4.In order to change config-host.mak , you have to be able to edit it. Simple, yes ? No, not at all when you don’t know jack about linux. I had to learn a bit the vim editor. So : vim config-host.mak. There I deleted the -Werror references towards the end of file.
                Don’t delete the lines :
                CONFIG_AUDIO_DRIVERS=oss
                CONFIG_AUDIO_OSS=m
                because the make command will ask for them and give you errors. Instead change them to :
                CONFIG_AUDIO_DRIVERS=
                CONFIG_AUDIO_OSS=
                5. I used the make command without parameters (-j4 for my i7 cpu, didn’t work) The whole compile process took about 10-15 minutes.
                6. Inside the qemu folder run :. /qemu-img (as neozeed said, Unix isn’t MS-DOS)

                I had to devote a fair amount of time, reading various links about the commands in linux, but it was worth it.
                Now I want to try and install the CDE environment and afterwards the CATIA V4 CAD/CAM. I can only imagine that it will take me a lot of time but thanks to you I’m off to a good start.

  5. Thanks a Lot for this article; I’m trying to get AIX 4.3.3 to work with newtorking; I’m using this command:
    ./ppc-softmmu/qemu-system-ppc -M 40p -bios q40pofw-serial.rom -serial telnet::4441,server -hda aix-hdd.qcow2 -vga none -nographic -netdev tap,id=mynet0 -device model=ne2K_isa, -cdrom Volume_1.iso

    However I get this error:
    qemu-system-ppc: network script /etc/qemu-ifup failed with status 256

    Is there any way I can mark /etc/qemu-ifup as executeable? I cannot seem to locate this script anywhere. (Either in the ETC or other directories).

  6. Hi, running into this issue when running configure:

    ./configure –target-list=ppc-softmmu –disable-sdl –disable-vnc

    ERROR: Unknown target name ‘ppc-softmmu’

    Running gentoo linux (honestly fuck debian), anything I could be missing?

      • Good morning,

        Thanks for writing back! Yes, I did in fact clone it from the repo, but as far as the ‘split’ your talking about, that’s something I never took into consideration; documentation on my specific issue has been nonexistent and good luck going to qemu IRC about it, basically no one’s on there to take your question.

        I *did* get a hold of Aqemu, a GUI to qemu that was hosted on Gentoo’s Portage repo. It could point to the cloned git but it needed a ‘binary executable’ that i just can’t seem to find :/

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.