QEMU
Overview
QEMU is an emulator and virtualization machine that allows you to run a complete Yocto image within an emulated environment, useful for testing images and applications without having actual hardware.
Clea OS 1.5+ can be built for several QEMU configurations, described in the following table.
Configuration name | QEMU Machine | CPU | Bootloader | Kernel | Storage |
---|---|---|---|---|---|
qemuarm | virt | arm | u-boot | linux-yocto | virtio |
qemuarm64 | virt | aarch64 | u-boot | linux-yocto | virtio |
qemux86 | q35 | x86 | grub | linux-yocto | virtio |
qemux86-64 | q35 | x86-64 | grub | linux-yocto | virtio |
All these four configurations build an image that contains the same BSP layer as Poky, the Yocto Project reference OS, and uses upstream U-Boot and grub as bootloaders.
You can choose to run Clea OS directly in the build container without graphics support, or in a different environment. To run QEMU in a different host, you need to build and install the Yocto SDK which contains a portable environment that includes QEMU and some necessary scripts.
Building
Building Clea OS for QEMU works the same as for the other boards. Follow the instructions provided on Build Clea OS or on the seco-manifest.
You will find all build artifacts in <build_dir>/tmp/deploy/images/<machine>/
.
The following table explains which files are needed to run Clea OS.
File | Description |
---|---|
seco-image-clea-os*-qemu*.ext4 | rootfs partition |
seco-image-clea-os*-qemu*.wic | complete OS image |
*.qemuboot.conf | runqemu configuration file |
Image , bzImage or zImage | kernel |
u-boot.bin | U-Boot bootloader image (ARM) |
Running
Use this command to run Clea OS on QEMU.
$ BIOS=[bios|bootloader] KERNEL=[image] runqemu [qemuboot.conf] wic slirp nographic
BIOS
variable: contains the path to a UEFI firmware image on x86 or the bootloader binary on ARM;KERNEL
variable: contains the path to the kernel image;[qemuboot.conf]
: path to the.qemuboot.conf
file;wic
: the complete OS image. This requires to set theBIOS
variable;slirp
: configures the guest network in a way that doesn't require root permissions;nographic
: disables the video output.
In order to run Clea OS Things on the QEMU x86 machines, you need a UEFI firmware image. You can download a prebuilt image of OVMF from https://www.kraxel.org/repos/jenkins/edk2/.
Running with the SDK
To run Clea OS on QEMU on a different host the the build host, and to enable graphics support, you need to build and install the Yocto SDK. After installing, source the environment setup script to use the SDK.
Then run runqemu
passing the .qemuboot.conf
file as argument.
$ BIOS=[bios|bootloader] runqemu [qemuboot.conf] slirp serialstdio
BIOS
variable: contains the path to a UEFI firmware image on x86 or the bootloader binary on ARM;[qemuboot.conf]
: path to the.qemuboot.conf
file;slirp
: configures the guest network in a way that doesn't require root permissions;serialstdio
: The command above runs QEMU with video output enabled. Theserialstdio
option keeps the serial console attached tostdio
, otherwise, it would be redirected to the display.