Skip to main content
Version: kirkstone_1-08-00

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 nameQEMU MachineCPUBootloaderKernelStorage
qemuarmvirtarmu-bootlinux-yoctovirtio
qemuarm64virtaarch64u-bootlinux-yoctovirtio
qemux86q35x86grublinux-yoctovirtio
qemux86-64q35x86-64grublinux-yoctovirtio

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.

FileDescription
seco-image-clea-os*-qemu*.ext4rootfs partition
seco-image-clea-os*-qemu*.wiccomplete OS image
*.qemuboot.confrunqemu configuration file
Image, bzImage or zImagekernel
u-boot.binU-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 the BIOS variable;
  • slirp: configures the guest network in a way that doesn't require root permissions;
  • nographic: disables the video output.
info

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. The serialstdio option keeps the serial console attached to stdio, otherwise, it would be redirected to the display.