Launching an Android Studio emulator, starting a QEMU/KVM virtual machine, or booting an accelerated container in Ubuntu Linux can often fail abruptly with a frustrating permission error: “KVM is not available: /dev/kvm device: permission denied” or “Could not access KVM kernel module: Permission denied”. The emulator refuses to launch, stalling your development workflow.
The /dev/kvm special character device node provides user-space applications with direct access to hardware-assisted virtualization extensions (Intel VT-x or AMD-V). In Ubuntu, this character device is owned by the root user and assigned to the kvm user group with 0660 permissions. If your standard user account has not been added to the kvm group, or if hardware virtualization is disabled in your motherboard BIOS/UEFI, access is denied. This guide details how to resolve the error cleanly.
Method 1: Add Your User Account to the KVM Group
By far the most common cause of this error is that Ubuntu does not automatically add standard desktop users to the kvm group upon installation.
- Press Ctrl + Alt + T to launch the terminal.
- Inspect the current permissions and ownership of the
/dev/kvmnode:
You will see output similar to:ls -la /dev/kvmcrw-rw---- 1 root kvm 10, 232 ... /dev/kvm. - Add your active user account to the
kvmgroup usingadduser:
or usingsudo adduser $USER kvmusermod:sudo usermod -aG kvm $USER - Apply the group membership changes immediately to your current shell:
newgrp kvm - Important: Group membership updates require a complete desktop logout to take effect across all graphical applications like Android Studio. Log out of Ubuntu and log back in, or restart your computer.
Method 2: Verify Hardware Virtualization in Motherboard BIOS/UEFI
If the /dev/kvm device node does not exist at all, hardware virtualization has not been enabled inside your computer’s motherboard BIOS/UEFI settings.
- Install the CPU hardware verification utility:
sudo apt-get install cpu-checker - Run the KVM acceleration test:
kvm-ok - If the output displays: “INFO: /dev/kvm exists. KVM acceleration can be used”, hardware virtualization is fully enabled.
- If the output displays: “KVM acceleration can NOT be used”:
- Reboot your computer and enter your motherboard BIOS/UEFI setup (usually by pressing F2, Del, or F12 at startup).
- Locate the CPU configuration menu.
- Enable Intel Virtualization Technology (Intel VT-x / VMX) or AMD SVM (Secure Virtual Machine) Mode.
- Save settings and reboot into Ubuntu.
Method 3: Install Required QEMU/KVM Virtualization Packages
If you are setting up a fresh Ubuntu desktop or server installation, core KVM kernel modules and udev helper rules may be missing.
- Open the terminal window.
- Install the full virtualization stack and udev permission rules:
sudo apt-get update sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils - Add your user account to both the
kvmandlibvirtgroups:sudo usermod -aG kvm,libvirt $USER - Start and enable the libvirtd background daemon:
sudo systemctl enable --now libvirtd
Method 4: Fix Device Permissions via Persistent Udev Rules
If custom system configurations or container runtimes reset /dev/kvm permissions upon every reboot, creating a persistent udev rule enforces correct group access automatically.
- Open a new udev rule file in the nano editor:
sudo nano /etc/udev/rules.d/60-kvm.rules - Add the following rule line:
KERNEL=="kvm", GROUP="kvm", MODE="0666" - Save and exit nano (Ctrl + O, Enter, Ctrl + X).
- Reload the udev rules without rebooting:
sudo udevadm control --reload-rules && sudo udevadm trigger - Verify that
ls -l /dev/kvmnow displays read-write permissions for all users.
KVM Virtualization Diagnostics Reference Table
The table below provides a quick reference for diagnosing Ubuntu KVM acceleration errors:
| Command | Expected Output | Diagnostic Purpose |
|---|---|---|
kvm-ok |
“KVM acceleration can be used” | Validates CPU virtualization support and BIOS flags |
groups $USER |
Must include “kvm” in group list | Verifies active user group permissions |
ls -l /dev/kvm |
crw-rw---- 1 root kvm |
Checks node existence and access rights |
sudo modprobe kvm_intel |
Clean exit (no error) | Manually probes Intel virtualization kernel module |
Maintaining Fast Emulation in Ubuntu
Once your user is added to the kvm group, Android Studio emulators and virtual machines run with near-native hardware execution speeds, utilizing CPU virtualization extensions directly. Regularly keeping your Linux kernel updated ensures seamless compatibility with the latest Intel and AMD processor microcode improvements.