QEMU AArch64 - n-hys/illumos-gate GitHub Wiki

QEMU AArch64

QEMU is a open source machine emulator.

Installing QEMU

Install QEMU 6.2.0 or later. (You can use vanilla QEMU.)
You can use the following packages on openSUSE Leap 15.4.

sudo zypper in qemu-arm qemu-tools

Creating a bridge interface on your PC

Create a bridge interface for using network from the QEMU virtual machine.
Create the file /usr/local/etc/qemu/bridge.conf (or /etc/qemu/bridge.conf) with the content:

allow br0

Creating a disk image

The following additional packages are required on openSUSE Leap 15.4.

zypper install gptfdisk

You need to use Solaris ROOT GUID (6A85CF4D-1DD2-11B2-99A6-080020736631) for the root slice.

disk_img=${base_dir}/disk-a64.img

qemu-img create -f raw ${disk_img} 16G
sgdisk -g -e --clear --new=1:2048: --change-name=1:solaris --typecode=1:6A85CF4D-1DD2-11B2-99A6-080020736631 ${disk_img}

Booting from network

Run the following command. When booting from network, some errors occurr but you can ignore errors.
You can login as root without using password.

illumos_dir=${base_dir}/illumos-gate
disk_img=${base_dir}/disk-a64.img

sudo qemu-system-aarch64 -nographic -machine virt -m 1G -smp 4 \
    -cpu cortex-a53 \
    -kernel ${illumos_dir}/usr/src/psm/stand/boot/aarch64/virt/inetboot.bin \
    -append "-D /virtio_mmio@a003e00" \
    -netdev bridge,id=net0,br=br0 \
    -device virtio-net-device,netdev=net0,mac=52:54:00:70:0a:e4 \
    -device virtio-blk-device,drive=hd0 \
    -drive file=${disk_img},format=raw,id=hd0,if=none \
    -semihosting-config enable=on,target=native \
    -gdb tcp::1234
boot.log
phys memory add 0000000040000000 - 000000007fffffff
add io 9000000 1000 for arm,pl011
add io 9010000 1000 for arm,pl031
add io 8000000 10000 for arm,cortex-a15-gic
add io 8010000 10000 for arm,cortex-a15-gic
add io a000000 1000 for virtio,mmio
add io a001000 1000 for virtio,mmio
add io a002000 1000 for virtio,mmio
add io a003000 1000 for virtio,mmio
bootargs=-D /virtio_mmio@a003e00
bootpath=/virtio_mmio@a003e00
vdev_probe error
QEMU: Terminated
naoyuki@selcy:~/Projects/00_develop> ./a64-netboot.sh 
phys memory add 0000000040000000 - 000000007fffffff
add io 9000000 1000 for arm,pl011
add io 9010000 1000 for arm,pl031
add io 8000000 10000 for arm,cortex-a15-gic
add io 8010000 10000 for arm,cortex-a15-gic
add io a000000 1000 for virtio,mmio
add io a001000 1000 for virtio,mmio
add io a002000 1000 for virtio,mmio
add io a003000 1000 for virtio,mmio
bootargs=-D /virtio_mmio@a003e00
bootpath=/virtio_mmio@a003e00
vdev_probe error
rootnex_map_regspec: a003e00 -> ffff00000a003e00
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 9000000 -> ffff000009000000
cpu0: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu0: QEMU VIRT CPU
cpu1: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu1: QEMU VIRT CPU
cpu1 initialization complete - online
cpu2: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu2: QEMU VIRT CPU
cpu2 initialization complete - online
cpu3: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu3: QEMU VIRT CPU
cpu3 initialization complete - online
Loading smf(5) service descriptions: 138/138
ERROR: svc:/system/filesystem/usr:default failed to mount remount  (see 'svcs -x' for details)
Aug 15 23:14:33 svc.startd[100003]: svc:/system/filesystem/usr:default: Method "/lib/svc/method/fs-usr" failed with exit status 95.
Aug 15 23:14:33 svc.startd[100003]: system/filesystem/usr:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Hostname: virt-a64
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Enter user name for system maintenance (control-d to bypass): root
Enter root password (control-d to bypass): 
single-user privilege assigned to root on /dev/console.
Entering System Maintenance Mode

Aug 16 07:54:08 su: 'su root' succeeded for root on /dev/console
The illumos Project	SunOS Development	Aug. 16, 2022
illumos development build: naoyuki
root@virt-a64:~# 

Partition

The solaris root partition will probably be /dev/dsk/c1t0d0s0.
To create a storage pool:

