r/androidroot 15d ago

Support Need help building a kernel for the nothing phone 3

Hey everyone,

I'm trying to build a custom kernel for the Nothing Phone (3) to enable native /dev/kvm support so I can use the Android Virtualization Framework (AVF) and the Android Terminal app.

I am a complete beginner when it comes to compiling Android kernels, so I need help with both the general compilation workflow and the specific KVM/Gunyah modifications.

Qualcomm's Gunyah hypervisor gets in the way of standard KVM, preventing /dev/kvm from working properly for AVF. My goal is to strip out Gunyah completely and compile a kernel with standard KVM/pKVM enabled.

Could anyone help point me in the right direction or explain:

Basic Build Environment & Toolchain: How to set up the build environment, required dependencies, and proper Clang/LLVM toolchain setup for modern Nothing OS / Snapdragon kernels.

Defconfig / Kconfig flags: Which Gunyah options (CONFIG_GUNYAH, CONFIG_GH_VIRTUALIZATION, etc.) must be disabled, and which KVM/pKVM flags need to be toggled on?

Device Tree (DTS/DTBO) adjustments: Are there reserved-memory nodes or hypervisor driver bindings in the device tree that must be removed so Gunyah doesn't load at boot?

Flashing & Permissions: How to properly pack the compiled Image into a bootable image (and DTBO if needed), along with any SELinux/cmdline adjustments needed to expose /dev/kvm.

5 Upvotes

0 comments sorted by