Booting a redpesk image with Qemu

Launch a x86_64 image

Prerequisites

OVMF

OVMF is a port of Intel’s Tianocore firmware to the qemu virtual machine.

Ubuntu

sudo apt-get install qemu-kvm ovmf

Fedora

sudo dnf install qemu-kvm edk2-ovmf

Download the x86_64 image

Create a directory for downloading image:

mkdir ~/redpeskimage
cd ~/redpeskimage
wget -r -nd -nc --no-parent -A "redpesk*smack*" 'https://download.redpesk.bzh/redpesk-lts/arz-1.0/images/smack/minimal/x86_64/generic/latest'
unxz redpesk*x86_64*.raw.xz

See Download Images section for link details.

Launch the Qemu

IMAGE_NAME=$(ls redpesk*x86_64*.raw)
# For Ubuntu
OVMF="/usr/share/qemu/OVMF.fd"
# Uncomment/change for Fedora
#OVMF="/usr/share/OVMF/OVMF_CODE.fd"
PORT_SSH=3333

qemu-system-x86_64 \
    -hda $IMAGE_NAME \
    -enable-kvm -m 2048 \
    -cpu kvm64 \
    -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt \
    -smp 4 \
    -vga virtio \
    -show-cursor \
    -device virtio-rng-pci \
    -serial mon:stdio \
    -serial null \
    -soundhw hda \
    -net nic \
    -net user,hostfwd=tcp::$PORT_SSH-:22 \
    -bios $OVMF

Wait! It is booting…

Default root password is root.

Launch a aarch64 image

Prerequisites

Ubuntu

sudo apt-get install libguestfs-tools

Fedora

sudo dnf install libguestfs-tools-c

Download the aarch64 generic image

mkdir ~/redpeskimage
cd ~/redpeskimage
wget -r -nd -nc --no-parent -A "redpesk*smack*" 'https://download.redpesk.bzh/redpesk-lts/arz-1.0/images/smack/minimal/aarch64/generic/latest'
unxz redpesk*aarch64*.raw.xz

See Download Images section for link details here.

Extract the kernel for the image

Use virt-builder to extract kernel of the downloaded image. Example :

$ sudo virt-builder --get-kernel redpesk*aarch64*.raw
download: /boot/vmlinuz-5.10.18-2203.rpdarz.aarch64 -> ./vmlinuz-5.10.18-2203.rpdarz.aarch64
download: /boot/initramfs-5.10.18-2203.rpdarz.aarch64.img -> ./initramfs-5.10.18-2203.rpdarz.aarch64.img

Launch the Qemu

IMAGE_NAME=$(ls redpesk*aarch64*.raw)
KERNEL_IMAGE=$(ls vmlinuz-*.aarch64)
INITRAMFS_IMAGE=$(ls initramfs-*.aarch64.img)
PORT_SSH=3333

qemu-system-aarch64 \
        -hda $IMAGE_NAME \
        -kernel $KERNEL_IMAGE \
        -initrd $INITRAMFS_IMAGE \
        -machine accel=tcg,type=virt \
        -m 2048 \
        -cpu cortex-a57 \
        -smp 4 \
        -append 'console=ttyAMA0,115200 root=LABEL=rootfs security=smack' \
        -net nic -net user,hostfwd=tcp::$PORT_SSH-:22 \
        -display none \
        -nographic \
        -snapshot

Wait! It is booting…

Default root password is root.

Connect to the qemu over SSH

PORT_SSH=3333
ssh -p $PORT_SSH root@localhost

Installing a package

See this section for installing and starting helloworld-binding: Install helloworld binding