Method of building a QNX Hypervisor system
Building a QNX Hypervisor system entails adding the necessary hypervisor components to a QNX OS system, then building the host and guests using the appropriate build environments.
The QNX-supplied BSPs that support QNX Hypervisor include the necessary hypervisor functionality. (For a list of these BSPs, go to the release notes for your version of QNX Hypervisor.) To build a hypervisor host image, you use the hypervisor variant of the buildfile that comes with these BSPs, with a different make command. If no QNX-supplied BSP that supports QNX Hypervisor is compatible with your hardware, you must modify one of the buildfiles that comes with the BSP that supports your hardware to include the hypervisor components.
- Configure the proper environments for building the hypervisor host and any guests you plan to build.
- Build the guest OS images. If your project includes the guest content (e.g, IFS, VM configuration files) in the host IFS, it has to be available before you build the host IFS. Even if guest content is stored a system disk instead, QNX recommends that you create the guest first.
- If your BSP does not already support QNX Hypervisor, add the hypervisor components to the buildfile. These components include the qvm binary, its supporting vdev-*.so, one or more VM configuration files, and the smmuman binary and its supporting libraries and configuration files.
- Build the host IFS.
-
If it's applicable in your environment, build a bootable disk image. QNX-supplied BSPs that support QNX Hypervisor include the disk image as a target. For other BSPs, you can add disk image building functionality, if needed.
- If you're using a disk image for your system, transfer it to the target hardware board. Otherwise, transfer your host IFS to the board.
If you use the hypervisor variant buildfile that QNX Hypervisor provides, you build the host IFS with the command make hyp.
Using mkqnximage to build a QNX Hypervisor system
You can use the mkqnximage QNX OS virtual machine image generator to build a QNX Hypervisor system, which can be useful for both demonstration and development purposes.
Make sure that you have installed the QNX SDP virtualization drivers (these drivers are included by default when you install QNX Hypervisor).
- To build the guest OS, run mkqnximage with the options that are
appropriate for your project and specify
qvm
as the type (i.e.,--type=qvm
). - To build the host OS, in a separate directory from where you built the guest OS, run
mkqnximage with the --qvm and
--guest options. For example:
mkqnximage --qvm=yes --guest=path_to_guest
where --guest specifies a directory in which you ran mkqnximage to build a guest image. The --guest option only works for guests that were created using mkqnximage.
You can use mkqnximage snippet files to include additional guests or ones other than those generated by mkqnximage (e.g, update local/data_files.custom to include the required files).
- Use one or both of the following methods to test your hypervisor system:
- For a basic test as to whether your hypervisor system works, after it has booted, run qvm-check.
- Examine the contents of /proc/config for details about the status of
the hypervisor on the host system. For example, to display just the
status of QNX Hypervisor:
(You can use cat to display the full contents of /proc/config.)# grep virtualization /proc/config virtualization:enabled
- If you used --guest to include a guest, you can use the script /data/hypervisor/start_guest to start it.