WarpBuild LogoWarpBuild Docs

Nested Virtualization

Which WarpBuild runner classes expose /dev/kvm, and how to enable it with runs-on labels for Android emulators and other KVM-dependent workloads

Some CI workloads need nested virtualization in the runner guest to use hardware acceleration via /dev/kvm. The most common example is reactivecircus/android-emulator-runner for Android instrumentation tests, but some QEMU and libvirt workflows also need it.

WarpBuild Cloud

Enable nested virtualization on cloud runners by adding nested-virtualization.enabled=true to the runs-on label in your workflow:

jobs:
  instrumentation-tests:
    runs-on: warp-ubuntu-latest-x64-4x;nested-virtualization.enabled=true

WarpBuild provisions the runner on hardware that supports nested virtualization and exposes the virtualization extensions to the guest, making /dev/kvm available.

BYOC (Bring Your Own Cloud)

On BYOC runner sets (AWS, GCP, and Azure), nested virtualization is automatically enabled when all of the selected instance types for the runner set support it. No extra configuration or labels are required.

Nested virtualization is only enabled when all instance types configured for the runner set support it. If you select a mix of supporting and non-supporting instance types for availability, nested virtualization will not be enabled to avoid inconsistent behavior across jobs.

Support matrix

Runner classNested virtualization supported
Cloud: Linux x86-64Yes, via runs-on label
Cloud: Linux ARM64No
Cloud: WindowsNo
Cloud: macOSNo
BYOC: AWS (Linux x86-64)Yes, auto-enabled if all instance types support it
BYOC: GCP (Linux x86-64)Yes, auto-enabled if all instance types support it
BYOC: Azure (Linux x86-64)Yes, auto-enabled on supported VM sizes
BYOC: ARM64 / WindowsNo

If you include the nested-virtualization.enabled=true label on an unsupported cloud runner type, the label will be silently ignored and the job will run normally without nested virtualization.

Android emulator workflows require a permissions step

Once /dev/kvm is available on the runner, the default device permissions (crw-rw---- root:kvm) still prevent the runner user from opening it so the following step is required before running reactivecircus/android-emulator-runner:

- name: Enable KVM group perms
  run: |
    echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
      | sudo tee /etc/udev/rules.d/99-kvm4all.rules
    sudo udevadm control --reload-rules
    sudo udevadm trigger --name-match=kvm

The step is not a WarpBuild-specific workaround and is required in all GitHub and GitHub-compatible runners.

See Android emulator action's README and GitHub's blog about hardware-accelerated Android virtualization.

Without this step, the Android emulator action's ProbeKVM check fails and it silently launches the emulator with -accel off, falling back to pure software emulation, which is substantially slower than hardware-accelerated execution. Symptoms in your workflow logs:

  1. ProbeKVM: This user doesn't have permissions to use KVM (/dev/kvm).
  2. Disabling Linux hardware acceleration.
  3. The emulator command line includes -accel off.

After adding the step, those messages disappear and tests run with hardware acceleration.

Last updated on

On this page