问题描述
当我尝试在模拟器上运行Android应用程序时,出现以下错误:
When I try to run my Android app on an emulator I get this error:
我检查了权限并将当前登录的用户添加到kvm组。
I checked the permissions and added the user I am currently logged in with to the kvm group. What is wrong?
推荐答案
如注释中所述,从 Ubuntu 18.04 和开始Linux Mint Tara ,您需要首先 sudo apt install qemu-kvm
。
As mentioned in the comments, starting with Ubuntu 18.04 and Linux Mint Tara you need to first sudo apt install qemu-kvm
.
要检查所有权 / dev / kvm
的使用
ls -al /dev/kvm
用户是 root
,组 kvm
。要检查哪些用户在 kvm
组中,请使用
The user was root
, the group kvm
. To check which users are in the kvm
group, use
grep kvm /etc/group
此返回
kvm:x:some_number:
在我的系统上:在最后的中没有任何意义:
,在 kvm
组中没有用户。
on my system: as there is nothing rightwards of the final :
, there are no users in the kvm
group.
要将用户添加到kvm组,可以使用
sudo adduser $USER kvm
将用户添加到该组,然后再次使用<$检查c $ c> grep kvm / etc / group 。
which adds the user to the group, and check once again with grep kvm /etc/group
.
如@marcolz所述,命令应该为您实时更改组成员身份。如果那不起作用,@ Knossos提到您可能要注销并重新登录(或重新启动),以使权限生效。或作为并通过 su-$ USER
重新登录同一外壳。
As mentioned by @marcolz, the command newgrp kvm
should change the group membership live for you. If that did not work, @Knossos mentioned that you might want to log out and back in (or restart), for the permissions to take effect. Or do as @nmirceac mentioned and re-login in the same shell via su - $USER
.
这篇关于Android Studio:/ dev / kvm设备权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!