felipe.rce
felipe.rce

Reputation: 237

kvm permission denied on Android Studio emulator

When I try to run an AVD, I get this erros:

/dev/kvm device permission denied

Yeah, I know, I don't have the permission to access /dev/kvm, I know that I can "solve" it by changing the /dev/kvm permission to my user, and set my user to kvm group, it is working but when I restart my user session, the /dev/kvm permission return to root user and root group, and I need to set the permission to my group again and again...

How to set this permission and prevent that when I reboot my computer my permission are not changed anymore?

SO: Ubuntu 18.04.01

Upvotes: 11

Views: 13302

Answers (5)

Yogesh Bangar
Yogesh Bangar

Reputation: 550

Update system BIOS Setting Assus

  1. Power on the system and press[delete] key to enter BIOS [EZ Mode]
  2. Press [F7] key to enter BIOS [Advance Mode] as below picture: (If press [delete] key to enter [Advanced Mode] directly and then no need to press [F7] key any more)
  3. Select [Advanced] page and click [CPU Configuration] item
  4. Select [Intel(VMX) Virtualization Technology] item and set to [Enabled]
  5. Press [F10] key and click [OK] ,the system will auto reboot

enter image description here

Upvotes: 0

user13794345
user13794345

Reputation: 1

The right permissions are:

sudo chmod 666 /dev/kvm

Upvotes: -1

code.rookie
code.rookie

Reputation: 356

Permissions for kernel virtual machine can be updated with the command sudo chmod 777 -R /dev/kvm in ubuntu system.

Upvotes: 0

Jamn Nemn
Jamn Nemn

Reputation: 21

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

sudo chmod 777 -R /dev/kvm

Upvotes: 2

Andrei Vinogradov
Andrei Vinogradov

Reputation: 1935

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

Upvotes: 33

Related Questions