Ubuntu 14 Android Studio 3 xrdp /dev/kvm permission denied
I'm running an Ubuntu Server VPS with 4 dedicated cores and 4GB or ram
lsb_release -a says I'm running
Description: Ubuntu 14.04.5 LTS
Codename: trustyI've installed Android Studio 3.0.1 I more or less followed this Tutorial just got the latest version. the install when smoothly.
I then installed xrdp and xfce4, and I'm not having any issues with the remote connections
I launch android studio with the following command from an elevated terminal window in rdp
sudo ~/bin/android-studio/bin/studio.shthe command outputs
Error parsing gtk-icon-sizes string: ''but android studio runs fine and allows my to make projects and code so I tried compiling the hello world app and running it in a ADV after creating an android virtual phone and trying to run I get the following error
KVM is required to run this AVD.
/dev/kvm device: permission denied
Grant current user access to /dev/kvmI've run
usermod -aG kvm *username*
usermod -aG libvirtd *username"
adduser *username* kvm
adduser *username* libvirtd
adduser *username* xrdp
chmod +x /dev/kvm
chown *username* /dev/kvm
chmod -R 777 /dev/kvmI rebooted the VPS after each of the commands and I still get the KVM permission denied error
When I run
sudo kvm-ok INFO: /dev/kvm exists KVM acceleration can be usedHowever if I just run
kvm-ok
bash: kvm-ok: command not foundI've been trying to figure this out for hours now and have only found stuff telling me to add the user to kvm and/or libvirtd groups any help would be greatly appreciated.
Update:
Looking into this some more
cat /proc/cpuinfo | grep 'name'| uniq model name : Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHzso I ran
sudo modprobe kvm-intel
modprobe: ERROR: ../libkmod/libkmod.c:507kmod_lookup_alias_from_builtin_file()
could not open builtin file '/lib/modules/3.13.0/modules.builtin.bin'this lead to me trying
depmod -a
depmod: WARNING: could not open /lib/modules/3.13.0/modules.order: No such file or directory
depmod: WARNING: could not open /lib/modules/3.13.0/modules.builtin: No such file or directoryhere is the out put of ls -al /lib/modules/3.13.0/
drwxr-xr-x 2 root root 4096 Dec 12 01:08 .
drwxr-xr-x 5 root root 12288 Dec 11 18:11 ..
-rw-r--r-- 1 root root 45 Dec 12 01:08 modules.alias
-rw-r--r-- 1 root root 12 Dec 12 01:08 modules.alias.bin
-rw-r--r-- 1 root root 0 Dec 12 01:08 modules.builtin.bin
-rw-r--r-- 1 root root 0 Dec 12 01:08 modules.dep
-rw-r--r-- 1 root root 12 Dec 12 01:08 modules.dep.bin
-rw-r--r-- 1 root root 52 Dec 12 01:08 modules.devname
-rw-r--r-- 1 root root 131 Dec 12 01:08 modules.softdep
-rw-r--r-- 1 root root 49 Dec 12 01:08 modules.symbols
-rw-r--r-- 1 root root 12 Dec 12 01:08 modules.symbols.binso I was thinking there was an error with my linux image, but
sudo apt-get install linux-generic
Reading state information... Done
linux-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.not sure what to fix but I think I'm getting closer to figuring out the issue at least
24 Answers
I had this mistake with Android Studio 3.0.1 on Ubuntu 18.04 when I run emulator. You can try this answer. To add the user username to the kvm group, you could use:
sudo apt install qemu-kvm
sudo adduser $USER kvmIn my case it worked, albeit with a re-login required after whole process.
7it is too late answer , may be help another users .
1.i tried :sudo setfacl -m u:UserName:rwx /dev/kvm . and it works .
2.in the android studio you need to change : tools> avd manager >(chose the pen to edit your device and change 'graphics' from automatic to software ) to avoid emulator drawable error
2This works for Ubuntu 18.04:
Open a terminal and type the following
sudo setfacl -m u:$USER:rwx /dev/kvm
Restart Android Studio.
Make sure virtualization is enabled in BIOS. Add your username to the group properties:
sudo chown :$USER /dev/kvmlet the user access/write to the device /dev/kvm:
sudo chmod g+rw /dev/kvmthat's it!
1