Creating a QNX virtual machine

Updated: April 19, 2023

When you create a QNX Virtual Machine target connection, the IDE uses the mkqnximage utility to generate a target VM that runs a QNX system image based on settings you specify, such as the CPU architecture and VM platform.

If you plan to use VirtualBox as the VM platform and it's your first time using VirtualBox on your host machine, you likely have to create a network interface. For information on doing so, see the mkqnximage description in the Utilities Reference. If you don't create a network interface, when the IDE finishes creating the VM and tries to start it on the target, the VM will fail to boot and the IDE will output a vague error message.
To create a QNX virtual machine:
  1. In the launch bar at the top of the IDE UI, click the button for the Launch Target dropdown, which is the rightmost dropdown.
  2. Select New Launch Target to open the launch target wizard selector.
  3. Select QNX Virtual Machine Target in the list of target types, then click Next to open the New QNX Virtual Machine Target window.
  4. In the Target Name field, enter a name for your target.
  5. Configure any other settings needed for your new VM.
    You can set the following fields:
    • VM Platform — the VM platform in which the generated QNX system image will run. The possible platforms are QEMU, VMware, and VirtualBox, but not all VM platforms work with all host OSs. Also, there may be varying levels of support for different VM platforms, in terms of the capabilities of the generated system image. For more information, see the mkqnximage reference.
    • CPU Architecture — the CPU architecture for which the target VM will be built. To learn how to see which combinations of VM platform and CPU architecture are officially supported for a given host OS, see the mkqnximage reference.
      The IDE doesn't enforce the usage of the supported combinations for these settings. You can use unsupported combinations at your own risk because the IDE won't stop you. However, the QNX system image may fail to build or may crash during bootup.
    • IP Address — the IP address of the target, which is used by the target connection to talk to qconn. If this is left blank, the IDE automatically finds the VM's IP address.
    • Extra Options — additional mkqnximage options. The mkqnximage reference lists and describes the available options.

    Below the configurable fields, there's a read-only text box showing the command line that will be passed to mkqnximage based on the options you've set. This field is useful for understanding the relation between your settings and the resulting image, and for extracting the command line if you want to run it manually (i.e., outside of the IDE).

  6. Click Finish to create the VM.
    The IDE calls the mkqnximage utility with options based on your configured settings. The utility tries to generate a VM with a QNX system image, and the operation output is displayed in the Console window so you can see any errors and warnings.
    Note: If there was a serious error and the VM couldn't be generated, the target connection will still be created but won't be usable until you fix the problem and rebuild the VM. When you restart the IDE, it will try to regenerate the VM.
The IDE adds an entry for the target referred to by the new connection to the Launch Target dropdown, and in the Project Explorer and Target Navigator views, whose visiblity depend on which IDE perspective is selected. The IDE also tries to connect to the target using the specified settings. If the connection attempt succeeds, you'll see a purple circle symbolizing a physical connector (even if your target is virtual) but with no red box (), on the left of the launch target name. If it fails, you'll see a red box with an X in the lower left corner of the icon ().
You can now select the new launch target to tell the IDE to debug, profile, or run an application on the QNX VM target. You can also start and stop the VM, rebuild it with the same or different settings, or delete it, as explained in Controlling a QNX virtual machine.