Though, this issue is not very common, it has the tendency to really slow down your development process because it prevents your Android Emulator from running.
If you search online about this issue, you will see a lot of answers suggesting that you install some packages from Android SDK Manager. While these answers might be correct, the “kvm is required to run this avd” error might still show even if you have these packages installed. Note that sometimes the issue comes up with a different error message like “Emulator: ERROR: x86 emulation currently requires hardware acceleration!”. Be rest assured that the solution below will also fix it.
Cause
I rest have not had the time to research the exact cause of this error message. But the secondary cause is when the /kvm folder in your home directory does not have the proper permissions. So when your emulator tries to read from that directory during start up, permission is denied.
Solution
Now that we know the secondary cause if this error, I think the solution is fairly obvious. Note that the solution below is for Linux users.
To solve the problem on Linux, open your terminal and enter the following command:
1 |
sudo chown finco:finco -R /dev/kvm |
The above command will change the ownership of the kvm folder to the current user.
Now trying starting up your emulator and the issue should be gone.
Side Note
The kvm folder seems to get recreated with the wrong permissions each time you restart your computer. Meaning that the issue comes back after everytime you restart your computer. So this is just a temporary fix.
This post would be updated when I figure out a more permanent fix.
And that’s all for now.
If you have any questions or contributions, feel free to post them in the comment box below.