AIX QEMU Blog
AIX QEMU Blog
Also, thanks to Liang Guo for his assistance. Your guidance was greatly appreciated.
Note: What I describe here is NOT supported by IBM. It is purely a lab experiment to see
what was possible with qemu-system-ppc64.
If you want to follow along at home, please follow and test the steps outlined here,
https://worthdoingbadly.com/aixqemu, first. If this works then you should be good to go
with the rest of this article.
I've never used QEMU until now. So all of this is very new to me. I'm still learning, so if you
see something wrong with my instructions. Sorry. I'll do better next time.
The first thing you need to do, is install AIX 7.2 in a Logical Partition (LPAR VM), on a Power
system, somewhere. If you don't have an IBM Power System of your own, you could try
using the https://www.ibm.com/partnerworld/page/stg_com_sys_power-development-
platform. I recommend using AIX 7.2 TL3 SP1 for this experiment. My source LPAR was
running 7200-03-01 on POWER8. Once you have an AIX system that you can use, follow
each of the steps outlined below.
# ls -ltr
total 43709952
-rw-r--r-- 1 root system 2905600000 Oct 08 08:38 AIXlpar-mksysb
-rw-r--r-- 1 root system 3022819328 Oct 08 08:41 cd_image_20119974
# mv cd_image_20119974 AIX72.iso
# ls -ltr
total 43709952
-rw-r--r-- 1 root system 2905600000 Oct 08 08:38 AIXlpar-mksysb
-rw-r--r-- 1 root system 3022819328 Oct 08 08:41 AIX72.iso
$ scp AIXlpar:/nim/mksysb/AIX72.iso .
4. Assuming that QEMU is installed on your Mac, create a qcow2 disk image. Now you
have two files, 1) AIX72.iso (which is the mksysb ISO of your AIX VM from your Power
system) and 2) AIX72.img, which will be used to install (restore) the mksysb ISO image in
the QEMU environment; this is your install hdisk device for rootvg.
5. Boot from the ISO image (AIX72.iso) and install AIX into the QEMU disk image
(AIX72.img). The ‘boot cdrom: -s verbose’ option, will start the VM and boot from the
virtual CD device (in this case the ISO image we created). The verbose option is really only
required if you are curious as to what is happening during the boot and installation steps.
BE PATIENT! It will take several mintues for the VM to boot.
Note: There is a lot of output when verbose boot is enabled. I have trimmed the output
shown (in this article) to make it easier to read.
Once the BOS installation menu appears, you can “follow the bouncing ball” and complete
the mksysb restore to hdisk0. If you’ve ever installed AIX in the past, you’ll be very familiar
with this process.
SLOF **********************************************************************
QEMU Starting
Build Date = Jun 21 2018 19:08:08
FW Version = git-7d37babcfa48a6eb
Press "s" to enter Open Firmware.
Scanning USB
XHCI: Initializing
USB Keyboard
USB mouse
No console specified using screen & keyboard
AIX
...etc...
AIX Version 7.2
exec(/etc/init){1,0}
Error Warning << Note: You can ignore this warning message...
Type the number of your choice and press Enter. Choice is indicated by >>>.
88 Help ?
99 Previous Menu
Either type 0 and press Enter to install with the current settings, or type the
number of the setting you want to change and press Enter.
6. With AIX installed, boot from the ISO image again (‘boot cdrom:’), enter maintenance
mode and edit the /sbin/helpers/jfs2/fsck64 file. You’ll need to replace the command
with a script that simply exits with a zero return code. When you are done, run ‘sync;sync’
and halt the VM.
Type the number of your choice and press Enter. Choice is indicated by >>>.
88 Help ?
99 Previous Menu
Maintenance
Warning:
If you choose to access a root volume group, you will not be able to return
to the Base Operating System Installation menus without rebooting.
Type the number of your choice and press Enter.
0 Continue
88 Help ?
>>> 99 Previous Menu
Type the number for a volume group to display the logical volume information
and press Enter.
Choice: 1
------------------------------------------------------------------------------
Volume Group ID 000000000000000000000166344f68a5 includes the following
logical volumes:
------------------------------------------------------------------------------
Choice [99]: 1
Importing Volume Group...
...etc...
Filesystems mounted for maintenance work.
# cd /sbin/helpers/jfs2
# >fsck64
# vi fsck64
#!/bin/ksh
exit 0
:w!
# ls -ltr | grep fsck64
-r-xr-xr-x 1 root system 18 Oct 3 05:25 fsck64
# cat fsck64
#!/bin/ksh
exit 0
#
# sync ; sync
# halt
....Halt completed....
cgibson@xwing : ~/Downloads/POWER/aix/AIX72 $
7. Boot from the disk image (AIX72.img, ‘boot disk:’). Don't used the verbose option
(unless you need to). This will boot the VM directly from your AIX hdisk device
(AIX72.img). BE PATIENT!
SLOF **********************************************************************
QEMU Starting
Build Date = Jun 21 2018 19:08:08
FW Version = git-7d37babcfa48a6eb
Press "s" to enter Open Firmware.
AIX Version 7
Copyright IBM Corporation, 1982, 2018.
Console login:
AIX Version 7
Copyright IBM Corporation, 1982, 2018.
Console login:
AIX Version 7
Copyright IBM Corporation, 1982, 2018.
Console login: root
root's Password:
*******************************************************************************
* *
* *
* Welcome to AIX Version 7.2! *
* *
* *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
* *
* *
*******************************************************************************
Last unsuccessful login: Wed Oct 3 18:38:16 AEST 2018 on /dev/vty0 from localhost
Last login: Fri Oct 5 13:35:42 AEST 2018 on /dev/vty0
#
# chdev -l inet0 -a hostname=aix_on_mac
# rmitab mbverify
# rmitab phauiserver
# rmitab pfcdaemon
# rmitab diagd
# rmitab artex
# rmitab clcomd
# rmitab xmdaily
# rmitab nim
# rmitab cron
# rmitab rcnfs
# rmitab writesrv
# rmitab qdaemon
# rmitab wparpcmsrv
# rmitab aso
# rmitab naudio2
# chrctcp -S -d tftpd
# lsitab -a
init:2:initdefault:
brc::sysinit:/sbin/rc.boot 3 >/dev/console 2>&1 # Phase 3 of system boot
powerfail::powerfail:/etc/rc.powerfail 2>&1 | /usr/bin/alog -tboot > /dev/console #
Power Failure Detection
tunables:23456789:wait:/usr/sbin/tunrestore -R > /dev/console 2>&1 # Set tunables
securityboot:2:bootwait:/etc/rc.security.boot > /dev/console 2>&1
rc:23456789:wait:/etc/rc 2>&1 | /usr/bin/alog -tboot > /dev/console # Multi-User
checks
srcmstr:23456789:respawn:/usr/sbin/srcmstr # System Resource Controller
rctcpip:23456789:wait:/etc/rc.tcpip > /dev/console 2>&1 # Start TCP/IP daemons
rctmiscsi:23456789:wait:/etc/rc.tmiscsi > /dev/console 2>&1
rckrb5:2:wait:/etc/rc.krb5 > /dev/console 2>&1
fbcheck:23456789:wait:/usr/sbin/fbcheck 2>&1 | /usr/bin/alog -tboot > /dev/console
# run /etc/firstboot
clusterconf:23456789:once:/usr/sbin/clusterconf
piobe:2:wait:/usr/lib/lpd/pioinit_cp >/dev/null 2>&1 # pb cleanup
cons:0123456789:respawn:/usr/sbin/getty /dev/console
uprintfd:23456789:respawn:/usr/sbin/uprintfd
shdaemon:2:off:/usr/sbin/shdaemon >/dev/console 2>&1 # High availability daemon
trustedboot:2:wait:/etc/rc.trustedboot > /dev/console 2>&1 # Get trusted log and
start TCSD
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
l7:7:wait:/etc/rc.d/rc 7
l8:8:wait:/etc/rc.d/rc 8
l9:9:wait:/etc/rc.d/rc 9
rcwpars:2:once:/etc/rc.wpars > /dev/console 2>&1 # Corrals autostart
logsymp:2:once:/usr/lib/ras/logsymptom # for system dumps
perfstat:2:once:/usr/lib/perf/libperfstat_updt_dictionary >/dev/console 2>&1
ha_star:h2:off:/etc/rc.ha_star >/dev/console 2>&1
pmperfrec:2:once:/var/perf/pm/bin/config_pm_ext.sh -P yes
ctrmc:2:once:/usr/bin/startsrc -s ctrmc > /var/ct/ctrmc-inittab.err 2>&1
At this point, you now have an AIX VM running on QEMU. You can now enter familiar AIX
commands and explore the environment.
aix_on_mac:/ # oslevel -s
7200-03-01-1838
aix_on_mac:/ # uname -L
0 aix_on_kvm
aix_on_mac:/ # lparstat -i
Node Name : aix_on_mac
Partition Name : aix_on_kvm
Partition Number : 0
Type : Shared
Mode : Capped
Entitled Capacity : 1.00
Partition Group-ID : 1
Shared Pool ID : 1
Online Virtual CPUs : 1
Maximum Virtual CPUs : 1
Minimum Virtual CPUs : 1
Online Memory : 2048 MB
Maximum Memory : 2048 MB
Minimum Memory : 2048 MB
Variable Capacity Weight : 128
Minimum Capacity : 1.00
Maximum Capacity : 1.00
Capacity Increment : 1.00
Maximum Physical CPUs in system : 1
Active Physical CPUs in system : 1
Active CPUs in Pool : 1
Shared Physical CPUs in system : -
Maximum Capacity of Pool : -
Entitled Capacity of Pool : -
Unallocated Capacity : 0.00
Physical CPU Percentage : 100.00%
Unallocated Weight : 0
Memory Mode : Dedicated
Total I/O Memory Entitlement : -
Variable Memory Capacity Weight : -
Memory Pool ID : -
Physical Memory in the Pool : -
Hypervisor Page Size : -
Unallocated Variable Memory Capacity Weight: -
Unallocated I/O Memory entitlement : -
Memory Group ID of LPAR : -
Desired Virtual CPUs : 1
Desired Memory : 2048 MB
Desired Variable Capacity Weight : 128
Desired Capacity : 1.00
Target Memory Expansion Factor : -
Target Memory Expansion Size : -
Power Saving Mode : -
Sub Processor Mode : -
aix_on_mac:/ # prtconf
System Model: IBM pSeries (emulated by qemu)
Machine Serial Number: Not Available
Processor Type: PowerPC_POWER9
Processor Implementation Mode: POWER 9
Processor Version: PV_9_Compat
Number Of Processors: 1
Processor Clock Speed: 1000 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
LPAR Info: 0 aix_on_kvm
Memory Size: 2048 MB
Good Memory Size: 2048 MB
Platform Firmware level: Not Available
Firmware Version: SLOF,aik
Console Login: enable
Auto Restart: true
Full Core: false
NX Crypto Acceleration: Not Capable
Network Information
Host Name: aix_on_mac
IP Address: 10.1.1.10
Sub Netmask: 255.255.255.0
Gateway:
Name Server:
Domain Name:
aix_on_mac:/ # df
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2883584 2328520 20% 15047 6% /
/dev/hd2 6291456 1794272 72% 57149 22% /usr
/dev/hd9var 2621440 1686568 36% 4234 3% /var
/dev/hd3 4456448 4182992 7% 1083 1% /tmp
/dev/hd1 262144 260680 1% 21 1% /home
/dev/hd11admin 262144 261416 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 2359296 807288 66% 12416 13% /opt
/dev/livedump 524288 523552 1% 4 1% /var/adm/ras/livedump
aix_on_mac:/ # lsvg
rootvg
aix_on_mac:/ # lspv
hdisk0 00000000344f6122 rootvg active
Network Address.............525400123456
Displayable Message.........Virtual I/O Ethernet Adapter (l-lan)
Manufacturer................QEMU
Machine Type and Model......QEMU HARDDISK
Part Number.................
ROS Level and ID............322E352B
Serial Number...............
EC Level....................
FRU Number..................
Device Specific.(Z0)........00000512FA000012
Device Specific.(Z1)........
Device Specific.(Z2)........
Device Specific.(Z3)........
Device Specific.(Z4)........
Device Specific.(Z5)........
Device Specific.(Z6)........
L2cache0 L2 Cache
mem0 Memory
proc0 Processor
PLATFORM SPECIFIC
Name: /
Model: IBM pSeries (emulated by qemu)
Node: /
Device Type: chrp
Name: openprom
Model: SLOF,aik
Node: openprom
Name: vga
Node: vga@0
Device Type: display
Physical Location: qemu_VGA:0000:00:00.0
Name: usb
Node: usb@1
Device Type: xhci
Physical Location: qemu_nec-usb-xhci:0000:00:01.0
Name: scsi
Node: scsi@2
Physical Location: qemu_virtio-scsi-pci:0000:00:02.0
aix_on_mac:/ #
aix_on_mac:/opt/freeware/packages # date
Mon Oct 8 10:56:55 AEDT 2018
aix_on_mac:/ # uptime
10:57AM up 24 mins, 1 user, load average: 1.72, 1.76, 1.54
aix_on_mac:/ # nmon
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ------------------------------ │
│ N N M M OOOO N N For online help type: h │
│ NN N MM MM O O NN N For command line option help: │
│ N N N M MM M O O N N N quick-hint nmon -? │
│ N N N M M O O N N N full-details nmon -h │
│ N NN M M O O N NN To start nmon the same way every time? │
│ N N M M OOOO N N set NMON ksh variable, for example: │
│ ------------------------------ export NMON=cmt │
│ TOPAS_NMON │
│ 1 - CPU currently │
│ 1 - CPU configured │
│ 1000 - MHz CPU clock rate │
│ PowerPC_POWER9 - Processor │
│ 64 bit - Hardware │
│ 64 bit - Kernel │
│ 0,aix_on_kvm - Logical Partition │
│ 7.2.3.1 TL03 - AIX Kernel Version │
│ aix_on_mac - Hostname │
│ aix_on_mac - Node/WPAR Name │
│ 000000 - Serial Number │
│ IBM pSeries (emulated by qemu) - Machine Type │
│ │
aix_on_mac:/ # topas
aix_on_mac:/cg # lsmpio
name path_id status path_status parent connection
aix_on_mac:/cg # lsmpio -q
Device Vendor Id Product Id Size Volume Name
---------------------------------------------------------------------------------
hdisk0 QEMU QEMU HARDDISK 100.00GiB -
aix_on_mac:/ # lspv -u
hdisk0 00000000344f6122 rootvg active
33130drive-virtio-disk00DQEMU HARDDISK04QEMUvrtscsi 8eca6bf6-b924-
0872-c039-8cb2a62de21a
aix_on_mac:/ # lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type Chksum
hd6 hdisk0 rootvg 512MB 1 yes yes lv 0
aix_on_mac:/ # smtctl
smtctl: SMT is not supported on this system.
aix_on_mac:/ # lspath
Enabled hdisk0 scsi0