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

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

I faced the same problem. I searched and I found the solution it works with me now:
In VMware:
Open Virtual machine setting.
Go to the processor.
Check the virtualize Intel VT-x/EPT or AMD-RVI option.
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.

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.

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
.

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

I have android emulators running inside VMWare guest. It is utilizing Windows and not Linux, but the principles apply. As has been mentioned, the biggest item is ensuring the the VMWare processor setting for virtualization is checked.
Here are my specifics:
I'm running Win10 for both Host and Guest.
I have Android studio and android emulators running inside of a single VMWare guest which is being run using VMWare's player software.
Here are the versions:
Windows 10 64 bit both host and guest.
Windows 10 guest Ram 6 Gig
Android studio 3.3.2
AVD Emulator
VMWare Player 12, 12.5.1 build-4542065
VMware Number of Processors: 1
VMWare Setting for Processors: Virtualize Intel VT checked.

I faced this exact same error while running AVD in a cloud VM, adding a license solved it.
So, VMWare any cloud provider will not provide you the ability to create nested virtual machines. It is blocked by default so the Android studio would work but you would not be able to run an AVD, that’s not much useful.
To allow this you would then add the following license while VM creation-
https://compute.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx
Note: This works only for GCP, you need to add different licenses for VMWare
This was just a short just of what you would do and the major steps involved, however, I highly recommend you to read this blog by me which provides a step by step guide to doing so.
I also urge you to check this answer by me where I explain this in greater detail for GCP.

Related

Can I run AVD on a Virtual Windows 10 Desktop

I am currently working form home for an organisation.
Is it possible to run Android Emulator via Android Studio on a Virtual Desktop which has Windows 10 installed.
Also, should I keep my specs low for the Emulator, as I have enough RAM in my VDI.
And do I need to ask the organisation to enable Virtualization in the Virtual Machine, As it may not be possible for me to do so. Or, there is no such things in Virtual Machines?
Currently, When I try to run Emulator, it just gets stuck on black screen forever and timeouts.
I have tried multiple options. But none of them works.
No, after digging in a lot.
It was Azure VDI, windows 10.
And it's not possible to run a virtual machine (Android Emulator) inside another virtual machine.
It may be possible to run in another OS.
But not on Windows which asks to enable Hyper-V.
Which won't allow installation of Intel HAXM.

Trouble installing HAXM in Android Studio (Windows 10)

Brand new to app development and am having a bit of trouble activating an Android Virtual Device (AVD) for Android Studio (Windows 10). I am trying to install HAXM but receive the attached message.
Upon going into my /installed programs/ directory to uninstall Microsoft Hyper-V, the program is not listed. Would the Hyper-V program be listed under another name, or rather, could anyone please provide feedback as to resolving this message? Any feedback would be greatly appreciated!
For AMD system, you can use Windows Hypervisor Platform (WHPX) under Windows 10 since Version 1803:
To enable Windows Hypervisor Platform (WHPX) do the following steps:
From the Windows desktop, right-click the Windows icon and select Apps and features.
Under Related settings, click Programs and Features.
Click Turns Windows Features on or off.
Select Windows Hypervisor Platform
click ok and reboot.
Now create a new Android Virtual Device (AVD).
Yes the same was here too,
Ok there are 2 ways of solving this ,
First you can go to BIOS and disable the Hyper V and enable the VT x for intel. If you had not the VTx or with disabling Hyper v nothing has solved then come to Second solution.
The second is there is not a solution available for you and your computer just like me. Your cpu and computer cant install HAXM which mean you cant install and run emulator , but hang on, google has added new property to emulators to run without HAXM and you need to install those package of SDK api which has Amd virtualization or non HAXM, also even this one has not helped me, so if you were like me then you can use physical device for testing or installing linux instead of windows and use Hyper v to run emulator in android studio instead of HAXM, and i prefer Lubuntu cause of speed it will gives you if you wantes to install.

This computer does not support Intel Virtualization Technology (VT-x) or it is being exclusively used by Hyper-V error

I'm using Android Studio on windows 10 currently. However, as I try to install HAXM via android studio, there is an error which always pops up "This computer does not support Intel Virtualization Technology (VT-x) or it is being exclusively used by Hyper-V. HAXM cannot be installed".
The weird thing is that when I checked my installed programs, HAXM is already installed by default. I have no idea why I am not able to upgrade. I'm using a decent gaming laptop with an 8th Gen Intel Core i7 processor.
Things I have tried :
I have already went into my bios and made sure all virtualization options were enabled and went to "Windows Features"and unchecked Windows Hyper-visor Platform but to no avail as the problem still persists
I recently had the same issue, and even though Intel virtualization was enabled in the BIOS and my Windows 10 doesn't have the Hyper-V option because it's the home edition, I wasn't able to use Android Studio emulators/virtual machines or upgrade/reinstall Intel HAXM. I then found out that an enabled feature on Windows Defender was the cause of the problem. Try the following steps (sorry, my device is in portuguese so the options might have another naming other than the direct translation to english):
In Windows Defender, go to Device Security (The one with a laptop icon).
Choose Kernel Isolation Details (first option).
And disable the Memory Integrity option if it isn't disabled already (in case it is, I'm sorry but this solution won't help you out).
If you have to change the option to disabled, restart your computer and try upgrading HAXM via Android Studio again.
I hope this helps. :)
In my case, after disabling Hyper-V in Windows Features I had to turn the antivirus (Kaspersky) off to install Intel x86 Emulator Accelerator (HAXM) 7.5.6 on Windows 10 Pro (1909).
IF u have AMD CPU you have to install Driver for AMD processor Check img

