How to fix "kvm permission denied" for Android Emulator

I met an Android emulator from Android Studio did not working. I got '/dev/kvm device: permission denied.' error when i tried to run it.

kvm is required to run this avd. /dev/kvm device: permission denied.
Grant current user access to /dev/kvm

The problem is that my user can't get access to the "/dev/kvm". i fixed it to add my user to the group of "/dev/kvm" file.

Problem

When you install qemu-kvm and see permissions of "/dev/kvm" file, the group is set to "kvm".

sudo apt install qemu-kvm
$ ls -al /dev/kvm
crw-rw---- 1 root kvm 10, 232  61 07:51 /dev/kvm

So, if your user is added to the kvm group, it will be fixed.

Solution

You can see if your user is added to the kvm group or not by below command.

$ grep kvm /etc/group
kvm:x:105:

You can add your user name to kvm group and make sure it is in like below.

$ sudo adduser username kvm
$ grep kvm /etc/group
kvm:x:105:username

Let's start Android emulator. it will work.

Related Posts

codechachaCopyright ©2019 codechacha