kvm permission denied on Android Studio emulator

Had same problem, it worked when you restart the program.

sudo chmod 777 -R /dev/kvm


This command should help you:

sudo setfacl -m u:$USER:rwx /dev/kvm

Using it you will grant to current user rwx permissions to /dev/kvm. Or just replace $USER to any user you need.

As mentioned in setfacl manpages "This utility sets Access Control Lists (ACLs) of files and directories." It's a little bit different from chmod and chown. Using it you can grant required permissions to specific user. It's a bit more powerful tool and much more fine-grained. If you want to dive deeper, read about Access Control Lists. For example, in ubuntu docs: https://help.ubuntu.com/community/FilePermissionsACLs