Visual Studio 2017 Android Device Manager thinks WHPX is not properly installed - android

I just update Visual Studio 2017 to version 15.8.0, the one that I've been waiting for a while now, due to its support for Hyper-V accelerated Android emulators using Windows Hypervisor Platform (WHPX).
I've been running Windows 10 version 1803 since May, and I have installed/enabled Windows Hypervisor Platform from "Turn Windows features on or off". Also, I have updated Android SDK and tools as it's described in https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration.
However, when I run any of the accelerated emulators, I get an error:
We've encountered an error with your Windows Hypervisor Platform (WHPX) configuration that is preventing us from running your emulator accelerated.
Please ensure WHPX is properly installed, then perform a factory reset on the emulator and try again.
No log and nothing else. Hence, I'm a bit confused and don't know what I should do next.
Appreciate any help.
P.S. Couple of clarifications:
I tried both, resetting existing emulators and creating new ones.
I run Hyper-V virtual machines and Docker containers on the same PC.

Maybe the Virtualisation is not enabled for your CPU from the BIOS menu. Boot to your BIOS and Enable Virtualisation. Also, install or reinstall these features on windows.

Running from VS2019 gives me the same WHPX error. But running manually works just fine with hardware acceleration (make sure you run powershell as administrator):
PS C:\Program Files (x86)\Android\android-sdk\emulator> .\emulator.exe -avd <avd_name> -feature WindowsHypervisorPlatform

I received this error even though I was already successfully running docker containers as well.
It turns out that I didn't have Windows Hypervisor Platform enabled in the "Turn Windows Features On and Off" menu. Once I turned it on, the error disappeared.
I had both Hyper-V options enabled but not Windows Hypervisor Platform. I guess that one is not required to run docker containers.

Work with visual studio 2019
I fixed this issue by disabling "Windows Hypervisor Platform" and only enable "Hyper-V" option.

