Refer release notes to know about platform capability and support for hypervisor solution.
Prerequisites and Kconfig
Enable the following in the host kernel configuration:Boot the kernel in EL2
Platforms are now configured to boot into KVM as default except few. Please refer to release notes to know about each platform capability. For platforms that boot into Gunyah instead of KVM, use following instructions to switch to KVM. Follow the steps in the order given.Platforms that are configured to boot into KVM as default will not require
below steps.
- Boot using the default images.
-
Update the EFI variable to select the KVM device tree overlay:
-
Reboot into fastboot mode. Run the following command on the device shell:
-
Flash the KVM XBL config image from the host:
The
xbl_config_kvm.elffile is located underbuild/tmp/deploy/images/<machine-name>in the Yocto build output. Replace the following:<machine-name>by the actual Yocto machine configuration name, for exampleiq-9075-evk.
- Reboot the device.
Launch a guest VM
Before launching a guest VM, ensure the guest kernel image (Image), root file system CPIO (rootfs.cpio.gz), and root file system image (rootfs.ext4) are present in the /mnt/overlay/guest/ directory on the host.
Using QEMU
Boot with a ramdisk:Using libvirt
Libvirt manages VMs through thevirsh command-line utility and the libvirtd daemon. Define a VM from an XML domain file, then control it with the following commands:
Table: Common virsh VM management commands
Replace the following:
<xml-file>by the path to the libvirt XML domain definition file.<domain>by the VM domain name as defined in the XML<name>element.
Virtio device support
Virtio provides a paravirtualized I/O framework for high-performance device emulation between guest VMs and the host. Front-end drivers run in the guest OS; back-end drivers run in QEMU or the kernel. Communication uses virtqueues (ring buffers) to minimize guest-to-host transitions. Table: Supported virtio devicesHost-to-guest file sharing (virtio-9p)
Pass a host directory to a guest VM using the 9P file system:<mount-point>by the directory inside the guest to mount the shared folder.
Virtual sockets (VSOCK)
VSOCK enables socket communication between guest VMs and the host using a context identifier (CID). The host CID is always 2; guest CIDs start from 3. Table: Reserved CID values
Add VSOCK to a QEMU invocation:
<cid>by the CID to assign to the guest VM, for example73.
Device passthrough
Physical devices can be passed through to a guest VM using VFIO (PCI), libusb (USB), or a chardev backend (UART). Identify USB devices on the host:lsusb:
lspci:
<vid>and<pid>by the USB vendor and product ID in hex, for example0x0781and0x5567.<bus>,<slot>,<function>by the PCI address components fromlspcioutput.
chardev backend pointing to the host TTY device and expose it to the guest as a virtserialport.
Observability and maintenance
KVM traces
Enable KVM event tracing via tracefs:Watchdog
QEMU emulates an I6300 ESB watchdog device, exposed to the guest as a standard watchdog character device. Enable it in the guest kernel:action attribute controls behavior on timeout: reset restarts the guest, poweroff shuts it down. For details, see the libvirt watchdog documentation.
Remote command execution
The QEMU guest agent (qemu-ga) allows commands to be run on a guest VM from the host without a network connection. Enable qemu-ga in the guest OS user space and configure it through a virtio-serial interface.
Use virsh qemu-agent-command with the guest-exec subcommand to execute commands remotely:
<domain>by the VM domain name.

