The error you're encountering, Could not access KVM kernel module: No such file or directory, indicates that the KVM (Kernel-based Virtual Machine) module is either not loaded or not available in your kernel. This is a common issue when running QEMU with KVM acceleration on devices where KVM support is not enabled by default, such as most Android-based systems (including LineageOS).
Why This Happens on Fairphone 4 / LineageOS
Android Kernel Limitations:
Most Android kernels (including LineageOS) do not include KVM support by default, as it is rarely needed on mobile devices.
Even if your device's CPU supports virtualization (e.g., ARMv8 with virtualization extensions), the kernel may not expose the /dev/kvm device node.
Termux Environment:
Termux runs in an unprivileged environment, and even with sudo su, it may not have access to kernel modules or /dev/kvm if the kernel lacks support.
How to Check KVM Availability
Run this command in Termux:
bash
ls /dev/kvm
If the file does not exist, your kernel does not support KVM.
If it exists but you still get the error, it may be a permissions issue (unlikely in sudo su).
Possible Solutions
1. Check if Your Kernel Supports KVM
Run:
bash
cat /proc/cpuinfo | grep -i virtualization
or:
bash
cat /proc/cpuinfo | grep -i kvm
If you see no output or KVM is not mentioned, your kernel lacks KVM support.
2. Load KVM Module (If Available)
Try loading the kvm module manually:
bash
modprobe kvm
If you get modprobe: not found or Module kvm not found, your kernel does not have KVM compiled.
3. Use a Custom Kernel with KVM Support
LineageOS does not enable KVM by default, so you would need to:
Build a custom kernel for your Fairphone 4 with CONFIG_KVM enabled.
Flash the custom kernel to your device.
This is advanced and may void warranties or cause instability.
4. Use QEMU Without KVM (Slower)
Remove -accel kvm and use TCG (Tiny Code Generator) instead: