====== Install AIX on x86 using QEMU ======
https://worthdoingbadly.com/aixqemu/
http://gibsonnet.net/blog/cgaix/html/AIX%207.2%20running%20on%20my%20Macbook.html
https://lists.gnu.org/archive/html/qemu-ppc/2018-05/msg00387.html
http://gibsonnet.net/blog/cgaix/resource/AIX_QEMU_blog.pdf
First install QEMU for PPC, version 3 or later:
qemu-ppc-3.1.1.1-lp151.7.9.1.x86_64
opensuse:/virtual_vm/aix72 # rpm -ql qemu-ppc-3.1.1.1-lp151.7.9.1.x86_64
/usr/bin/qemu-system-ppc
/usr/bin/qemu-system-ppc64
/usr/share/qemu/bamboo.dtb
/usr/share/qemu/canyonlands.dtb
/usr/share/qemu/openbios-ppc
/usr/share/qemu/ppc_rom.bin
/usr/share/qemu/qemu_vga.ndrv
/usr/share/qemu/skiboot.lid
/usr/share/qemu/slof.bin
/usr/share/qemu/spapr-rtas.bin
/usr/share/qemu/u-boot-sam460-20100605.bin
/usr/share/qemu/u-boot.e500
===== Boot AIX on x86 using QEMU using diag CDROM =====
Step 1: Download the AIX 7.2 Standalone Diagnostics disk from IBM \\
https://www.ibm.com/support/pages/standalone-diagnostics-cd-overview-and-download\\
You want CD73220.iso
Step 2: (optional) If you want the Diagnostics disk to give you an AIX shell prompt instead of running diagnostics, apply this patch to your ISO file:
**patch_cd72220.py**
import sys
patch_off = 0x7b43800
patch_data = b"#!/bin/sh\n/bin/sh\nexit\n"
with open(sys.argv[1], "rb") as infile:
indata = bytearray(infile.read())
indata[patch_off:patch_off+len(patch_data)] = patch_data
with open(sys.argv[2], "wb") as outfile:
outfile.write(indata)
# python patch_cd72220.py CD72220.ISO ModdedCD.ISO
(this replaces usr/lpp/diagnostics/bin/Dctrl on the ISO with a shell script that launches /bin/sh)
Launch QEMU with this command line:
# qemu-system-ppc64 -cpu POWER9 -machine pseries -m 2G -serial mon:stdio \
-cdrom ModdedCD.iso \
-d guest_errors \
-prom-env "input-device=/vdevice/vty@71000000" \
-prom-env "output-device=/vdevice/vty@71000000" \
-prom-env "boot-command=dev / 0 0 s\" ibm,aix-diagnostics\" property boot cdrom:\ppc\chrp\bootfile.exe -s verbose"
Step 5: Wait. (It’ll get stuck on define_rspc for a long time.)
Step 6: After nine very, very long minutes, you’ll be greeted with this notice:
******* Please define the System Console. *******
Type a 1 and press Enter to use this terminal as the
system console.
Pour definir ce terminal comme console systeme, appuyez
sur 1 puis sur Entree.
Taste 1 und anschliessend die Eingabetaste druecken, um
diese Datenstation als Systemkonsole zu verwenden.
Premere il tasto 1 ed Invio per usare questo terminal
come console.
Escriba 1 y pulse Intro para utilizar esta terminal como
consola del sistema.
Escriviu 1 1 i premeu Intro per utilitzar aquest
terminal com a consola del sistema.
Digite um 1 e pressione Enter para utilizar este terminal
como console do sistema.
Type 1 in your terminal, then press enter.
Step 7: After another two minutes, you’ll be dropped to an AIX shell prompt (or, if you didn’t patch the ISO, the IBM Diagnostics tool): uname
===== Install AIX 7.2 on x86 using QEMU =====
https://astr0baby.wordpress.com/2018/11/04/running-aix-7-2-tl3sp1-on-x86_64-via-qemu-system-ppc64/
# qemu-system-ppc64 -cpu POWER9 -machine pseries -m 2048 -serial stdio \
-drive file=aix72.img,if=none,id=drive-virtio-disk0 \
-device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 \
-cdrom cd_image_7537004 \
-netdev tap,id=n1 -device virtio-net,netdev=n1 \
-prom-env boot-command='boot disk: -s verbose'
aix72.img is disk image, cd_image_7537004 is CD image created by
'smitty mkdvd' in a working aix 7200-02-02-1810
[root@prnim01]/export/lppsources# mkcd -L -S -I /export/lppsources -m /export/lppsources/mksysb01
Initializing mkcd log: /var/adm/ras/mkcd.log...
Verifying command parameters...
Creating temporary file system: /mkcd/cd_fs...
Populating the CD or DVD file system...
Building chrp boot image...
Copying backup to the CD or DVD file system...
.
Creating Rock Ridge format image: /export/lppsources/cd_image_7799230
Running mkisofs ...
.
mkrr_fs was successful.
Making the CD or DVD image bootable...
Removing temporary file system: /mkcd/cd_fs...
-prom-env boot-command='boot disk: -s verbose' is used to control boot
source, when installing aix, ' boot cd:' should be used. '-s verbose'
lets aix throwing verbose output, each executed command will be
printed.
After installing aix, /sbin/helpers/jfs2/fsck64 should be modified to
following file, and be granted execute permission:
#!/bin/ksh
exit 0
Next is my AIX 7.2 TL3SP1 installation loader script
# qemu-system-ppc64 -cpu POWER8 -machine pseries -m 2048 -serial stdio -drive file=disk.img,if=none,id=drive-virtio-disk0 -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 -cdrom aix.iso -prom-env "boot-command=dev / 0 0 s\" ibm,aix-diagnostics\" property boot cdrom:\ppc\chrp\bootfile.exe -s verbose" -net nic -net tap -display vnc=:1
And here is the simulation loader script
# qemu-system-ppc64 -cpu POWER8 -machine pseries -m 2048 -serial stdio -drive file=disk.img,if=none,id=drive-virtio-disk0 -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 -cdrom aix.iso -prom-env boot-command='boot disk: ' -net nic -net tap -display vnc=:1
My disk.img (or aix-hdd.qcow2) is a standard qcow2 compressed image format (100 G)
qemu-img create -f qcow2 aix-hdd.qcow2 100G
==== Test 08/2024 =====
Format the disk in thin provisionning
root@manu-Latitude-5480:/home/manu/Downloads# qemu-img create -f qcow2 aix73.qcow2 50G
root@manu/home/manu/Downloads# qemu-system-ppc64 -cpu POWER9 -machine pseries -m 2048 -serial stdio \
-drive file=aix73.qcow2,if=none,id=drive-virtio-disk0 \
-device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 \
-cdrom cd_diag73220.iso \
-netdev tap,id=n1 -device virtio-net,netdev=n1 \
-prom-env boot-command='boot disk: -s verbose'