Building the host

After you have installed the QNX Hypervisor product, all of the components needed to build the hypervisor host should be on your development host. After you have configured your build environment and built one or more guests, you are now ready to build the hypervisor host into an IFS.

Building with a hypervisor buildfile variant

If your BSP provides a hypervisor buildfile variant, to build the host:

  1. Unzip the archive that contains the BSP.
  2. Locate the hypervisor buildfile variant within your BSP. This buildfile variant is in the same directory as the generic buildfile but its name contains -hypervisor; for example, /images/mek/imx8qm-cpu-mek-hypervisor.build.
  3. If you want to use the shmem-host shared memory demonstration application, you need to build it. For more information, go to Adding the shmem-host shared memory demonstration application.
  4. Use the following command to make the BSP's prebuilt binaries available to the BSP's build system:
    make prebuilt
  5. Change to the /images directory (e.g., cd images/), and then use the following command to build the host IFS:
    make hyp
    Note:
    If you run simply make, the build utility uses the default buildfile that comes with the BSP and, thus, won't build a hypervisor host image. The command make hyp won't work if the QNX Hypervisor product is not installed.
  6. Use the following command to build the host disk image:
    make disk_image

Building without a hypervisor buildfile variant

If your BSP does not provide a hypervisor buildfile variant, to build the host:

  1. Unzip the archive that contains the BSP.
  2. If you want to include the shmem-host shared memory demonstration application, you need to build it using source code you obtain from a BSP provided with QNX Hypervisor. For more information, go to Adding the shmem-host shared memory demonstration application.
  3. Use the following command to make the BSP's prebuilt binaries available to the BSP's build system:
    make prebuilt
  4. Change to the /images directory (e.g., cd images/).
  5. Modify the buildfile to include the files you need for your hypervisor system at the appropriate target locations. These include:
    • The QNX virtual machine binary, qvm, and, optionally for x86, the qvm-check utility. For example:
      /sbin/qvm = qvm
      /bin/qvm-check = qvm-check
    • The configuration files (*.qvmconf) for each VM that you will run in your hypervisor system:
      infotainment_ubuntu.qvmconf
    • The shared object (vdev-*.so) file for every vdev you want to make available for your guests. For example:
      vdev-8259.so
      vdev-hpet.so
      vdev-ioapic.so
      ...
      vdev-virtio-console.so
      vdev-virtio-input.so
      vdev-virtio-net.so
    • The smmuman service, architecture, and board support libraries, and configuration files. For example, for a QNX hypervisor system on a supported Intel x86 board:
      /bin/smmuman = smmuman
      /bin/smmu-vtd.so = smmu-vtd.so
      /etc/smmuman/vtd.smmu = ./smmuman-config/vtd.smmu
  6. Modify the buildfile to include -Q enable in the startup driver arguments, inside the virtual attribute that specifies arguments to the startup driver and kernel.
  7. Run make to build the host IFS using the host buildfile.
  8. If it's applicable in your environment, build a bootable disk image:
    • Use the make disk_image command, if your BSP supports it.
    • For other BSPs, you can create a system disk image using the diskimage utility (go to the diskimage entry in the QNX OS Utilities Reference).
    • For an example of host disk image creation, in a QNX-supplied BSP that supports QNX Hypervisor, examine the Makefile located at images/board_variant/Makefile. The entry for the disk_image target illustrates which tools and scripts are called, and which configuration and buildfiles are used (some of which are found in the images/ folder).
    • For more information, go to Hypervisor disk images and Transferring the disk image.

Adding the shmem-host shared memory demonstration application

If you want to use the shmem-host shared memory demonstration application, use the following steps:

  1. If you are not using a host BSP provided with QNX Hypervisor:
    1. Unzip the archive that contains a BSP provided with QNX Hypervisor.
    2. Copy the source code from that BSP's src/apps/hypervisor/demos/shmem-host/ directory to your BSP's src/ directory.
    (QNX-supplied BSPs that support QNX Hypervisor already have the source code, you just need to build the application.)
  2. Optionally, to modify the application, make the required changes to the source code in the BSP's src/apps/hypervisor/demos/shmem-host/ directory.
  3. Build and install the application. For example, in the new src/apps/hypervisor/demos/shmem-host/ directory, run make install to copy the revised binary to install/.

    The binary is ready to include in your buildfile.

The shmem-host application expects to communicate with a peer via the shared memory virtual device vdev. In most cases, this peer is either shmem-guest or shmem-linux, running inside of a guest equipped with the appropriate vdev.

Page updated: