top of page
Recent Posts

How To Install IBM-AIX in Your Laptop

Updated: Oct 3, 2021

Alhamdulillah, Finally I have successfully installed the IBM AIX Operation System in My Laptop. And my laptop running with Red Hat Enterprise Linux 7.8.


Here are two document links for your reference, if you want to know more or any troubleshooting required based on your scenario.


http://gibsonnet.net/blog/cgaix/resource/AIX_QEMU_blog.pdf

https://developer.ibm.com/articles/enhancing-qemu-virtio-scsi-with-block-limits-vpd-emulation/


Let's start.


Install QEMU:

Step:1 First we need to download qemu software, and it can be download from two different source. as below.

qemu or git

# cd /usr/local
# git clone git://git.qemu.org/qemu.git 
Cloning into 'qemu'...
remote: Counting objects: 504156, done.
remote: Compressing objects: 100% (87992/87992), done.
remote: Total 504156 (delta 414857), reused 504059 (delta 414800)
Receiving objects: 100% (504156/504156), 177.24 MiB | 289.00 KiB/s, done.
Resolving deltas: 100% (414857/414857), done.
You can also download the tar format using "wget https://download.qemu.org/qemu-5.1.0-rc3.tar.xz" command and untar it using "tar xvJf qemu-5.1.0-rc3.tar.xz" command under the /usr/local directory.

Step:2 To install prerequisite rpm's from the RHEL OS DVD to build and compile the downloaded qemu source code.

# yum install pixman-devel gcc make -y

# rpm -qa|egrep "pixman-devel|gcc-|make-"
libgcc-4.8.5-39.el7.i686
automake-1.13.4-3.el7.noarch
pixman-devel-0.34.0-1.el7.x86_64
gcc-4.8.5-39.el7.x86_64
make-3.82-24.el7.x86_64
libgcc-4.8.5-39.el7.x86_64
Note: in your scenario, the prerequisite rpm's may be more or less.

Step:3 Build and compile the downloaded qemu source code to install.

# cd qemu 
# mkdir build; cd build 
# ../configure  --target-list='ppc64-softmmu ppc-softmmu'
No C++ compiler available; disabling C++ specific optional code
Install prefix    /usr/local
BIOS directory    /usr/local/share/qemu
firmware path     /usr/local/share/qemu-firmware
binary directory  /usr/local/bin
library directory /usr/local/lib
module directory  /usr/local/lib/qemu
libexec directory /usr/local/libexec
include directory /usr/local/include
config directory  /usr/local/etc
local state directory   /usr/local/var
Manual directory  /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Build directory   /usr/local/qemu/build
Source path       /usr/local/qemu
GIT binary        git
GIT submodules    ui/keycodemapdb tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc capstone slirp
C compiler        cc
Host C compiler   cc
C++ compiler      
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/include/pixman-1   -I$(SRC_PATH)/dtc/libfdt -Werror   -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99  -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wno-missing-include-dirs -Wno-psabi -fstack-protector-strong -Wno-missing-braces -I$(SRC_PATH)/capstone/include
QEMU_LDFLAGS      -L$(BUILD_DIR)/dtc/libfdt -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64  -fstack-protector-strong
make              make
install           install
python            /bin/python3 -B (3.6.8)
genisoimage       /bin/genisoimage
efi_aarch64       /usr/local/qemu/build/pc-bios/edk2-aarch64-code.fd
python_yaml       no
slirp support     git 
smbd              /usr/sbin/smbd
module support    no
alt path mod load no
host CPU          x86_64
host big endian   no
target list       ppc64-softmmu ppc-softmmu

::::::::::::: CUT SOME OUTPUT :::::::::::::

fuzzing support   no
gdb               /bin/gdb
rng-none          no
Linux keyring     yes
cross containers  podman

