Add Mono Runtime to Yocto Image

Step 5 of 5

Now that we have a functioning OS on the board, we have to add Mono Runtime to it. This step is also not fully straightforward, some tricks must be pulled from a sleeve. Read carefully.

Install kernel v. 6.2.12 on Fedora 36 VM (IMPORTANT)

The first step is to downgrade kernel to v. 6.2.12. This may seem odd at first, but building Mono runtime on any kernel greater than v. 6.2.12 crashes. This fact has been documented in multiple on-line resources, including e.g., Bugzilla of Red Hat community.

  1. Open your favourite terminal (MATE, VS Code, or similar).
  2. Prepare download folder.

    mkdir ~/kernel-6.2.12
    cd ~/kernel-6.2.12

  3. Download packages.

    wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-6.2.12-100.fc36.x86_64.rpm
    wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-core-6.2.12-100.fc36.x86_64.rpm
    wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-modules-6.2.12-100.fc36.x86_64.rpm
    wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-modules-extra-6.2.12-100.fc36.x86_64.rpm
    wget https://kojipkgs.fedoraproject.org/packages/kernel/6.2.12/100.fc36/x86_64/kernel-modules-core-6.2.12-100.fc36.x86_64.rpm

  4. Install them.

    sudo dnf install ./*.rpm

  5. Verify, if installation was successful.

    sudo grubby --info=ALL | grep 6.2.12

  6. Reboot your VM.

    reboot

  7. While booting, choose Advanced options → Fedora 6.2.12

Optional tip:
Read this material.

Preparing Yocto build environment for Mono runtime

  1. In your Fedora VM, Start Visual Studio Code.
  2. File → Open Folder → open /home/developer/fsimx6-Y2024.04.1/build/yocto-fus/sources folder.
  3. Terminal → New Terminal folder.
  4. Verify in terminal, that you are located in /home/developer/fsimx6-Y2024.04.1/build/yocto-fus/sources folder.

    pwd

    If not, then cd into it.

  5. Git clone meta-mono layer.

    git clone https://github.com/DynamicDevices/meta-mono.git -b kirkstone
    cd meta-mono

  6. We are going to create a new recipe that will allow us to build OS which includes Mono runtime. We will call the recipe fus-image-mono.

  7. In Visual Studio Code’s file browser, browse to folder, where OS image recipes are defined, that is into: meta-fus/recipes-config/images.
  8. Create a new file fus-image-mono.bb in the folder. Feel free to utilize Visual Studio Code’s file explorer and code editor to do this. Depending no your taste, it is probably more simple that way, as opposed to typing commands into terminal. If you prefer terminal way of doing things, you can do that too.
  9. Put this content into it:

    	DESCRIPTION = "F&S Mono image"
    LICENSE = "MIT"
     
    require recipes-config/images/fus-image-std.bb
     
    inherit features_check
    IMAGE_INSTALL += "mono tzdata libgdiplus"
    DEFAULT_TEST_SUITES_pn-${PN} = "mono ssh ping"

    Save the file.

  10. Now open a different folder with Visual Studio Code: File → Open Folder → open /home/developer/fsimx6-Y2024.04.1/build/yocto-fus/build-fsimx6-fus-imx-xwayland/conf folder.
  11. In Visual Studio Code, open bblayers.conf file.
  12. Add this line to the end of it:
    BBLAYERS += "${BSPDIR}/sources/meta-mono"

  13. Optionally, if you want to decrease OS build time, consider commenting out some layers, which are not needed in the resulting OS image. These could include:

    # BBLAYERS += "${BSPDIR}/sources/meta-nxp-demo-experience"
    # BBLAYERS += "${BSPDIR}/sources/meta-browser/meta-chromium"
    # BBLAYERS += "${BSPDIR}/sources/meta-virtualization"
    # BBLAYERS += "${BSPDIR}/sources/meta-clang"

  14. Terminal → New Terminal folder.
  15. Browse into /home/developer/fsimx6-Y2024.04.1/build/yocto-fus folder again.

    cd /home/developer/fsimx6-Y2024.04.1/build/yocto-fus

  16. Set environment variables.

    DISTRO=fus-imx-xwayland MACHINE=fsimx6 source setup-environment build-fsimx6-fus-imx-xwayland

  17. Start OS build process.

    bitbake fus-image-mono

Deploying Mono image to the board

Once the OS image is built, it is time to deploy it to the board. The deployment is very similar to the one described in OS deployment section of previous article, however a few file names are changed.
So perform the same steps, however use this set of terminal commands to copy files to SD Card.

cp -L armstonea9q-fsimx6.dtb /mnt/f/armstonea9q.dtb
cp -L install.scr /mnt/f
cp -L fus-image-mono-fsimx6.manifest /mnt/f
cp -L fus-image-mono-fsimx6.ubifs /mnt/f/rootfs-fsimx6.ubifs
cp -L uboot.nb0 /mnt/f
cp -L zImage /mnt/f/zImage-fsimx6

In other words, instead of copying fus-image-std root file system data, we copy fus-image-mono file system data.

  1. Once copied, remove SD card from host computer, plug it into the boad and reboot the board. Since you now already have U-Boot on the board, it is not necessary to re-flash it with U-Boot. Instead, we can use the existing U-Boot to just reflash the board with the OS. Therefore, when booting up, check the messages that are displayed in DCUTerm. As soon as you see an U-Boot message Hit any key to ..., press a key on the keyboard. That will interrupt the boot process and allow you to type commands into U-Boot.
  2. Type this command to verify, that U-Boot is able to read data from SD card. The command should list files on your SD Card:
    ls mmc 0

  3. If the command succeeded, use this command to tell U-Boot to reflash the OS from SD card:
    update.install
    saveenv
    reset

  4. When the OS boots up, log into it (by default, username: root, no password).
  5. Type mono --version command at command prompt. If version information appears, then Mono runtime is properly installed.

Documentation notice

Information may change over time

Created
Last technically reviewed

Technical details on this page may change as vendor tools, board support packages, operating system images, and runtime versions evolve.

This page was last technically reviewed on May 5, 2026. If your setup differs from the one described here, please contact us for help.