I have a fresh install of android studio on Windows 10, with all the packages for android api 22. When I run the emulator I get the following message
C:\Users\admin\AppData\Local\Android\sdk\tools\emulator.exe -avd foo -netspeed full -netdelay none
emulator: device fd:928
HAX is working and emulator runs in fast virt mode
I can see the emulator in the task manager, but it doesn't actually load.
I've been looking for answers to why it doesn't load and I've made sure all the ram settings are correct, but I don't understand why the emulator won't load.
Thanks
HAXM, the Intel Android Virtualization Technology is incompatible with Hyper-V. Turn off Hyper-V and give it a go again. Hyper-V will often be installed if you have installed Visual Studio with Windows Phone tools.
Or from an admin command prompt run the following.
Note to get an admin cmd prompt, right-mouse the windows icon, click Command Prompt (Admin ).
To turn off Hyper-V run this:
bcdedit /set hypervisorlaunchtype off
and then reboot
To turn Hyper-V back on, run this:
bcdedit /set hypervisorlaunchtype auto
And then reboot
You can turn off Hyper-V in the services menu (type "Services" in the Search thingy), and also use the Services menu to turn it back on. Even though it may not be necessary I still reboot after doing it this way.
Blog post on this here - http://www.devfish.net/post/2015/08/18/error-x86-emulation-currently-requires-hardware-acceleration-android-on-windows.aspx
Healy in Tampa
This has a very simple solution only if the installation process is complete and still the emulator is not launching, Solution: Just try to use older API version or any older stable android API version. In my case, the latest version I was having was API-31, but the API-28 worked for me. Change you android API to any older version Try it. This worked for me.
Related
Setup:
Windows 11 Home 21H2 22000.132
AMD Ryzen 5900X
WSL2
Android studio lastest build (also tried with latest beta)
Problem:
As soon as I install WSL2, the emulator stops working. It's giving the following error message:
C:\Users\gusta\AppData\Local\Android\Sdk\emulator>emulator.exe -avd Android_TV_1080p_API_300
emulator: Android emulator version 30.8.4.0 (build_id 7600983) (CL:N/A)
handleCpuAcceleration: feature check for hvf
added library vulkan-1.dll
Failed to open /qemu.conf, err: 2
C:\Users\gusta\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: WHPX: Failed to setup partition, hr=c0350005
C:\Users\gusta\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: failed to initialize WHPX: Invalid argument
Using WSL2 at the same time as the android emulator was working before on an Intel i7 4770k processor, but stopped working after a processor upgrade to a AMD Ryzen 5900x and fresh install of Windows 11.
For clarification: I'm not trying to run the emulator from WSL2, I'm trying to run it from Android Studio. When trying to start it from Android Studio it never launches, when trying to run it from the Windows Command Line I get the above error.
The "Failed to open /qemu.conf" is possible to solve by creating that file manually, as explained by this answer. That however doesn't fix the two later errors with WHPX.
I've followed the official instructions on this page (Following the AMD with Hyper-V option WHPX). I think the problem has to do with Hyper-V running which WSL2 is using if I'm not misstaken. But according to the above link it should be possible to run the emulator at the same time as Hyper-V using WHPX. I've also tried using the Android Emulator Hypervisor Driver for AMD processors, which is giving me the exact same result.
Activated Windows features:
Thankful for any help, and please tell me if I need to add more information
Newer Answer
I found and tested in shorter toggle mechanism.
The configuration for Windows Feature:
Windows Subsystem for Linux is installed.
Windows Hypervisor Platform is installed.
Hyper-V is installed.
If you need the Emulator, you only need to turn off Hypervisor + Restart. Run: bcdedit /set hypervisorlaunchtype off
If you need the Docker back, you can run the hypervisor hence disabling Emulator. Run: bcdedit /set hypervisorlaunchtype auto
You need to restart after setting Hypervisor
You cannot run both at the same time. Another forum worth checking in How about running docker? in my older answer below.
Older Answer
I think I solved this issue, tested to run from CMD / Android Studio and ran perfectly as before installing WSL. There are several step we go:
Configuring Windows Feature:
Removed Windows Subsystem for Linux
Removed Windows Hypervisor Platform
Removed Hyper-V
Here is my current setup:
Reverting AVD setup
I know after removing there are some odds because the AVD still get the same error as before and expected to get into WSL. I stumbled and found something when ran:
C:\Users\[NAME]\AppData\Local\Android\Sdk\emulator\emulator-check.exe accel
That command will check the current accel. It explains that the Hypervisor need to be set off and give specific help:
run bcdedit /set hypervisorlaunchtype off.
After running the bcdedit, I restarted and all is reverted. Now I can run emulator both from CMD and Android Studio perfectly.
How about running docker?
Sad truth, yeah you cannot run both pararel. There are several workaround in this forum:
How can I run both Docker and Android Studio Emulator on Windows?
Several option ranging from changing emulator, add & remove docker when in need using above step, created nested vm, etc. My personal choice right now is using another Emulator for the time being and removed docker for the latter.
I finally got this working using this fix (answer number 48). Seems like a valid workaround until windows fixes this issue. I downloaded the compiled version for windows and moved it to my emulator path C:\Users\<username>\AppData\Local\Android\Sdk\emulator. Seems to be versions available for linux and mac as well but I haven't tested those.
This issue is tracked by Google bug https://issuetracker.google.com/issues/202188690
This problem only occurs with AMD processors, I have two systems both with WSL2 and Docker running on the latest Windows 11 (Insider Beta) build. One with an AMD Ryzen 5950 and one with an Intel i7-8086K.
On the Intel system the emulator runs fine with hardware acceleration together with WSL2 and Docker.
On the AMD I run into the same error when running the emulator with hardware acceleration. In the Windows 10 Insider builds before Windows 11 it still worked.
A very similar problem was introduced before in Windows 10 build 10.0.21292
and later fixed in build 21327. (https://github.com/microsoft/WSL/issues/6471) But this problem affected both Intel and AMD.
I haven't tried to turn off the AMD fTPM yet, as this is the only other change apart from updating Windows 10 Insider (dev ring) to Windows 11.
The Android Emulator Hypervisor Driver for AMD processors only works when the Windows Hypervisor is disabled, it's not used for WHPX.
The Windows Feedback is full of reports of this problem, please upvote them.
Android Studio emulator doesn't support run Hyper-V on Windows 11, we can disable Hyper-V to run but if we do that applications which require Hyper-V to run like WSL2, Docker then fail to run.
While waiting Google update Android Studio emulator support Hyper-V we have a workaround solution to run both by using another emulator which support Hyper-V like Bluestack 5 version "Nougat 64 bit (Supports Hyper-V)" at the link below
https://www.bluestacks.com/download.html
If you did all of those steps and still you are facing that emulator termination issue, then please upgrade or download your graphic card drivers and install it. After I installing Windows 11 this issue happened to my android studio emulator. Lot of steps I followed but nothing work. after that I checked my Graphic card drivers and install it. Now emulator working fine...
I am using Visual Studio 2017 / Xamarin in windows 7 ultimate platform and using the Android Device Manager to run Android emulator in it.
When I try to run it says "Intel HAXM is not compatible with Hyper-V" and the Details are "You are attempting to accelerate the emulator using Intel’s HAXM, but you have Hyper-V enabled in your system settings. Disable Hyper-V by running: bcdedit /set hypervisorlaunchtype off in an elevated command prompt and restart your computer before trying again."
I have checked and in my system Hyper-V is not installed.
I also have run the bcdedit /set hypervisorlaunchtype off and after checking it is varified that the hypervisorlaunchtype is off now.
Also I have checked using system infomation and other tools and Hyper-V is not running.
Also I checked that HAXM is running by using the command "sc query intelhaxm" and shows it is running with State = 4
It looks like that Android Device Manager (Virtual Device) is checking some other parameter to detect if Hyper-V is running. Don't know if this is a registry setting or some other program is using intel VT (virtualization technology) and AVD is giving this message because of that. I have done lot of research on this, installed the latest HAXM etc. but no luck. Can someone help me on this. Thanks in advance.
De-select Hyper V from windows feature like this.
Hyper v
This question already has answers here:
Error during installing HAXM, VT-X not working
(25 answers)
Closed 5 years ago.
I want to learn android and I installed Android Studio and create an emulator from Android Emulator Manager and later I got that my windows 10 is Home edition and it does not have Hyper-V option though I enabled Virtualization technology from Bios. But Android Emulator cannot recognize it and telling me to turn on the VT. I am unable to run the emulator. How can I run the emulator?
Thank you.
HAXM, the Intel Android Virtualization Technology is incompatible with Hyper-V. Turn off Hyper-V and give it a go again. Hyper-V will often be installed if you have installed Visual Studio with Windows Phone tools.
Or from an admin command prompt run the following. Note to get an admin cmd prompt, right-mouse the windows icon, click Command Prompt (Admin ).
To turn off Hyper-V run this: bcdedit /set hypervisorlaunchtype off and then reboot
To turn Hyper-V back on, run this: bcdedit /set hypervisorlaunchtype auto And then reboot
You can turn off Hyper-V in the services menu (type "Services" in the Search thingy), and also use the Services menu to turn it back on. Even though it may not be necessary I still reboot after doing it this way.
Blog post on this here - http://www.devfish.net/post/2015/08/18/error-x86-emulation-currently-requires-hardware-acceleration-android-on-windows.aspx
I just installed the Windows 10 anniversary update and now I can't start my Android emulators.
Android Studio shows the following message.
Android Emulator is incompatible with Hyper-V
But as you can see in the following image, Hyper-V is disabled.
I already rebooted the machine. I also tried running the following command from an elevated command prompt:
bcdedit /set hypervisorlaunchtype off
No luck.
Tried launching the emulator from a command prompt fails with the following message:
emulator -avd Nexus_5_API_23
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: Please disable Hyper-V before using the Android Emulator. Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.
Has anyone run into this issue?
The problem in my case is that I had Credential Guard and Virtualization Based Security.
I disabled the mentioned Windows 10 features using Device Guard and Credential Guard hardware readiness tool.
Unzip the tool, in a Powershell command go to the folder where you unzipped the tool and type:
DG_Readiness_Tool_v2.0.ps1 -Disable
After rebooting I was able to reinstall HAXM and start my emulators.
You can turn off Hyper-V in the services menu (type "Services" in the Search thingy), and also use the Services menu to turn it back on. Even though it may not be necessary I still reboot after doing it this way.
EDIT: And also did you run Command Prompt as Admin?
EDIT2: Reinstall Intel HAXM, as #Morrison_Chang says
my avd is not running on eclipse. sometimes it says, haxm is not installed. sometimes just a black screen appears and nothing happens. why is this happening? i tried to reinstall but nothing happened. but it was working few days ago and suddenly this is happening. i cant run my apps on emulator. how to fix this?? i am using a windows 10 tech preview 64 bit. i have tried to run eclipse on my laptop windows 7 64 bit with different version, same problem. so there must be some technical problem that i dont know, pls help.....
HAXM, the Intel Android Virtualization Technology is incompatible with Hyper-V. Turn off Hyper-V and give it a go again. Hyper-V will often be installed if you have installed Visual Studio with Windows Phone tools. Or maybe Hyper-V is just turned on somehow?
Or from an admin command prompt run the following. Note to get an admin cmd prompt, right-mouse the windows icon, click Command Prompt (Admin ).
To turn off Hyper-V run this: bcdedit /set hypervisorlaunchtype off and then reboot
To turn Hyper-V back on, run this: bcdedit /set hypervisorlaunchtype auto And then reboot
You can turn off Hyper-V in the services menu (type "Services" in the Search thingy), and also use the Services menu to turn it back on. Even though it may not be necessary I still reboot after doing it this way.
Blog post on this here - Blog post on this here - http://www.devfish.net/post/2015/08/18/error-x86-emulation-currently-requires-hardware-acceleration-android-on-windows.aspx
Healy in Tampa
Android emulators are not super reliable. Can you try using genymotion (http://www.genymotion.com/). It is free for personal use and it is super fast.
Open the Android SDK Manager from Eclipse tab "Window", check the box at the very bottom in the Extra folder that says "Intel x86 Emulator Accelerator (HAXM installer)" and click Install package. I think you are using an emulator with VM Acceleration.