Running HP-UX 11.11 on qemu-system-hppa

Last of the major commercial UNIX systems that I wanted to see emulated is the legendary HP-UX (Hewlett Packard Unix)  (more information on the Wikipedia https://en.wikipedia.org/wiki/HP-UX )  And since last week we had the Gregorian Calendar Easter and today we have the Julian Calendar Easter it is a symbolic Resurrection  of HP-UX

The emulated machine is a HP B160L desktop machine

It was quite a surprise when I noticed  Sven Schnelle (https://github.com/svenschnelle) mention that HP-UX now runs under qemu-system-hppa, so I wanted to test and try it of course.

https://parisc.wiki.kernel.org/index.php/Qemu

I am running all my emulation experiments solely on Linux x86_64 (Linux Mint 19.1) and all the networking support is strictly Linux only so if you wish to reproduce this on macOS or Windows you are on your own there.

I have git-cloned recent qemu from ( https://github.com/qemu/qemu)  and built only the  hppa emulation (you can build the whole thing of course)

$ mkdir -p $HOME/KVM/HPUX
$ cd $HOME/KVM/HPUX
$ git clone https://github.com/qemu/qemu.git
$ cd qemu 
$ ./configure --target-list=hppa-softmmu
$ make 

Copy the compiled qemu-system-hppa binary to your working directory

$ cd $HOME/KVM/HPUX
$./qemu-system-hppa --version 
QEMU emulator version 3.1.93 (v4.0.0-rc3-4-g13c24edaa7-dirty)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

So now we are almost ready with the installation, but before that we need to make sure a couple of per-requisites are met. Main thing is of course the installation media which was ( HP-UX B.11.11) found in the deep corners of the internet ..

CD1 https://drop.me/MY0mqq
CD2 https://drop.me/MzP4Ry
CD3 https://drop.me/opL13Z
CD4 https://drop.me/M0yxgZ

If the above does not work (drop.me sometimes does this) you can get the ISOs here

https://gopherproxy.meulie.net/xepb.org/1/unix/hpux/hpux_install/

For the conveniences sake I have called the HP-UX 11.11 ISOs as follows (place them in your working directory that holds qemu-system-hppa binary as well as the disk images, etc)

-rw-rw-r-- 1 user user 642865152 Apr 28 00:43 hpux11-01.iso
-rw-rw-r-- 1 user user 357793792 Apr 28 00:51 hpux11-02.iso
-rw-rw-r-- 1 user user 648380416 Apr 28 00:57 hpux11-03.iso
-rw-rw-r-- 1 user user 309100544 Apr 28 00:55 hpux11-04.iso

Next we need to make sure the qemu networking is setup (tun/tap and bridge)  Below is my network sharing script one needs to execute under root prior the emulation

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

Note:Seems that networking support is not implemented yet in qemu-system-hpp following is in the to-do list  (https://parisc.wiki.kernel.org/index.php/Qemu )

  • Emulate Lasi (i82596) and Tulip (DEC 21×40) network cards in Qemu

Next make sure you have the following /etc/qemu-ifup  script in place

#! /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
PATH=$PATH:/sbin:/usr/sbin
ip=$(which ip)

if [ -n "$ip" ]; then
ip link set "$1" up
else
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
fi
ifconfig "$1" 0.0.0.0 up
fi

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

switch=br0

# 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"
else
brctl addif $br "$1"
fi
exit # exit with status of the previous command
fi
done

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

Next we need to define a disk image (HP-UX 11.11 will need a full raw disk image, default qemu-img create -f qcow2 hpux.img 8G will NOT WORK !)

$ cd $HOME/KVM/HPUX
$ dd if=/dev/zero of=hpux.img bs=1024 count=8M

Next we define the HP-UX installation loader script to make things easier

$ cd $HOME/KVM/HPUX
./qemu-system-hppa -boot d -serial telnet::4441,server -drive if=scsi,bus=0,index=6,file=./hpux.img,format=raw -serial mon:stdio -D /tmp/foo -nographic -m 512 -d nochain -cdrom ./hpux11-01.iso -D /tmp/foo -net nic -net tap

OK So we are almost ready, but just one last thing before we fire up the installation (We all love green don’t we ?) get yourself the super cool retro-terminal from here https://github.com/Swordfish90/cool-retro-term  Im using it in my examples below in case you wonder from where the screenshots come from ( Remember the good old terminal days when things seemed simple ?)

So lets start the HP-UX 11.11 emulation now

root@panasonic:/home/user/KVM/HPUX/HP-UX-11.11# ./install.sh 
qemu-system-hppa: -serial telnet::4441,server: info: QEMU waiting for connection on: disconnected:telnet:0.0.0.0:4441,server
QEMU 3.1.93 monitor - type 'help' for more information
(qemu)

You need to connect to the qemu telnet server via a good terminal emulator (retro-terminal is quite good)

$ telnet localhost 4441

After a shor time you will get kicked into the installation menu if all went right

Select Additional Software what you want to get installed (mind we only created 8GB disk)

Now we need patiance, since it can take some time (1hr – 2 hrs depending on what we chose to install)  to finsh.

Eventually it will finish

We will need to provide a CD2 installation image now

(qemu) change scsi0-cd2 ./hpux11-02.iso

The installer will continue now

Sweet CDE installing now

Once the CD2 finishes we get instructed to insert CD3

(qemu) change scsi0-cd2 ./hpux11-03.is

And the installer will continue

Yet again we get promped for the last CD4

(qemu) change scsi0-cd2 ./hpux11-04.iso

And the installer will continue again

And finally it will FINISH !

We will need to change the loader script for qemu-system-hppa to tell it to boot the new disk instead of the CD

./qemu-system-hppa -boot c -serial telnet::4441,server -drive if=scsi,bus=0,index=6,file=./hpux.img,format=raw -serial mon:stdio -D /tmp/foo -nographic -m 512 -d nochain -cdrom ./hpux11-01.iso -D /tmp/foo -net nic -net tap

Now again this will take some time to get through first boot; populating /dev/; setting up post-installation scripts etc .. so be patient

Note that the setup-process will take long to process CIM Repository ( This is something that is observed by others on real HW HP-UXes ( https://community.hpe.com/t5/Server-Management-Systems/Why-does-it-take-so-long-to-build-the-CIM-repository-on-HPUX/td-p/4931711)   You can just CTRL+C if you don’t want to wait – I did

It will shortly go for shutdown procedure (with a nasty FAILURE message since we broke the CIM Repository setup) but it does not matter, just load the simulation again

./qemu-system-hppa -boot c -serial telnet::4441,server -drive if=scsi,bus=0,index=6,file=./hpux.img,format=raw -serial mon:stdio -D /tmp/foo -nographic -m 512 -d nochain -cdrom ./hpux11-01.iso -D /tmp/foo -net nic -net tap

This time it will start booting properly

And we will be greeted with System options menu to configure (GeoCustoms)

Finally we land up in network configuration menu

Press [y]

Choose [n] since we will setup networking manually

Choose [y]

Choose hostname : UNIX    (feel free to experiment here, but there are some pretty wild rules for defining 8char$  max hostname)

Setup your time zones, root password..

Next we setup our IP – I have used 10.0.2.12 and define subnet and gateway IP  (IT WILL FAIL TO VERIFY)

Setup other networking parts

NETWORK WILL FAIL TO VERIFY

And finally it will continue booting ….

I guess some work after login needs these to address (networking)

Configure LAN interfaces …………………………………….. FAIL *
Starting HP-UX Secure Shell ………………………………….. FAIL *

Finally we land up in a root shell

# uname -a
HP-UX UNIX B.11.11 U 9000/778 2006243326 unlimited-user license
# 

And it looks like networking is not yet supported under qemu-system-hppa
https://parisc.wiki.kernel.org/index.php/Qemu

# ifconfig lan0
ifconfig: no such interface
# netstat -in
Name           Mtu Network            Address                 Ipkts      Opkts
lo0           4136 127.0.0.0          127.0.0.1                 166        166
# 

I will keep investigating this, since networking is an essential part of the whole simulation of HP-UX

Here are some notes I have gathered after the installation

To get rid of the annoying stuck message during boot process

NFS server (pid672@/net) not responding still trying

# /sbin/init.d/nfs.client stop
killing rpc.lockd
killing rpc.statd
killing biod
killing automount
# /sbin/init.d/nfs.server stop
# /sbin/init.d/nfs.core stop
stopping rpcbind

# cd /etc/rc.conf.d 
# ls -la nfs*
-r-xr--r-- 1 bin bin 2958 Apr 28 20:07 nfsconf
# 

Edit /etc/rc.confd.d/nfsconf  and change as follows

NFS_CLIENT=0
NFS_SERVER=0

Reboot

Here is a video demo of the HP-UX running under qemu

Advertisements

About astr0baby

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

45 Responses to Running HP-UX 11.11 on qemu-system-hppa

  1. MJ says:

    2019 is the year of PowerPC?
    Did you test CDE?

    • astr0baby says:

      I don’t think there is a working VGA framebuffer supported yet and I could not get the network up running yet (need to experiment more there) .. if network would work then CDE would be possible via remote X11

  2. Alexander Shukin says:

    But networking works in debian-10 in qemu-system-hppa out of the box (without qemu command-line parameters). Seems the problem is not in qemu itself. Ethernet interfaces get configured during HP-UX 11.11 boot, but lan configuration fails. In AIX 5.1 such an issue (ent0 available while en0 not) can be fixed via odmchange command (see A.Tarasenko How-To). I’m too new for HP-UX yet to find out).

    • astr0baby says:

      Networking works for me on all my qemu experiments (qemu-system-ppc/ppc64 and qemu-system-sparc) but not here with qemu-system-hppa – I suspect its because the not yet fully supported Lasi (i82596) and Tulip (DEC 21×40) network cards support in hppa, but Im not entirely sure.

  3. ChrisR says:

    Networking isn’t functioning because HPUX needs a driver for the interface.

    See how IOSCAN reports “unknown” for the network interface, which means that it cannot match a driver for this card.

    # ioscan
    H/W Path Class Description
    ==================================================
    bc
    8 bc Pseudo Bus Converter
    8/0 ba GSCtoPCI Bridge
    8/0/0/0 ext_bus SCSI C895 Fast Wide LVD
    8/0/0/0.2 target
    8/0/0/0.2.0 disk QEMU QEMU CD-ROM
    8/0/0/0.6 target
    8/0/0/0.6.0 disk QEMU QEMU HARDDISK
    8/0/0/0.7 target
    8/0/0/0.7.0 ctl Initiator
    8/0/1/0 unknown PCI Ethernet (8086100e)
    8/0/63 tty Built-in RS-232C
    48 processor Processor
    63 memory Memory

  4. Alexander Shukin says:

    I tried pcnet, rtl8139, e1000 and ne2k_pci& No luck.

    • astr0baby says:

      Qemu-system-hppa needs to emulate a network card that HPUX has drivers for, so hopefully the authors of the ehppa qemu will add it in the future.

  5. Gilberto Persico says:

    Trying HP/UX 11.11 on a core i7 3520m T430. Installer remains at 20 of 39 of 4th cd iso image for more than 12 hours. Qemu 4.0.0 “official” (not from gituhub, from the web site). Did you git clone a different trunk ? Have AIX 4 & 5 working, Solaris 2.6 & 9 working but all of them came up in a couple of hours at most.

    • astr0baby says:

      The installer takes some time, but 12hrs is a bit too long. I always build qemu from source from git.

    • Alexander Shukin says:

      My installation took about 2 hours. Core i5 2400.
      I think, if you downloaded a zip file from qemu.org, it may be a little older version than astrobaby (and me too) used (from git repo). May it make the difference?

      • Gilberto Persico says:

        Yes, it made. Just completed the install of HP/UX 11.11 on qemu-4.0.50 from git :-)
        Thanks
        Gilberto

  6. viktormadarasz says:

    Can it also run HP-UX 11i v3 ? I have the install ksl somewhere …. It d be nice to know as I am just about to buy an rx2660 just for HP UX for my Homelab ..

  7. raywjewhurst says:

    The link to CD number 3 is broken.

  8. Vincent says:

    All CDs have a broken link the CD link given to another persons appears to support a Series 700 system

      • Vincent says:

        I have a hard time trying to boot it regardless of recompiling Qemu on multiple versions. Qemu 4 does not seem to show the bios. Qemu 3 stays at HARD BOOT and goes no further, appears to be un-bootable. An older HPUX such as 10 fails with the Chassis fan although HPUX 9 kernel panics.

      • astr0baby says:

        What version of qemu are you running ? – It wont work on anything older that qemu-current from git.
        This is the version Im using which works for HP-UX 11.11 and HP-UX-10.20
        user@panasonic ~/KVM/HPPA/HP-UX-11.11 $ ./qemu-system-hppa –version
        QEMU emulator version 3.1.93 (v4.0.0-rc3-4-g13c24edaa7-dirty)
        Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

      • Vincent says:

        System version is
        qemu-system-hppa –version
        QEMU emulator version 3.0.1
        Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

        The git version where no BIOS shows – Just blank
        QEMU emulator version 4.0.50 (v4.0.0-1481-g33d6099906-dirty)
        Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

        The older compiled version from downloads

        ./qemu-system-hppa –version
        QEMU emulator version 3.1.0

      • astr0baby says:

        It works only with relatively new versions https://parisc.wiki.kernel.org/index.php/Qemu
        This version works just fine (try and get a git snapshot of this)
        QEMU emulator version 3.1.93 (v4.0.0-rc3-4-g13c24edaa7-dirty)
        Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

  9. Vincent says:

    The problem with compiled Qemus, you need to include a firmware file. I have managed successfully booted HPUX on Qemu 3.1.93 after including -bios hppa-firmware.img to the command line.

    Lack of firmware is what caused it to go blank,

    • astr0baby says:

      No you don’t need to, its all in the qemu git.

      • Vincent says:

        I got this to work, regarding the firmware file, if you use a git version and don’t make install it. It is needed to be in same dir as the executable, otherwise nothing shows on telnet. -bios option is not needed as you said.

        I noticed the HPUX install process is very long which had to be stopped during the time I tried it as it was running over time,.

        The Host installed this on is FreeBSD so their files are installed in different places to Linux.

        That cool terminal screen really does make it look like an old system that a friend descibed with an amber screen.

      • astr0baby says:

        Glad you got it running :) I did not build this on FreeBSD so Im not sure how that is handled there with the ports …. but on Linux I dont really need any firmware files in the path to run this.

        ./qemu-system-hppa -boot c -serial telnet::4441,server -drive if=scsi,bus=0,index=6,file=./hpux.img,format=raw -serial mon:stdio -D /tmp/foo -nographic -m 512 -d nochain -cdrom ./hpux11-01.iso -D /tmp/foo -net nic -net tap

      • Vincent says:

        I managed to re-run tnstall. Took nearly 4 hours to install. I had it screen recording the whole install on that cool terminal program while I watched movies on 2nd PC. Not tried to boot it until that screen recording is rendered after editing.

        FreeBSDs port qemu wouldn’t boot the cd, this lead to downloading the git versions. It compiled nicely.

        However FreeBSD’s port qemu was able to boot AIX 7.2 but a modified qemu was needed to boot AIX 5.1 and 4.3 done pretty much same way as for HPUX.

      • astr0baby says:

        Yes for AIX 5.1 and 4.3 you need the patched PReP/40p version (not merged to upstream yet)
        On Linux the HP-UX install took me 2 hours probably (with taking screenshots and writing the article …)

  10. Sven Schnelle says:

    Graphics support is on it’s way – i’ve implemented the graphics card from the HP9000/712. Just need to clean it up and get it merged upstream.

    So if you want to have a nice and modern (haha!) CDE like this:

    …stay tuned :)

  11. peterblood850 says:

    I’ve installed HPUX 11iv1 under qemu from 2006 version CDs. I have those because I have a HP D320 system at home. Anyone can provide info on how to copy HP D320 firmware?

  12. Thanks again for another inspirational post.
    They abandoned qemu on my new favorite platform FreeBSD :(
    Looks like I am forced to try this on Linux. Nothing happens after “HARD BOOTED”.

    Firmware Version 6.1

    Duplex Console IO Dependent Code (IODC) revision 1

    Memory Test/Initialization Completed

    ——————————————————————————
    (c) Copyright 2017-2018 Helge Deller and SeaBIOS developers.
    ——————————————————————————

    Processor Speed State Coprocessor State Cache Size
    ——— ——– ——————— —————– ———-
    0 250 MHz Active Functional 0 KB

    Available memory: 512 MB
    Good memory required: 16 MB

    Primary boot path: FWSCSI.6.0
    Alternate boot path: LAN.0.0.0.0.0.0
    Console path: SERIAL_1.9600.8.none
    Keyboard path: PS2

    Available boot devices:
    1. DVD/CD [lsi 00:00.0 2:0 Drive QEMU QEMU CD-ROM 2.5+]
    2. lsi 00:00.0 6:0 Drive QEMU QEMU HARDDISK 2.5+

    Booting from DVD/CD [lsi 00:00.0 2:0 Drive QEMU QEMU CD-ROM 2.5+]

    Booting…
    Boot IO Dependent Code (IODC) revision 153

    HARD Booted.

  13. ariel navarro says:

    Hello guys,
    Thanks for the great info here. I managed to compile qemu, install the OS and run sam, etc under amd64 machine. Now got really exited and want to run it on a raspberry pi 4. I have an old HP terminal that I am planning to hook through serial port.
    I can compile qemu on the pi (same procedure and same code), but on the rpi4 it is asking me for the firmware file. I am passing the hppa-firmware.img file with the -bios param, but nothing happens.

    Have anyone tried this before?

    Thanks!

  14. ariel navarro says:

    Awesome!! Thanks for testing that.

  15. Ariel E NAVARRO says:

    FYI, got it working on the rpi4 too. Started from scratch with raspbian-lite. Same procedure and it worked.Now experimenting with some perfo improvements “-smp cpus=1,cores=4,maxcpus=4” seems to work, not sure about any improvements. BTW, I will be great to have the links for 10.20 isos…

    Thanks again!

  16. VRC says:

    Great article! The best of its kind.It ran smoothly.Thanks to the author

  17. Casey says:

    Hi, does anyone know if the network support has been added in recent qemu releases.

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 )

Google photo

You are commenting using your Google 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.