> Warning: KVM is not available. This may mean the KVM package is not installed, or the KVM kernel modules are not loaded. Your virtual machines may perform poorly.
How to solve this issue?
Aug 12, 12:57am
The warning you're encountering on your Oracle Ubuntu 22.04 ARM instance indicates that KVM (Kernel-based Virtual Machine) is not available. This can happen for several reasons, such as:
KVM is not installed on the system.
KVM kernel modules are not loaded.
Virtualization extensions are not enabled in the BIOS/UEFI (though this is less likely on cloud instances).
The system does not support nested virtualization (common in cloud environments).
Since you're using an Oracle Cloud ARM instance, nested virtualization is often disabled by default for security and performance reasons. However, you can still check and attempt to enable KVM if your instance supports it.
Steps to Diagnose and Fix the Issue
1. Check if KVM is Supported on Your Instance
Run the following command to check if your CPU supports virtualization:
bash
egrep -c '(vmx|svm)' /proc/cpuinfo
If the output is 0, your CPU does not support hardware virtualization (common on ARM instances unless explicitly enabled).
If the output is 1 or higher, your CPU supports virtualization, but KVM may still be disabled.
For ARM-based systems, check for KVM support with:
After making changes, restart the libvirtd service:
bash
sudo systemctl restart libvirtd
6. Verify KVM Availability
Run:
bash
kvm-ok
If the output says KVM acceleration can be used, KVM is working.
If not, KVM is still not available.
7. Fallback: Use QEMU with TCG (if KVM is unavailable)
If KVM is not available (e.g., nested virtualization is disabled on your cloud instance), you can still run VMs using QEMU with TCG (Tiny Code Generator), but performance will be significantly slower.
To use QEMU without KVM:
bash
qemu-system-aarch64 -enable-kvm # This will fail if KVM is unavailable
qemu-system-aarch64 # Falls back to TCG (slow)
Oracle Cloud-Specific Notes
Oracle Cloud ARM instances (e.g., Ampere A1) do not support nested virtualization by default.
You cannot enable KVM inside an Oracle Cloud ARM instance for running nested VMs.
If you need KVM, consider using an x86_64 instance (e.g., Intel or AMD) where nested virtualization is often supported.
If you must use ARM, you can only run VMs in emulation mode (TCG), which is very slow and not recommended for production.