I am on Ubuntu 18.04 LTS and I am trying to set up Android Studio for the first time. When I run my simple "Hello World" app, it gives me a pop-up that says
KVM is required to run this AVD.
Unknown ErrorPlease file a bug against Android Studio
But when I run simply kvm-ok
it outputs:
INFO: /dev/kvm exists
KVM acceleration can be used
Starting with Ubuntu 18.04 and Linux Mint Tara you need to install qemu-kvm
Check the ownership of /dev/kvm
Check which users are in the kvm group
Output from the above command
If there is nothing rightwards of the final
:
, there are no users in the kvm group.To add the current user to the kvm group
which adds the user to the group, and check once again with
grep kvm /etc/group
.A restart may be required for the permissions to take effect.
Official answer on StackOverflow
Change sdk emulator folder permission. This is worked for me.
https://stackoverflow.com/questions/44635879/kvm-is-required-to-run-this-avd-unknown-error-please-file-a-bug-against-androi
To run KVM, you need a processor that supports hardware virtualization.
To see if your processor supports hardware virtualization, you can review the output from this command:
If 0 it means that your CPU doesn't support hardware virtualization.
If 1 or more it does - but you still need to make sure that virtualization is enabled in the BIOS.
Installation of KVM
Cosmic (18.10) or later
You need to ensure that your username is added to the group libvirtd, and kvm:
Verify Installation
Run
kvm-ok
on the command line.Logout or restart for changes to take effect.
Sources:
https://developer.android.com/studio/run/emulator-acceleration#accel-check https://help.ubuntu.com/community/KVM/Installation
I usually run
but this is only good for a while. Looking for a better solution.
There is also another command:
Login as a root user
sudo su
goto the studio installation dir withcd ${path_of _installation_dir}/android-studio/bin
and relaunch the sdk with./studio.sh
. Then try relaunching your avd