Android Studio 2.3 using emulator from console, “/dev/kvm device: permission denied” for root user

前端 未结 5 1776
深忆病人
深忆病人 2021-02-02 13:50

I\'m trying to start a virtual android device which I created with the avdmanager of Android Studio 2.3 (via command line)

all commands are performed as

相关标签:
5条回答
  • 2021-02-02 14:27

    Assuming that you want to apply this change of ownership using the current OS user, use the following:

    sudo chown $(whoami) -R /dev/kvm

    0 讨论(0)
  • 2021-02-02 14:34

    Try these steps:

    Install qemu-kvm like following

    sudo apt install qemu-kvm
    

    Add user to kvm group using the following command:

    sudo adduser <username> kvm
    

    If you are getting permission denied, try following command

    sudo chown <username> /dev/kvm
    

    It worked for me in Ubuntu 18.04

    0 讨论(0)
  • 2021-02-02 14:34

    Check nano /etc/group contains a line begins with kvm and ends with your user name. If not then run:

    sudo gpasswd -a $USER kvm
    
    0 讨论(0)
  • 2021-02-02 14:50

    I solved the problem running

    sudo apt install qemu-kvm
    sudo chown username -R /dev/kvm
    
    0 讨论(0)
  • 2021-02-02 14:52

    Simply try this. this was work for me

    $ sudo chown username -R /dev/kvm
    

    sometimes you need to run this code also

    $ cd Android/Sdk/emulator/lib64/libstdc++
    $ mv libstdc++.so.6 libstdc++.so.6.bak
    $ ln -s /usr/lib64/libstdc++.so.6
    
    0 讨论(0)
提交回复
热议问题