# make
  GEN     ppc64-softmmu/config-devices.mak.tmp
  GEN     ppc64-softmmu/config-devices.mak
  GEN     ppc-softmmu/config-devices.mak.tmp
  GEN     ppc-softmmu/config-devices.mak
  GEN     config-all-devices.mak
  GEN     config-host.h

::::::::::::: CUT SOME OUTPUT :::::::::::::

  BUILD   pc-bios/optionrom/pvh.img
  BUILD   pc-bios/optionrom/pvh.raw
  SIGN    pc-bios/optionrom/pvh.bin
  CC      contrib/vhost-user-input/main.o
  CC      contrib/libvhost-user/libvhost-user.o
  CC      contrib/libvhost-user/libvhost-user-glib.o
  AR      libvhost-user.a
  LINK    vhost-user-input

# make install
make[1]: Entering directory `/usr/local/qemu/slirp'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/qemu/slirp'
install -d -m 0755 "/usr/local/share/qemu"
install -d -m 0755 "/usr/local/var"/run
install -d -m 0755 "/usr/local/include"
  BUNZIP2 pc-bios/edk2-i386-secure-code.fd.bz2
  BUNZIP2 pc-bios/edk2-arm-code.fd.bz2
  BUNZIP2 pc-bios/edk2-i386-vars.fd.bz2
  BUNZIP2 pc-bios/edk2-i386-code.fd.bz2
  BUNZIP2 pc-bios/edk2-arm-vars.fd.bz2
  BUNZIP2 pc-bios/edk2-aarch64-code.fd.bz2
  BUNZIP2 pc-bios/edk2-x86_64-code.fd.bz2
  BUNZIP2 pc-bios/edk2-x86_64-secure-code.fd.bz2

::::::::::::: CUT SOME OUTPUT :::::::::::::

mkdir -p "/usr/local/share/icons/hicolor/32x32/apps"; \
install -c -m 0644 /usr/local/qemu/ui/icons/qemu_32x32.bmp \
	"/usr/local/share/icons/hicolor/32x32/apps/qemu.bmp"; \
mkdir -p "/usr/local/share/icons/hicolor/scalable/apps"; \
install -c -m 0644 /usr/local/qemu/ui/icons/qemu.svg \
	"/usr/local/share/icons/hicolor/scalable/apps/qemu.svg"
mkdir -p "/usr/local/share/applications"
install -c -m 0644 /usr/local/qemu/ui/qemu.desktop \
	"/usr/local/share/applications/qemu.desktop"
install -d -m 0755 "/usr/local/share/qemu/keymaps"
set -e; for x in da     en-gb  et  fr     fr-ch  is  lt  no  pt-br  sv ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th de-ch  es     fo  fr-ca  hu     ja  mk  pt  sl     tr bepo    cz; do \
	install -c -m 0644 /usr/local/qemu/pc-bios/keymaps/$x "/usr/local/share/qemu/keymaps"; \
done
install -c -m 0644 /usr/local/qemu/build/trace-events-all "/usr/local/share/qemu/trace-events-all"


# /usr/local/bin/qemu-system-ppc64 --version
QEMU emulator version 5.0.92 (v5.1.0-rc2-33-gfd3cd58)
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
If you don not mentioned the --target-list='ppc64-softmmu ppc-softmmu', it will build more than 50 machines emulator, and will take a longer time to compile. fore more info, type #../configure -h

Create VM And Install AIX OS:

Step:1 To create a qcow2 image disk for the AIX OS Installation.

# qemu-img create -f qcow2 /mnt/hdisk0.qcow2 20G
Formatting '/mnt/hdisk0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=21474836480 lazy_refcounts=off refcount_bits=16

Step:2 To create an AIX VM and Install it from the AIX OS iso file.

# /usr/local/bin/qemu-system-ppc64 -cpu POWER9 -machine pseries -m 2048 -serial stdio \
 -hda /mnt/hdisk0.qcow2 \
 -cdrom /mnt/AIX7.2TL03D1.ISO \
 -prom-env boot-command='boot cdrom:'
The above simple command works for me. But you might need to add more option in that command, and you can check all the available option by "/usr/local/bin/qemu-system-ppc64 -h" command.

Note: AIX boot will take several minutes, sometimes output can hang for 3-5 minutes or more depending on your system.


Once the AIX VM successfully boot-up and If you are familiar with AIX installation than you can continue the installation or follow as below.

Type 1 and press Enter key, as below.

Type 1 for English and press Enter key, as below.

Type 2 for show settings and press Enter key, as below.

Verify the hdisk0 disk is detected and then type 0 to start the installation with these settings, as below.

Type 0 to start the installation and press Enter key, as below.

Note: AIX installation will take 80-140 minutes, as I saw in my laptop

At the end, during the boot image creation, we can have this type of error message:

Set_Bootlist: Could not set the bootlist to:

hdisk0 .

The boot device must be set in the host KVM.

Press 1 to continue: 1


So, just type 1 to continue.


And we have to wait for the installation to be completed, and the AIX VM will reboot. Press CTRL-C to stop the reboot activities. Because it will boot from the CDROM again as well.


Troubleshoot AIX VM Boot-up:

after that, I have tried to boot my AIX VM from the hdisk0, but the console output got to hang at 0554 error code.

 #  /usr/local/bin/qemu-system-ppc64 -cpu POWER9 -machine pseries -m 2048 -serial stdio \
 -hda /mnt/hdisk0.qcow2 \
 -cdrom /mnt/AIX7.2TL03D1.ISO \
 -prom-env boot-command='boot disk:'
 ::::::::::::: CUT SOME OUTPUT :::::::::::::
 0511
 0554

Again, I have to abort the AIX Boot process by pressing CTRL-C, And have to fix it.


Step:6 Need to fix fsck64 issue in Maintenance Mode. The fsck fails during boot and that causes the hang at boot.


To boot AIX VM from the CD-ROM ISO.

# /usr/local/bin/qemu-system-ppc64 -cpu POWER9 -machine pseries -m 2048 -serial stdio \
 -hda /mnt/hdisk0.qcow2 \
 -cdrom /mnt/AIX7.2TL03D1.ISO \
 -prom-env boot-command='boot cdrom:'

we can use -prom-env boot-command='boot cdrom: -s verbose' for more details for the troubleshooting, what's going on during the AIX Boot.

To enter the Maintenance Mode. type 3 in the "Welcome To Base Operation System" windows, as we have seen before. And type 1 to access root vg, as below.

Type 0 to Continue, as below.

Type 1 to select the root vg, as below.

Type 1 to access and start the shell prompt, , as below.

We will get the shell prompt, as below.

We have to run below command to fix fsck fails issue at the maintenance shell prompt:

#cd /sbin/helpers/jfs2
# pwd
/sbin/helpers/jfs2
# cp fsck64 org_fsck64
# cat > fsck64 << end
> #!/bin/ksh
> exit 0
> end
# cat fsck64
#!/bin/ksh
exit 0

# cat fsck64               
# sync ; sync  
# halt

Source: aix4admins.blogspot.com

I also had another issues regarding UNKNOWN BOOTDISK, and found this in verbose boot message: /usr/lib/methods/showled,0x554,UNKNOWN BOOTDISK){983356,917792}

So I have executed some more command at the maintenance shell prompt to fix this as well.

# lsattr -El hdisk0
 ::::::::::::: CUT SOME OUTPUT :::::::::::::
max_transfer    0x20000                          Maximum TRANSFER Size      True
 ::::::::::::: CUT SOME OUTPUT :::::::::::::
 
# lsattr -l hdisk0 -Ra max_transfer
0x20000
0x40000
0x80000
0x100000
0x200000
0x400000
0x800000
0x1000000

# chdev -a max_transfer=0x80000 -l hdisk0
# lsattr -El hdisk0