| Updated: October 28, 2024 |
QNX hypervisors support Linux and Android guests, provided these guests are built for virtual hardware that the hypervisor can present to the guest in a VM.
The information below is only an outline of what you need to do to implement a Linux guest in a QNX hypervisor system. Refer to your Linux documentation for information about how to configure and build your Linux system.
When you build non-QNX guests to run in a QNX virtualized environment, you must build them for the right hardware architecture, and configure the VMs in which they'll run to match their expectations.
To implement a Linux OS as a guest, you need to do the following:
Write a VM configuration file (e.g., linuxvm1.qvmconf) that assembles in a VM the components your Linux OS will expect to find on the platform where it will run.
For a sample file, see Configuration file for VM hosting a Linux guest (example) below.
To be useful in a virtualized environment, your Linux guest will probably need to include some additional drivers, applications, and utilities. For example:
You start Linux guests the same way you start QNX guests: start the VM, either through the command line, or by adding to the hypervisor host startup routine the instructions for starting the hosting qvm process instance (see Starting and using guests).
When you start your Linux guest, however, you'll probably need to provide it with some command-line arguments. To do this, you can use the qvm cmdline configuration option to hand the startup arguments to the Linux kernel (see cmdline in the VM Configuration Reference chapter). For example, we might use the following to tell the Linux kernel where to find the console:
On ARM platforms:
cmdline
console=ttyAMA0 earlycon=pl011,0x1c090000
points the Linux kernel to a virtual PL011 UART device located at 0x1c090000 in guest-physical memory. Don't forget to include this device in your VM configuration.
cmdline
pmtmr=0 nolapic_timer
tasks=standard pkgsel/language-pack-patterns=
pkgsel/install-language-support=false
console=ttyS0,115200n8 reboot=t
points to a virtual 8250 UART (ttyS0 is Linux's device name
for an 8250 UART device). Don't forget to include this device in your VM
configuration.To boot from disk, a Linux guest needs to know in which partition the root filesystem is installed (i.e., the filesystem that gets mounted at location /). When you have this information, you can specify the information with a command-line argument in the VM configuration file. For example:
cmdline
root=/dev/vda1
where vda1 refers to the first virtio-blk vdev entry in the configuration for the VM (for more information, see Making command-line arguments available to a Linux guest above).
If you use a virtio-blk device for your disk, remember that in Linux these devices present as /dev/vda*, /dev/vdb*, etc.
If your device is a pass-through device, you'll need to know its device entry (probably /dev/hda*) and make it known to the Linux guest so it can boot.
Below is an example of a *.qvmconf file for a Linux guest. Note the use of the reserve and rom options for the regions where OSs designed to run on x86 platforms expect to find a VGA device and the BIOS.
# A minimalist VM configuration for a Linux guest on an x86 system
ram 0,0xa0000
reserve loc 0xa0000,0x20000
rom 0xc0000,0x40000
ram 1m,1023 cpu
cpu
load ./linux
initrd load ./initrd.gz
cmdline "pmtmr=0
nolapic_timer tasks=standard pkgsel/language-pack-patterns=
pkgsel/install-language-support=false console=ttyS0,115200n8
reboot=t root=/dev/vda1"
vdev ioapic
loc 0xf8000000
intr apic
name myioapic
vdev ser8250
intr myioapic:4
vdev timer8254
intr myioapic:0
vdev mc146818
reg 0x0b,0x02
vdev shmem
vdev virtio-net
peer /dev/vdevpeers/vp0
peerfeats 0x00007fc3
loc pci:0:1
name guest_to_host
vdev virtio-blk
hostdev /dev/hd1t131
vdev pckeyboard
vdev 8259
loc 0x20
vdev 8259
loc 0xa0
vdev hpet
loc 0xf8008000
intr myioapic:0,myioapic:8,myioapic:10
pass loc pci:0:2.0=pci:0:2.0
pass loc pci:0x8086/0x5aa8
vdev pci-dummy clone pci:0:31.0
To build an Android guest, you need:
Follow the outline instructions for building a Linux guest, adapted for your Android OS.