简体   繁体   English

kvm 权限在 Android Studio 模拟器上被拒绝

[英]kvm permission denied on Android Studio emulator

When I try to run an AVD, I get this erros:当我尝试运行 AVD 时,出现以下错误:

/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...是的,我知道,我没有访问/dev/kvm的权限,我知道我可以通过更改我的用户的/dev/kvm权限来“解决”它,并将我的用户设置为 kvm 组,它是工作但是当我重新启动我的用户 session 时, /dev/kvm权限返回到 root 用户和 root 组,我需要一次又一次地为我的组设置权限......

How to set this permission and prevent that when I reboot my computer my permission are not changed anymore?如何设置此权限并防止当我重新启动计算机时我的权限不再更改?

SO: Ubuntu 18.04.01所以:Ubuntu 18.04.01

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.使用它,您将授予当前用户对 /dev/kvm 的 rwx 权限。 Or just replace $USER to any user you need.或者只是将 $USER 替换为您需要的任何用户。

As mentioned in setfacl manpages "This utility sets Access Control Lists (ACLs) of files and directories."正如 setfacl 联机帮助页中提到的“此实用程序设置文件和目录的访问控制列表 (ACL)”。 It's a little bit different from chmod and chown.它与 chmod 和 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例如,在 ubuntu 文档中: https : //help.ubuntu.com/community/FilePermissionsACLs

Had same problem, it worked when you restart the program.有同样的问题,当您重新启动程序时它起作用了。

sudo chmod 777 -R /dev/kvm须藤 chmod 777 -R /dev/kvm

在 ubuntu 系统中,可以使用命令sudo chmod 777 -R /dev/kvm更新内核虚拟机的权限。

Update system BIOS Setting Assus更新系统 BIOS 设置 Assus

  1. Power on the system and press[delete] key to enter BIOS [EZ Mode]开机按[delete]键进入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)按[F7]键进入BIOS[Advanced Mode]如下图:(如果按[delete]键直接进入[Advanced Mode]就不用再按[F7]键了)
  3. Select [Advanced] page and click [CPU Configuration] item Select [Advanced]页面点击[CPU Configuration]项
  4. Select [Intel(VMX) Virtualization Technology] item and set to [Enabled] Select [Intel(VMX) Virtualization Technology]项并设置为[Enabled]
  5. Press [F10] key and click [OK],the system will auto reboot按【F10】键,点击【确定】,系统会自动重启

在此处输入图像描述

正确的权限是:

sudo chmod 666 /dev/kvm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM