Search

Saturday, November 9, 2019

HPUX 11i v1 (HPUX 11.11) PA-RISC Guest Virtualization using QEMU on FreeBSD Host

Supratim Sanyal's Blog: Virtual HPUX 11i CDE Desktop on QEMU for FreeBSD


HP-UX is one of the last great commercial-grade Unix derivatives of the legendary Unix System V, and is a mandatory installation for all retro-computing and Unix enthusiasts.

Unix history-simple.svg
By Eraserhead1, Infinity0, Sav_vas - Levenez Unix History Diagram, Information on the history of IBM's AIX on ibm.com, CC BY-SA 3.0, Link


I jumped on Astr0baby's recently published "Running HP-UX 11.11 on qemu-system-hppa" about running HP's solid enterprise-class HPUX Unix version 11i v1 (HPUX 11.11) on the venerable PARISC processor now emulated completely by QEMU. Proceeding to download the latest QEMU development source from github and building qemu-system-hppa on my FreeBSD Release-12 host running on a Dell PowerEdge 2950, and downloading the HPUX 11i ISO CD images, I fired up the QEMU virtual machine and soon had HP-UX Version B.11.11 running on a HP 9000/778/B160L.

Supratim Sanyal's Blog: HPUX 11i running in QEMU qemu-system-hppa on FreeBSD virtualization host


Remarkably, almost as soon as I had HPUX 11.11 running, the maintainer of QEMU HPPA emulator checked in new code that supports Digital Equipment Corporation's Tulip network card, as pointed out almost immediately by one of the folks following Astr0baby's post. A fresh pull and rebuild of the QEMU source enabled networking on the HPUX virtual machine, which also means the nostalgic HPUX CDE desktop environment is now accessible over network as in the screenshot above.

I prefer to use VDE (Virtual Distributed Ethernet) for my virtualization experiments. QEMU has great support for VDE networking as does Oracle VirtualBox. However, attempting to build QEMU with VDE configured on FreeBSD requires the VDE development library on FreeBSD which I have not located yet. Network connectivity is for now using standard TAP interfaces bridged into a VDE switch. The script that sets the VDE switch and bridges TAP interfaces into it is documented in my prior post here.

The script that launches the HPUX virtual machine looks like this:

#!/bin/sh

# Launches Guest:
# 10.42.2.55 hpux.sanyalnet.lan hpux

# Change -boot to d to boot from cdrom or c to boot from hdd

# Careful of MAC address conflicts in network! Last HEX pair of MAC = last byte of guest IP.
# Also, VNC screen, if any, on dispaly number = last byte of guest IP
# And Console TELNET port = 20800 + last byte of guest IP

TELNET_CONSOLE_PORT=20855
screen -m -d -S HPUX-QEMUMON \
./qemu-system-hppa \
    -boot c \
    -m 512 \
    -drive if=scsi,bus=0,index=0,file=./hpux-striped-8gb-disk-1.qcow2.dsk,format=qcow2 \
    -drive if=scsi,bus=0,index=1,file=./hpux-striped-8gb-disk-2.qcow2.dsk,format=qcow2 \
    -cdrom ./ISO/hpux11-01.iso \
    -net nic,model=tulip,macaddr="58:9C:FC:52:54:37" \
    -net tap,ifname=tap4,script=no \
    -serial telnet::${TELNET_CONSOLE_PORT},server \
    -serial mon:stdio \
    -nographic \
    -d nochain \
    -vnc :55 \
    ####-smp cpus=2 ## -accel tcg ###,thread=multi

sleep 2

screen -m -d -S HPUX-CONSOLE telnet localhost ${TELNET_CONSOLE_PORT}

echo At this point, qemu should be on screen HPUX-QEMUMON and console telnet session on screen HPUX-CONSOLE
echo You can launch a CDE Graphical Desktop Session using Xephyr like the following:
echo Xephyr -screen 1200x720 -ac -query 10.42.2.55 :55

sync;sync;sync
exit 0

