简体   繁体   English

Linux 授予 Android Studio (AVD) 权限 /dev/kvm(权限被拒绝)

[英]Linux Grant Android Studio (AVD) permissions /dev/kvm (Permissions Denied)

I'm confused with how to give permissions to Android Studio to install Virtual Devices through AVD manager.我对如何授予 Android Studio 通过 AVD 管理器安装虚拟设备的权限感到困惑。

I tired to add permissions to the folder and relogged-in without success.我厌倦了向文件夹添加权限并重新登录但没有成功。 I'm also confused with commands regarding group and username;我也对有关组和用户名的命令感到困惑; am I suppose to substitute username with name of user.我想用用户名替换用户名吗?

Currently if I do theses commands I get目前,如果我执行这些命令,我会得到

ls -al /dev/kvm
crw-rw---- 1 root root 10, 232 May  7 20:23 /dev/kvm

grep kvm /etc/group
I get nothing printed

So, I know there is no group.所以,我知道没有团体。 I don't want to give privilages to root just the user name for example "blade".我不想仅将用户名授予 root 权限,例如“blade”。

I also checked with the device supports KVM我还检查了设备是否支持 KVM

egrep -c '(vmx|svm)' /proc/cpuinfo
8
kvm-ok 
8

Thanks!谢谢!

First, you'll need to install the qemu-kvm package. 首先,您需要安装qemu-kvm软件包。 For Debian/Ubuntu: 对于Debian / Ubuntu:

sudo apt install qemu-kvm

Next, add your user to the kvm group: 接下来,将您的用户添加到kvm组:

sudo adduser <username_here> kvm

Finally, log out and log back in or reboot your computer for the changes to take effect. 最后,注销并重新登录或重新启动计算机,以使更改生效。

See complete tutorial at https://www.linuxslaves.com/2018/10/fix-android-studio-devkvm-device-permission-denied-ubuntu.html 请参阅https://www.linuxslaves.com/2018/10/fix-android-studio-devkvm-device-permission-denied-ubuntu.html上的完整教程。

Update VT from Bios Setting从 Bios 设置更新 VT

  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】键,点击【确定】,系统会自动重启在此处输入图像描述

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

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