To verify that a virtual machine (VM) launched with the -accel kvm option is actually using KVM (Kernel-based Virtual Machine), you can use several methods. Here's how to do it:
✅ 1. Check QEMU Command Line
If you started the VM manually or via a script, ensure the command line includes:
-accel kvm
This tells QEMU to attempt KVM acceleration.
Also check for:
-machine accel=kvm
Both options are valid and tell QEMU to prefer KVM as the accelerator.
✅ 2. Check the Process Using ps
Run this in your host system:
ps aux | grep qemu
Look for something like:
/usr/bin/qemu-system-x86_64 ... -accel kvm ...
If you see -accel kvm, then QEMU was instructed to use KVM.
⚠️ Note: This only shows what QEMU was asked to do — not necessarily that KVM is being used successfully.
✅ 3. Use kvm_stat (if available)
Install kvm_stat if it’s not already installed:
Then run:
sudo kvm_stat
You'll see statistics from /sys/kernel/debug/kvm/.
If there are active VMs listed, such as:
vm exit : 123456789
...
Then KVM is in use by one or more VMs.
✅ 4. Check /proc/<qemu-pid>/maps
Find the PID of the QEMU process:
ps aux | grep qemu
Then run:
cat /proc/<PID>/maps | grep kvm
If you see lines like:
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [kvm]
That indicates the process is using KVM.
✅ 5. Check QEMU Monitor Console
If your VM has a monitor enabled (e.g., with -monitor stdio or via socket), connect to it and type:
info kvm
If KVM is active, you’ll get output like:
KVM support: enabled
If KVM isn't active, it might say:
KVM support: disabled
✅ 6. Use dmesg to Check Kernel Logs
Sometimes KVM-related errors show up in the kernel log:
dmesg | grep -i kvm
For example:
[ 1.234567] kvm: disabled by bios
Or on success:
[ 1.234567] kvm: intel vme
✅ 7. Check CPU Usage with top or htop
When a VM runs with KVM, you'll typically see increased usage in both:
- The QEMU process (user space)
- The
[kvm] thread(s) (kernel space)
Compare CPU usage between running with -accel kvm vs -accel tcg.
✅ 8. Use virt-top (for libvirt-managed VMs)
If using libvirt:
virt-top
It will show whether each guest is using KVM (hvm) or TCG (qemu).
🔍 Summary Checklist
| Method | Confirms KVM Use? |
|---|
| QEMU cmdline | ❓ Indirectly |
ps | ❓ Indirectly |
kvm_stat | ✅ Yes |
/proc/<pid>/maps | ✅ Yes |
QEMU Monitor info kvm | ✅ Yes |
dmesg | ✅ For errors |
| CPU load monitoring | ✅ Performance |
virt-top (libvirt) | ✅ Yes |
Let me know if you're using a specific tool like libvirt, QEMU directly, or cloud-init — I can tailor the answer further!