For the HPUX/PARISC virtual machine, I configured two 8GB virtual disks and told HPUX to use the two disks as a striped logical volume group. The two virtual disks are in QEMU's QCOW v2 (acutally QCOW v3) format. Similar to RAID0, using disk striping promises to significantly improve performance, at the cost of providing 8GB total capacity despite the two 8GB disks.

$ ls -l *dsk
-rw-r--r--  1 localuser  localuser  622919680 Nov  9 17:30 hpux-striped-8gb-disk-1.qcow2.dsk
-rw-r--r--  1 localuser  localuser  550502400 Nov  9 17:30 hpux-striped-8gb-disk-2.qcow2.dsk

$ file *dsk
hpux-striped-8gb-disk-1.qcow2.dsk: QEMU QCOW Image (v3), 8589934592 bytes
hpux-striped-8gb-disk-2.qcow2.dsk: QEMU QCOW Image (v3), 8589934592 bytes

I did not see any major performance improvements with QEMU's accelerator or with using two virtual CPUs to enable SMP (-smp cpus=2 -accel tcg,thread=multi) though HPUX had no problem recognizing the additional CPU. In fact, performance may have been worse than using just one CPU with no acceleration, so I disabled acceleration and multiprocessor support in QEMU. Here is the report from ioscan:

Class       I  H/W Path     Driver    S/W State   H/W Type     Description
===========================================================================
bc          0               root      CLAIMED     BUS_NEXUS    
bc          1  8            bc        CLAIMED     BUS_NEXUS    Pseudo Bus Converter
ba          0  8/0          GSCtoPCI  CLAIMED     BUS_NEXUS    GSCtoPCI Bridge
ext_bus     0  8/0/0/0      c720      CLAIMED     INTERFACE    SCSI C895 Fast Wide LVD
target      0  8/0/0/0.0    tgt       CLAIMED     DEVICE       
disk        0  8/0/0/0.0.0  sdisk     CLAIMED     DEVICE       QEMU    QEMU HARDDISK
                           /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
target      1  8/0/0/0.1    tgt       CLAIMED     DEVICE       
disk        1  8/0/0/0.1.0  sdisk     CLAIMED     DEVICE       QEMU    QEMU HARDDISK
                           /dev/dsk/c0t1d0   /dev/rdsk/c0t1d0
target      2  8/0/0/0.2    tgt       CLAIMED     DEVICE       
disk        2  8/0/0/0.2.0  sdisk     CLAIMED     DEVICE       QEMU    QEMU CD-ROM
                           /dev/dsk/c0t2d0   /dev/rdsk/c0t2d0
target      3  8/0/0/0.7    tgt       CLAIMED     DEVICE       
ctl         0  8/0/0/0.7.0  sctl      CLAIMED     DEVICE       Initiator
                           /dev/rscsi/c0t7d0
lan         0  8/0/1/0      btlan     CLAIMED     INTERFACE    HP PCI 10/100Base-TX Core
                           /dev/diag/lan0  /dev/ether0     /dev/lan0     
tty         0  8/0/63       asio0     CLAIMED     INTERFACE    Built-in RS-232C
                           /dev/diag/mux0  /dev/mux0       /dev/tty0p0   
processor   0  48           processor CLAIMED     PROCESSOR    Processor
memory      0  63           memory    CLAIMED     MEMORY       Memory

HP-UX CDE Graphical Desktop


Initially, I was having trouble accessing the HPUX CDE graphical desktop using the usual XDMCP client (Xephyr) over network. An hourglass would show up, then disappear, and show up again, as if the X session was continually trying to start up and fail. Eventually I realized a core file was being created by "dtgreet" and traced the problem to "dtgreet fails and dumps core if the default font is unavailable for the selected locale". Although a patch is apparently available to address this, I wanted to fix the underlying issue of the missing default font. Further online research led to "Configuring HP-UX for Different Languages". Surely enough, the /etc/dt/config/Xconfig file had Dtlogin*language set to <lang>; simply editing the file to say "Dtlogin*language: en_US.iso88591" followed by running /sbin/init.d/dtlogin.rc reset immediately got HP-UX CDE working from the FreeBSD host machine:

$ exec Xephyr -screen 1200x720 -ac -query 10.42.2.55 :55