It may be that your CPU does not support virtualization or some other software is preventing its use. If you have an Intel Processor Intel's VTx support page is an excellent resource to determine if your CPU permits virtualization and/or if some other software is preventing its use:
In summary:
Identify Your Intel CPU and View the Specs
Use the Intel Processor Identification Utility (https://www.intel.com/content/www/us/en/support/articles/000005495.html).
As the first link points out, even if the Intel tool in #2 shows VTx not supported, check TaskManager to see if Virtualization is enabled. If it is, then some other software is using Virtualization and preventing the tool (and other tools similar to it) from showing Virtualization as enabled.
Using both Intel's utility and TaskManager you can diagnose the problem per Intel's Table:
Virtualization Checked in Intel Utility + Virtualization Enabled in TaskManager -> enabled, usable
Virtualization Checked in Utility + Virtualization Disabled in TaskManager -> disabled in BIOS.
Virtualization Checked in Utility + Virtualization Enabled in TaskManager -> enabled but used by other software
Virtualization Checked in Utility + Virtualization Disabled in TaskManager -> Virtualization not supported .

Related

Failed to install Intel HAXM android studio

I cant install haxm in android studio
cpu : AMD Phenom || x6 1100t
Failed to install Intel HAXM. For details, please check the installation log: C:\Users\AFRADA~1\AppData\Local\Temp\haxm_log1894.txt
HAXM installation failed. To install HAXM follow the instructions found at: https://software.intel.com/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows
Installer log is located at C:\Users\AFRADA~1\AppData\Local\Temp\haxm_log1894.txt
Installer log contents:
=== Logging started: 12/22/2019 10:32:57 ===
This computer does not support Intel Virtualization Technology (VT-x) or it is being exclusively used by Hyper-V. HAXM cannot be installed.
Please ensure Hyper-V is disabled in Windows Features, or refer to the Intel HAXM documentation for more information.
You absolutely don't need Intel HAXM (Hardware Accelerated Execution Mode) in AMD processors, because they are AMD processors.
Just enable (check) Windows Hypervisor Platform in Windows features as shown below.
Now, you can start emulators. No need of Intel HAXM.
Here is official link: https://android-developers.googleblog.com/2018/07/android-emulator-amd-processor-hyper-v.html
Try to disable hyper-v in control panel then select window future if hyper-v is disable
Active Virtualization Technology (VT-x) at bios setting
follow the steps from this article, you need to enable virtualization from your BIOS settings in order to run your android emulators.
i do this on every machine 1st time i install android studio/HAX, hope it works for you
https://techcommunity.microsoft.com/t5/ITOps-Talk-Blog/Step-By-Step-Enabling-Hyper-V-for-use-on-Windows-10/ba-p/267945
Thanks for TekTutorialsHub for the idea - in my computer (Win10, Android Studio 3.6.1) the problem was connected with antivirus program protection of memory integrity (Windows Defender Security Center - Device security/Core isolation details/Memory integrity/off). Restart the computer.
In older version on the same hardware everything worked perfect, the problem began after Android Studio /SDK update.
It's really easy to solve just go to your BIOS and enable the Virtualization Technology (VT-x),You can disable the Hyper-V from the windows feature and check if it works. Thanks

android Intel haxm bug

I have installed android studio and in order to use emulators on my pc I did try to install intel HAXM. It prompted for error due to lack of intel vt-x support and I tried to enabled this options with many tricks which explained in detail here. After many changes, intel processor identification utility which was installed on my windows 10 pro, reported that intel vt-x is enabled on my pc and also a utility called haxm_check.exe reported that intel vt-x and nx is enabled on my pc. but when i tried to install intelhaxm-android.exe version 7.0.3 it prompted that vt-x or nx is missing and rolled back the setup.
Can somebody figure out what is wrong or how can I resolve this issue?
List of things to check is much larger for this issue.
Also posted at https://stackoverflow.com/a/53676171/975887 likely after you checked it.
Below is the full list for Windows (so far as of circa 12/2018)
Check BIOS
go into BIOS/UEFI setup and look for settings like VT-x, VT-d, Virtualization Technology, Hardware Virtualization and make sure it is Enabled. If the option is not there, check with your manufacturer and model to make sure it is supported.
Disable Hyper-V
Type 'windows features' into start menu, select 'Turn Windows Features On or Off'.
Unselect all Hyper-V related options, press OK, Reboot.
This will break any Hyper-V VMs you have, including any Windows Phone emulators and anything else you have setup that requires Hyper-V
Reboot Required
on an admin command prompt, run systeminfo. If it shows 'hypervisor is detected' under Hyper-V requirements, even after removing Hyper-V feature, you may have 'Core Isolation' enabled. See below on how to disable it.
As another option, try enabling 'Windows Hypervisor Platform' if you still want your Hyper-V support. More info here
AMD Ryzen ?
If your CPU is AMD Ryzen, you may need to enable 'Windows Hypervisor Platform' feature just like you disabled Hyper-V above.
If it is enabled and still things don't work, try disabling it. ¯\_(ツ)_/¯
Reboot required
Disable Antivirus
Try disabling your antivirus.
AVAST! and a few others interfere with the detection of virtualization. You can enable them after.
AVAST and some others also has some options that uses virtualization based isolation. Either disable them or temporally uninstall your AV.
Disable Core Isolation
Clean installs of Windows 10 1803 enables Core Isolation by default, which runs secure processes inside a virtualized container for security. This interferes with the detection of virtualization.
Machines that upgraded from an earlier version have this disabled, but check anyway.
Go to Windows Defender Security Center
Device Security > Core Isolation > details
Disable Memory Integrity
Reboot
Disable hypervisor launch at boot
on an admin command prompt, run bcdedit /set hypervisorlaunchtype off
reboot
to revert run bcdedit /set hypervisorlaunchtype auto and reboot
Nothing works
You shouldn't get here, since Android emulator can now run alongside with Hyper-V if you have 'Windows Hypervisor Platform' is enabled.
If nothing above works, as a last resort you can try running Android in a Hyper-V VM and get ADB to connect to it. (Not a solution, but a workaround)
You can also run android using a third-party emulator like Genimotion.
¯\_(ツ)_/¯
Debug on a physical device

Android Studio error, CPU does not support VT-x and NX

My CPU supports AMD Virtualization technology but still Android Studio gives error that my CPU does not support VT-x and NX. Any help?
According to the doc, VT-x is an Intel Virtualization Technology, so you can't suppot this technologie with an AMD processor.
The second point, NX , is a feature of a processor that helps to protect your PC from attacks by malicious software. When this feature is not enabled and you try to run certain emulators in android studio, you will get an error message like this.
You need to restart your computer, enter BIOS, in case of AMD processors, you will see the NX flag. If that is not enabled, toggle the option and enable it.
Android Studio Virtual Device Testing requires virtualization AND Hypervisor with Windows os, running on an AMD processor.
Control Panel: You need to enable 'Hyper-V' and 'Windows Hypervisor Platform' BOTH. Open control Panel, search for 'Turn Windows features on or off', the tick the boxes for both the above features. This requires a restart. You can do the BIOS update on the same restart:
BIOS: Your CPU may have virtualization turned off (even if the cpu supports virtualization). (look up your CPU specs and look for the virtualization spec it should say AMD-V ).
Restart your PC, enter the BIOS (del or alt+f4 or f1), and enter 'advanced cpu' menu. There toggle on 'virtualization' ( it may be called 'SVM mode' or 'AMD-V' ). Then save and exit the BIOS.
Android Studio: Of course install all the packages that Android Studio asks for for the AVD you choose.
Also I installed ALL of the tools (Settings->Appearance & Behaviour->System Settings->Android SDK) under the tab 'SDK Tools' in Android Studio.
That worked for me. It took a while to find the solution. But that did it.

HAXM Virtualisation Install

I'm a new Android developer and learner, and I am actually facing some strange issue. (config : Intel Core i7 3630QM # 2.40GHz , 6go ram , windows 8.1)
Just like many, I encountered the HAXM issue when I tried the emulator on the AVD manager.
What I have done :
1. Download the package for intel accelerated HAXM virtualisation via my SDK manager
Figure out the sdk location on my pc, and click on install (manually on the app)
C:\Users\didier\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager)
2.1 I get this error,
My PC meets the requirements but...
This means that my HAXM virtulisation may not be enabled on my pc.
2.2 I checked that on my BIOS, enabled it , saved and exit.
3. I retry the install from the exe file in my sdk location.
- I get the same error message.
So I tried install from intel website : Software from intel Website link , ==> I get the same
error message
I download Speccy, a program that tells you what is on your PC, I found that on BIOS, the Virtualisation option that I enabled , was actually DISABLED.
So I rebooted, and check that, it was ENABLED.
So now, I don't know what to do, I have found some other solution to emulate, but it's quite slow, it uses ARM technology.
Here is a possible solution to your problem, what I've found from your information given is that:
Your processor supports HAXM, see this spec sheet.
The hardware requirements are:
Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality
At least 1 GB of available RAM
Referring to that list of possible solutions, you should try:
Double check if Execute Disable Bit, VT-x, VT-d are turned on in BIOS
Disable Hyper-V in Windows 8.1
There have been issues with Hyper-V tech conflicting with HAXM, refer to this SO question.
Create a separate boot entry that disables hyper-V completely, or just disable all of it by:
Press Start.
Type CMD.
Right-Click, select Run As Administrator (must do this even if on Admin account)
type this in bcdedit /set hypervisorlaunchtype off
Reboot. Hyper-V should be off now.
I had the same problem with a similar processor, core i3, in my VAIO laptop. VT was also enabled on the BIOS and the problem was fixed when I uninstalled the avast anti-virus(no disabling the protection) and so I could finish the HAMX installation. After that, I installed the Avast software again.
I hope this issue can help more people.
I had terrible trouble getting an Android Virtual Device to work on Android Studio. I thought I had done everything right but then I checked the Hewlett Packhard BIOS again and realised that the word Enable beside Virtualisation really meant Enable and not Enabled, which is VERY confusing. Switch to Disable (which seems to mean Enabled) and all should be good. Talk about double negatives!

