Attention

You are viewing an older version of the documentation. The latest version is v3.3.

Using QEMU during development

Testing and debugging images with QEMU

While extending or modifying ECI images, it’s handy to use Yocto’s integrated QEMU features for testing and debugging with minimal turnaround times.

Note

Some images (for example, ACRN) or features (for example, TSN) require special HW features (CPU virtualization VT-x, i210 network controller). These images might not be runnable within QEMU and the features might not work as expected.

QEMU testing prerequisites

  • A manual build of an ECI target, e.g. base-poky

    $ cd /home/eci/Desktop/eci-release/build/ecs-base-poky/poky
    $ source oe-init-build-env ../build
    $ bitbake ecs-image-base-poky
    

Running QEMU

Please make yourself familiar with runqemu and check the it’s full set of command line parameters

$ runqemu --help

Below are some common steps and commands for launching QEMU:

  • Change into $BUILDDIR

    $ cd $BUILDDIR
    
  • Start QEMU (with default settings and default image)

    $ runqemu
    
  • Recommended QEMU execution

    $ runqemu kvm slirp qemuparams="-m 4096"
    
    • kvm: recommeded

      Uses KVM to run the image, much faster than emulation, requires KVM working on host system, see the Yocto documentation

    • slirp: recommeded

      Uses user networking instead of tap device based, provides separate virtual network with DHCP

    • qemuparams="-m 4096": recommeded

      Passes parameter to QEMU, here sets memory to 4GB

    • wic ovmf: optional

      Uses the wic image, normally implies usage of ovmf BIOS for EFI boot, allows boot menu testing