devfsadm
zpool create -f -o altroot=/mnt rpool /dev/dsk/c1t0d0s0

Booting from disk image

Run the following command. The difference with the network boot is -append "-D /virtio_mmio@a003c00".

illumos_dir=${base_dir}/illumos-gate
disk_img=${base_dir}/disk-a64.img

sudo qemu-system-aarch64 -nographic -machine virt -m 1G -smp 4 \
    -cpu cortex-a53 \
    -kernel ${illumos_dir}/usr/src/psm/stand/boot/aarch64/virt/inetboot.bin \
    -append "-D /virtio_mmio@a003c00" \
    -netdev bridge,id=net0,br=br0 \
    -device virtio-net-device,netdev=net0,mac=52:54:00:70:0a:e4 \
    -device virtio-blk-device,drive=hd0 \
    -drive file=${disk_img},format=raw,id=hd0,if=none \
    -semihosting-config enable=on,target=native \
    -gdb tcp::1234
boot.log
phys memory add 0000000040000000 - 000000007fffffff
add io 9000000 1000 for arm,pl011
add io 9010000 1000 for arm,pl031
add io 8000000 10000 for arm,cortex-a15-gic
add io 8010000 10000 for arm,cortex-a15-gic
add io a000000 1000 for virtio,mmio
add io a001000 1000 for virtio,mmio
add io a002000 1000 for virtio,mmio
add io a003000 1000 for virtio,mmio
bootargs=-D /virtio_mmio@a003c00
bootpath=/virtio_mmio@a003c00
zfs_lookup error /platform/SUNW,virt/boot_archive
zfs_lookup error /platform/linux,dummy-virt/boot_archive
vdev_probe error
rootnex_map_regspec: a003c00 -> ffff00000a003c00
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 9000000 -> ffff000009000000
cpu0: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu0: QEMU VIRT CPU
cpu1: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu1: QEMU VIRT CPU
cpu1 initialization complete - online
cpu2: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu2: QEMU VIRT CPU
cpu2 initialization complete - online
cpu3: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu3: QEMU VIRT CPU
cpu3 initialization complete - online
Loading smf(5) service descriptions: 138/138
Hostname: unknown

WARNING: Reboot required.
The system has updated the cache of files (boot archive) that
is used during the early boot sequence. To avoid booting and
running the system with the previously out-of-sync version of
these files, the system will be restarted.

Aug 16 17:40:21 svc.startd[100003]: svc:/system/filesystem/usr:default: Method "/lib/svc/method/fs-usr" failed due to signal TERM.
syncing file systems... done
phys memory add 0000000040000000 - 000000007fffffff
add io 9000000 1000 for arm,pl011
add io 9010000 1000 for arm,pl031
add io 8000000 10000 for arm,cortex-a15-gic
add io 8010000 10000 for arm,cortex-a15-gic
add io a000000 1000 for virtio,mmio
add io a001000 1000 for virtio,mmio
add io a002000 1000 for virtio,mmio
add io a003000 1000 for virtio,mmio
bootargs=-D /virtio_mmio@a003c00
bootpath=/virtio_mmio@a003c00
zfs_lookup error /platform/SUNW,virt/boot_archive
zfs_lookup error /platform/linux,dummy-virt/boot_archive
vdev_probe error
rootnex_map_regspec: a003c00 -> ffff00000a003c00
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 9000000 -> ffff000009000000
cpu0: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu0: QEMU VIRT CPU
cpu1: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu1: QEMU VIRT CPU
cpu1 initialization complete - online
cpu2: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu2: QEMU VIRT CPU
cpu2 initialization complete - online
cpu3: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu3: QEMU VIRT CPU
cpu3 initialization complete - online
Hostname: unknown

unknown console login: Aug 16 17:42:16 unknown rootnex: rootnex_map_regspec: a003e00 -> ffff00000a003e00

unknown console login: root

Aug 16 19:07:36 unknown login: Solaris_audit getaddrinfo(unknown) failed[node name or service name not known]: Error 0
Aug 16 19:07:36 unknown login: Solaris_audit adt_get_local_address failed, no Audit IP address available, faking loopback and error: Network is down
Aug 16 19:07:36 unknown login: pam_unix_cred: cannot load ttyname: Network is down, continuing.
Aug 16 19:07:36 unknown login: ROOT LOGIN /dev/console
The illumos Project     SunOS Development       Aug. 17, 2022
illumos development build: naoyuki
root@unknown:~# 
⚠️ **GitHub.com Fallback** ⚠️