Supratim Sanyal's Blog: HPUX CDE Graphical Environment Start Up


Installing Software

I registered at HPE Software Depot describing myself as a Hobbyist and am able to download software via "Electronic Delivery". The software comes in the form of files with long filenames and  .depot extension, and the filenames have to be preserved for the swinstall tool to install them.

There was an initial hiccup in getting the swinstall tool to install the downloaded software: I was getting the error:

You do not have required permissions to perform this operation. Check permissions using the "swacl" command.

After attempting a lot of things mentioned online, the steps mentioned here regarding setting the acls worked:

1) Save the current (insufficient) host acl to a file:
 # swacl -l host > swacl.host

2) Edit swacl.host and givc all permissions ("a") to the usernames. After this change, swacl.host looks like:

user:root:a
user:localuser:a
group:swadm:a
any_other:-r---

3) Enable the modified acl:

# swacl -l host -F swacl.host

4) Restart the software agent daemon:

# /sbin/init.d/swagentd stop
# /sbin/init.d/swagentd start

Mozilla Web Browser on HP-UX 11i

Supratim Sanyal's Blog: Mozilla Web Browser on HP-UX 11i CDE Graphical Desktop


I downloaded PA_RISC_Firefox_3.5.09.00_May_10_ffox_A3509ar_pa.depot from the HPE Software Depot and transferred it to HP-UX's /var/spool/sw/ directory using FTP. The HP-UX swinstall tool was then invoked successfully to install Firefox.

# swinstall -s /var/spool/sw/PA_RISC_Firefox_3.5.09.00_May_10_ffox_A3509ar_pa.depot

Supratim Sanyal's Blog: Install Mozilla Firefox Web Browser on HPUX 11.11 PARISC

Supratim Sanyal's Blog: Install Mozilla Firefox Web Browser on HP-UX 11.i v1 PARISC


Unfortunately, the downloaded Firefox does not run on the PA7300LC processor of the emulated platform (it needs PA-RISC 2.0):
$ pwd
/opt/firefox
$ ./firefox-bin
sh: ./firefox-bin: Execute permission denied.
$ file firefox-bin
firefox-bin: PA-RISC2.0 shared executable dynamically linked -not stripped



Fortunately, a working Mozilla web browser was installed along with HP-UX 11.11, and can be invoked by typing in "mozilla" at a command prompt. Java support is questionable since Mozilla's text console (stdio) launch output indicates the Java plugin for PARISC 2.0 is not of the right executable format for the emulated PARISC 1.1 CPU.
$ pwd
/opt/mozilla
$ file mozilla-bin
mozilla-bin: PA-RISC1.1 shared executable dynamically linked -not stripped



HP even email back a very corporate-looking receipt for the electronic software distribution!

Supratim Sanyal's Blog: Mozilla Firefox for HP-UX 11i - Hewlett Packard Enterprise Electronic Delivery Receipt



Next, I grabbed depothelper from the awesome HP-UX Porting and Archive Centre and tried to install a couple of packages. With a one-line tweak of adding a command to FTP for Passive Mode (depothelper is just a script), the tool does an excellent job of pulling dependencies needed for the packages. However, my attempt to grab "wget" failed with it unable to download the first dependency. "bash" did slightly better in successfully downloading and installing all dependencies, but again wouldn't run on the QEMU's PA7300LC PA-RISC 1.1 processor because it expects PA-RISC 2.0.

The default HP-UX B.11.11 installation does come with a functional C compiler. Here is aclock compiled and running in a dtterm.

Supratim Sanyal's Blog: ACLOCK ASCII CLOCK ON HP-UX 11i (11.11) on HP PARISC


Installation Logs

I mostly remembered to captured the terminal sessions while performing the installation of HP-UX 11.11. Here are a couple for reference.

Initial Install - Virtual HP 9000/778 Console Log:






Initial Install - QEMU Monitor Log:






Post-Install First Boot - Virtual HP 9000/778 Console Log:








No comments:

Post a Comment

"SEO" link builders: move on, your spam link will not get posted.

Recommended Products from Amazon