Running the new Intel emulator for Android

Lately Google and Intel have published a new way to run the emulator, which should work much better than the previous version (which has emulated ARM CPU). Here are some links about it: this and this.
However, after installing the new components and creating a new emulator configuration as instructed, I get an error and I also can't see any improvements. I've tried both API 10 and API 15, and with GPU enabled and disabled. None of those configurations helped. I've also tried it on two different computers and didn't get any boost (and got the same errors).
It seems that on the posts I've read about it, nobody had any problems with it and all report a much faster emulator.
The error it shows is:
emulator: Failed to open the HAX device!
HAX is not working and emulator runs in emulation mode
emulator: Open HAX device failed
Why is it happening, and is there a way to fix it? Is there anyone else who gets those errors or vice versa?
By the way, I have an Intel CPU, if that could be a problem.
EDIT:
here's what I see in the BIOS, so it should be available... :
I had the same issue, solved it by Installing the Intel Hardware Accelerated Execution Manager. Download it with the SDK Manager, it's in Extras. After this, go to the folder
[Android SDK Root]\extras\intel\Hardware_Accelerated_Execution_Manager
then run IntelHaxm.exe and install.
Here the link of the Intel Hardware Accelerated
IntelHaxm.exe for
Microsoft Windows,Mac OS* X, and Linux
Ubuntu
You'll get the following message if you don't have virtualization enabled in your BIOS:
Small Note for Windows 8 user, Intel HAX will not work if Hyper-V feature is enable. Hyper-V (like most of the virtualization tech) will exclusively lock the VT extension witch will prevent HAX to work properly. A workaround if you “need” Hyper-V too might be to stop manually the Hyper-V services when you need HAX (haven’t tested it yet through).
If all else fails. Simply try to download the Intel HAXM zip manually, extract and install.
check here
Remember this only works for an Intel cpu that supports Intel Virtualization Technology. And you MUST enable virtulization in your bios.
It's a fairly decent and very noticeable improvement to the android emulator if you ask me.
Not every processor is supporting the virtualization!
To find out your chipset abilities go to http://ark.intel.com/,
insert the name of your processor in the search line and check out the resolve.
Advanced Technologies: ...
Intel® Virtualization Technology (VT-x) = ???
If you see "No", you can forget HAXM!
Here are the steps to get the Hardware Accelerated Execution (HAX) which is really quite a lot:
1-check your processor Intel website to see if it supports Intel VT-x or not:
http://ark.intel.com/Products/VirtualizationTechnology
all Intel Core i processors and some other selected processors support Intel VT-x
2- check your bios to enable Intel VT-x , usually called hardware virtualization or Intel virtualization in bios
3- check if you are using a software conflicting with HAXM, popular software conflicting with haxm include but not limited to:
Hyper-V
Windows phone SDK 8
Avast antivirus 8
4-install Intel management engine interface (MEI), this driver is usually not installed and is not part of retailer Windows DVD, even Windows 8.
Check this post about how to install:
http://communities.intel.com/community/vproexpert/blog/2011/12/19/mei-driver-now-available-via-microsoft-windows-update
This driver is required and is not optional to activate Hardware Acceleration
you can also install it from windows update
5-use android SDK manager to download Extras -> Intel x86 Hardware Accelerated Execution Manager.
6-Run installer of HAXM from:
[Android SDK Root]\extras\intel\Hardware_Accelerated_Execution_Manager\IntelHaxm.exe
if you passed the previous steps the installer will work just fine ,otherwise it will fail
7-start AVD and see the difference in performance, Animations are faster
System UI and launchers crashes in 4.0.3 but are just fine for 4.2.2
see installation guide by intel:
Using SDK Manager to download Intel HAX did not work.
Downloading and installing it from the Intel website did work.
http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/
Top Tip: making the change in my BIOS to enable virtualization and then using "restart" did not enable virtualization. Doing a cold boot (i.e. shutdown and restart) suddenly made it appear.
The first step (on Windows) is to make sure that the Micrsoft Hardware-Assisted Virtualization Tool reports that "this computer is configured with hardware-assisted virtualization".
http://www.microsoft.com/en-us/download/details.aspx?id=592
You might need to turn on virtualization in your BIOS, most manufacturers disable it by default. Intel HAX requires CPU virtualization to be enabled.
The same began to happen to me about one week ago, without apparent reason (99% sure that I didn't upgrade anything); after being able to run the emulator for some time it just stopped working without an apparent reason.
I tried to install the Intel thingie, but the installer reported that my machine doesn't support Intel VM, despite the fact that it has an Intel i3 processor and that virtualization is enabled (perhaps XP is too old an OS for that, although MS VM, Oracle's Virtual Box and VMWare have been installed an working in this machine with the same OS).
I just edited the VD to emulate an Arm processor, and everything is working again.
Perhaps not the optimal solution, but it works!
For Windows, there are some answers explained how it works. But I'm a Mac User, I don't know how to install HAX driver for Mac as they did for Windows. Finally I found the below link and it did fix my problem. You should download HAXM of Mac
and then install it.
https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement-macosx/
Complete step-by-step instructions for running the accelerated emulator can be found on the official Android developers website:
Caution: As of SDK Tools Revision 17, the virtual machine acceleration
feature for the emulator is experimental; be alert for
incompatibilities and errors when using this feature.
You have to download the Intel® Hardware Accelerated Execution Manager.
Then you will get this message:
Starting emulator for AVD 'test'
emulator: device fd:740
HAX is working and emulator runs in fast virt mode
For Mac users who want to check whether your processor supports virtualisation, use the maccpuid software and look for VMX. If it is checked then you're good to go.
Download it here
Here there are two issues we have to concentrate on:
HAX device failed to open,
For this problem, you have to run the HAX device setup file from the HAX addon folder. Follow Speed Up Android Emulator to know clearly how.
If you created the AVD through AVD manager then you can change the RAM size in AVD Manager and device edit option.
If you created the AVD through command line, then you should start the AVD from command line will work,
emulator -memory 512 -avd gtv_avd
If everything else fails, it's good to try my option and download a HAXM installer.
It needs to be copied to HAXM installation folder and then started from command line (start CMD as an Administrator). After restarting computer HAXM will be installed. It perfectly worked for me as I was having problems with installing it on my laptop.
After all simply type sc query intelhaxm in your cmd in order to check whether HAXM is installed properly.
If you are running an Intel processor make sure the HAXM (Intel® Hardware Accelerated Execution Manager) installer is installed via SDK Manager by checking this option in SDK Manager. And then run the HAXM installer ext via the path below.
your_sdk_folder\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe
Also check the RAM size allocated while doing HAX installation so it fits the RAM size of your emulator.
This video shows all the required steps which may help you to solve the problem.
This video will also help you if you face a problem after installing HAXM.
Download HAXM from the Intel site.
Install it.
And then run the AVD from AndroidStudio, menu -> Tools -> AVD. Choose x86.
It works!

Categories

Resources