Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio running on VMware virtual machine: KVM is not installed

I'm running Android Studio on a Ubuntu VMWare virtual machine. The problem is that when I try to run an app with the AVD emulator I get the following errors in the console:

/home/verite/Android/Sdk/tools/emulator -avd Nexus_5_API_22_x86 -netspeed full -netdelay none
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: KVM is not installed on this machine (/dev/kvm is missing).

I've tried to solve the problem by doing this:

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser `id -un` libvirtd
sudo adduser `id -un` kvm

and restarting, but it doesn't work. When I issue the command:

sudo kvm-ok

I get

INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

Could someone tell me how to fix the problem, please?

Thanks

like image 362
Vicent Avatar asked Jul 06 '15 10:07

Vicent


People also ask

Can install Android Studio on VMware?

The emulator is running a system image created for an x86-based virtual device. You can't run a VM-accelerated emulator inside another VM, such as a VM hosted by VirtualBox, VMware, or Docker (unless using WSL2). You must run the Android emulator directly on your system hardware.

Does VMware support KVM?

With VMware Workstation 10, you can run virtual machines with VMware KVM, which allows you to use hot keys to switch among running virtual machines and the host, as if they were attached to a KVM switch.

Can I run Android emulator on virtual machine?

Android Emulator allows you to run emulations of Android devices on Windows, macOS or Linux machines. The Android Emulator runs the Android operating system in a virtual machine called an Android Virtual Device (AVD). The AVD contains the full Android software stack, and it runs as if it were on a physical device.


4 Answers

I faced the same problem. I searched and I found the solution it works with me now:

In VMware:

  1. Open Virtual machine setting.
  2. Go to the processor.
  3. Check the virtualize Intel VT-x/EPT or AMD-RVI option.
  4. Click ok and run the Virtual machine, it should work fine with you.

Hope that works with you.

This link HW virtualization in VMware (KVM - Android Studio) helped me to find the solution.

like image 191
Balira Avatar answered Oct 05 '22 09:10

Balira


Bad news found in the Using the Emulator section of the official Android developer website:

Not Inside a VM - You cannot run a VM-accelerated emulator inside another virtual machine, such as a VirtualBox or VMWare-hosted virtual machine. You must run the emulator directly on your system hardware.

So it seems my best alternative is look for a real device compatible with the Android Studio for running the apps.

like image 25
Vicent Avatar answered Oct 05 '22 08:10

Vicent


You have vCenter and vSphere Web client use this to edit the VMs config Right click the Your_Windows_GuestOs > Edit Settings > CPU > Check the box "Expose hardware assisted virtualization to the guest OS .

like image 41
BenMou Avatar answered Oct 05 '22 09:10

BenMou


Install Android on a Cloud Virtual machine (AWS windows server)

Since my machine was slow with Android Studio I created a virtual machine on windows server on AWS with the best processor and RAM configurations, which gave me seamless programming and execution experience. But to use the emulator I face the error listed below.

Error:
Unable to install Intel HAXM
HAXM doesn't support nested virtual machines.
Unfortunately, the Android Emulator can't support virtual machine acceleration from within a virtual machine.
Here are some of your options:
 1) Use a physical device for testing
 2) Start the emulator on a non-virtualized operating system
 3) Use an Android Virtual Device based on an ARM system image (This is 10x slower than hardware accelerated virtualization)

Since we can't connect our device to the Cloud machine, the option #3 is the best way to go.

Once the Android studio is installed,

Go to Tools -> Android -> AVD Manager

Click "Create Virtual Device"

Select which device you want to use from the list (i.e Nexus 5) and click "Next".

Here you're given a list of android release versions. Look at the ABI column. 

Choose "Armeabi-v7a" for whichever API Level you want.

Hit "Next" and modify name/size, click "Finish" when done.

if 'Next' doesn't work, download the desired image and continue
like image 29
Akshay Nair Avatar answered Oct 05 '22 09:10

Akshay Nair