Launching a Yocto Linux guest

Updated: March 11, 2025

This chapter covers how to create and launch a Yocto Linux guest on the QNX Hypervisor AMI.
Note: Yocto 4.2 (“mickledore”) is used in the QAVF and has been tested using Ubuntu 20.04 LTS.
This chapter contains the following topics:

Meeting the hardware requirements

Your host should meet or exceed the following hardware requirements:
  • A 64-bit x86 system
  • At least 400GB of disk space
  • A minimum 64GB of RAM
For details on hardware requirements, go to the Yocto Project Reference Manual at https://docs.yoctoproject.org/ref-manual/system-requirements.html

Installing the required software

Your host must use Ubuntu 18.04 or later. To install the required packages, run the following command:
sudo apt -y install gawk wget git diffstat unzip texinfo gcc build-essential
                    chrpath socat cpio python3 python3-pip python3-pexpect
                    xz-utils debianutils iputils-ping python3-git
                    python3-jinja2 libegl1-mesa libsdl1.2-dev python3-subunit
                    mesa-common-dev zstd liblz4-tool file locales
Note: These steps were tested on Ubuntu 22.04. Other versions may have additional dependencies.

Downloading the Yocto components

You can download the Yocto Project source and the additional layers with the following commands:
mkdir Yocto
cd Yocto
git clone git://git.yoctoproject.org/poky.git -b mickledore
git clone https://github.com/openembedded/meta-openembedded -b mickledore
          poky/meta-openembedded
git clone https://github.com/kraj/meta-clang -b mickledore poky/meta-clang
git clone https://github.com/OSSystems/meta-browser.git poky/meta-browser

cd poky/meta-browser
git checkout 9db8c774c348de70f1946a8b28da33f6f97bd26f
cd ../../

git clone https://github.com/meta-qt5/meta-qt5 -b mickledore poky/meta-qt5

Adding the QNX Git content

You can add the QNX Git content to the Yocto with the following commands:
cd Yocto
git clone https://gitlab.com/qnx/hypervisor/yocto/build-config.git -b mickledore build/conf
git clone https://gitlab.com/qnx/hypervisor/yocto/meta-qnx.git -b mickledore poky/meta-qnx

Building the Yocto guest

You can build the Yocto guest with the following steps:
  1. Create the scripts directory under Yocto
  2. Create the yocto-build.sh script with the following text:
    #!/bin/bash
    
    export WORKSPACE=$PWD
    export IMAGE="core-image-weston"
    export MACHINE="qvmaarch64"
    
    cd $WORKSPACE
    
    export BBPATH=$WORKSPACE/build
    
    source $WORKSPACE/poky/oe-init-build-env
    
    export WESTON_INI_DIR=$WORKSPACE/poky/meta-qnx/meta-qvm/recipes
    -graphics/wayland/files/
    
    echo "Using Weston Desktop"
    cp $WESTON_INI_DIR/weston_desktop.ini $WESTON_INI_DIR/weston.ini
    
    echo "Building $IMAGE for $MACHINE"
    MACHINE=$MACHINE bitbake $IMAGE
    if [ $? != 0 ]; then
    echo "Error building $IMAGE!"
    exit 1
    fi
  3. Run the build script from the Yocto root folder:
    cd Yocto
    ./scripts/yocto-build.sh

Installing and running the built Yocto guest

After building your Yocto guest, you install the built guest to your cloud target and run it.

To install the Yocto guest:
  1. Copy the Yocto kernel and filesystem to the target:
    scp ./build/tmp/deploy/images/qvmaarch64/Image
    					root@<target-ip>:/guests/linux/Yocto4.2/
    					scp ./build/tmp/deploy/images/qvmaarch64/core-image-weston-qvmaarch64.ext4
    					root@<target-ip>:/guests/linux/Yocto4.2/
  2. To manually start Yocto on boot, run the following command using SSH:
    qvm @/guests/linux/Yocto4.2/yocto-linux-weston.conf &

Connecting to the Yocto guest

You can connect to the Yocto guest using the guest IP address:
ssh -p 24 root@<target-ip>

Stopping the Yocto QVM process after running the Yocto guest

If you configured the Yocto guest files and rebuilt the guest, then you must slay the QVM process of the previous Yocto guest on the target before copying your rebuilt Yocto guest files to the target.
CAUTION:
If you copy files to the target before slaying the QVM process, then you can corrupt the target filesystem.
Stop the all QVMs

To stop all QVMs, run slay qvm on the target.

Only stop the Yocto QVM
To only stop the Yocto QVM, find the specific QVM process and then kill the process. For example:
  1. Find the specific QVM process:
    pidin -f aA | grep yocto
    8019999 qvm @/guests/linux/Yocto4.2/yocto-linux-weston.conf
    8061024 grep yocto
  2. Kill the process:
    kill -9 8019999