# Create a secondary virtual machine

This section provides the steps for creating virtual machine (VM)
images using the Qualcomm Linux build system. The Guest VM rootfs and Guest VM
kernel are same as that of the host.

Qualcomm Linux supports virtual machine monitors, with or without KVM.
Currently, Qualcomm Linux supports only [QEMU](https://www.QEMU.org/) as VM monitor.

The procedure provides the following:

> 
> 
> - Command to setup KVM.
> - Commands to launch the Guest VM using QEMU.

## Set up the development machine

To set up the development machine, follow the steps:

1. To set up the build, see [Build Qualcomm Linux](https://docs.qualcomm.com/doc/80-80022-27/topic/build_qualcomm_linux.html#build-qualcomm-linux).

Note

Use `DISTRO=qcom-distro-kvm` when building for KVM.
KVM is supported on the following machines:

    - iq-9075-evk
    - iq-8275-evk
    - rb3gen2-core-kit
    - qcs9100-ride-sx
2. Append `virtualization` to `DISTRO_FEATURES` in build directory: `conf/local.conf`.

DISTRO_FEATURES:append = " virtualization"
        Copy to clipboard
3. Build `qcom-console-image` or `qcom-multimedia-image`:

bitbake qcom-console-image
        Copy to clipboard

## Launch Guest VM

This section describes how to launch a Guest VM on a Qualcomm Linux machine using QEMU, with and without Kernel‑based virtual machine (KVM) acceleration.

Prerequisites

- QEMU is available on the machine.
- The Guest VM uses the host root file system image.
- The Guest VM kernel image is available at `/boot/Image`.

1. Copy the host root file system image to the device and use it as the root file system for the Guest VM.

Note

If `qcom-console-image` is built for the `qcs9100-ride-sx` platform, the root file system image for the Guest VM is available at: `<build dir>/tmp/deploy/images/qcs9100-ride-sx/qcom-console-image-qcs9100-ride-sx.rootfs.qcomflash/rootfs.img`.
2. Launch the Guest VM.

    - Launching the Guest VM without KVM acceleration:

        Run the following command to launch the Guest VM using QEMU without KVM acceleration:

> 
> 
> qemu-system-aarch64 -M virt  \
>                                 -cpu cortex-a76  \
>                                 -m 4G \
>                                 -kernel /boot/Image \
>                                 -drive file=rootfs.img,if=virtio,format=raw \
>                                 -append "root=/dev/vda" \
>                                 -accel tcg \
>                                 -smp 4 \
>                                 -nographic
>             Copy to clipboard
    - Launching the Guest VM with KVM:

Note

        - The distribution must be built with `DISTRO=qcom-distro-kvm`.
        - The `/dev/kvm` device node must be present on the machine.

        - Verify that KVM is available:

ls /dev/kvm
                Copy to clipboard
        - Run the following command to launch Guest VM in QEMU with KVM acceleration.

qemu-system-aarch64 -M virt \
                                    -m 4G \
                                    -kernel /boot/Image \
                                    -drive file=rootfs.img,if=virtio,format=raw \
                                    -append "root=/dev/vda" \
                                    -enable-kvm \
                                    -cpu host \
                                    --enable-kvm \
                                    -smp 4 \
                                    -nographic
                Copy to clipboard

Note

    - The `rootfs.img` file is located in the current working directory. To use a different location, update the `-drive` option accordingly.
For example: `-drive file=/mydir/rootfs.img,if=virtio,format=raw`
    - The Guest VM kernel is provided using the `-kernel /boot/Image` option.

For more information, see [Enable virtualization](https://docs.qualcomm.com/bundle/publicresource/topics/80-80022-3/virtualization.html).

Last Published: May 10, 2026

[Previous Topic
Set up Kubernetes with Qualcomm Linux](https://docs.qualcomm.com/bundle/publicresource/80-80022-27/topics/setup_kubernetes_with_qualcomm_linux.md) [Next Topic
Update firmware and OS on Qualcomm Linux using capsule and OSTree mechanisms](https://docs.qualcomm.com/bundle/publicresource/80-80022-27/topics/update_fw_and_os_qualcomm_linux_using_capsule_and_ostree_mechanisms.md)