How to solve this emulator: ERROR: x86 emulation currently requires hardware acceleration

After installing android-studio-bundle-141.2456560-windows.exe in Windows 7 32 bit ultimate (6.1 build 7600)
I'm getting HAXM error while run emulator, I have exercised all the possible ways like,
Installing INTEL HAXM hardware accelerator through SDK manager I have uploaded a screenshot of this.
I have unchecked HYPER V option in turn on and off features
When I try to install HAXM from android SDK extras shown in screen shot
Note that I don't have Virtualization option in my BIOS setup if we consider that some advanced SoC will internally takes care about this virtualization
!!!But still android emulator is throwing the error
According to Intel's website, the Core 2 Duo E7200 does not support VT-x
Intel ARK
Unfortunately you cannot run HAXM without vt-x. This means either you'll have to try a different emulation method or use a real android device. Using a real android device will always give you the best results, so I recommend going that route.
if you have not installed intel x86 Emulator Accelerator (HAXM installer) then you need to install it from tools -> SDK Manager there you will find this HAXM installer
if it has been already installed then also the same issue is arising then go to the folder where SDK is stored for me it is
D:\sdk\extras\intel\Hardware_Accelerated_Execution_Manager
and then run silent_install with administrator permission
and you are ready to go..!!!
First, uninstall your "intelhaxm-android.exe".
go to the BIOS and enable "Intel(R) Virtuallzation Technology".
again install "intelhaxm-android.exe".
create a new Virtual device and run.

Genymotion on VMWare

I'm on Xubuntu running with VMWare on Windows 7. I'm developing an android app' and use genymotion to run virtual android device. But from few days, when I try to run my virtual device genymotion show me this error :
(translated from French)
Impossible to run the Genymotion virtual terminal.
The Genymotion virtual terminal haven't obtained IP address.
For an unknown reason, the VirtualBox's DHCP server haven't assigned IP address to the virtual terminal. Please run VirtualBox to find a solution for the issue.
For further help, please go to :
https://cloud.genymotion.com/page/faq/#collapse-nostart
So, I followed the link and see that I should have the same IP address for the adapter and the DHCP server and explain how to modify. I change the IP of the DHCP server to be the same as the adapter. But looks like it doesn't fix the issue because the same message appear after the modification.
A friend of mine told me to download the latest version of Genymotion. I did but there's still the same issue.
For the reason why I'm on such virtual device is because I had lot of problem have a stable installation with dual boot windows/linux so I choose a virtualisation of linux instead. And I can't work on windows because it's a team work and work on windows have some conflict with work on linux.
I hope I've been understandable and excuse me for the language fault.
EDIT :
I've try creating a new virtualisation of Xubuntu and install genymotion to see if it was an update I mad or an other mistake I could have done that broke genymotion.
But the same problem appear. I think the problem come from the double virtualisation but I don't know how to fix it.
Actually I just found what my problem was (or look's like). In the settings of the virtual device, in the CD/DVD (SATA) section I choose "use ISO image file" instead of "use physical drive".
I don't know why the issue was related with the CD/DVD. But now I can run the genymotion virtual device. It's slow as hell but it work.
I also found a way to run Android Emulator on MAC (running with VMWare on Windows):
First open VirtualBox and start your Android device. Then start the same device in Genymotion.
To have a relative smooth reaction time - set video memory to 128MB and Motherboard memory to 1024MB in VirtualBox.
You cannot really do virtualisation from a virtualized guest.
You must install Genymotion on the host OS.
You can see an entry on this subject on the Genymotion FAQ here: https://cloud.genymotion.com/page/faq/#genymotion-from-virtualized-host
To run the android apps on genymotion or your device from vm, you can follow these instructions:
Install genymotion on your local os
Install arm translation app on your genymotion
Reboot genymotion
Install google play service on genymotion
Reboot again
Download & install adb wireless app from play store on genymotion
Run adb wireless then get allocated ip address that generated by
this app
Run this command on vm
adb connect <IpAddressGeneratedByAdbWireless>
enjoy!

Resources