skip to Main Content

I have Windows 11 on my system.
The system specifiction:

  • Edition: Windows 11 Home Single Language
  • Update: 21H2
  • Installed on: ‎06-‎07-‎2021
  • OS build: 22000.65
  • Experience: Windows Feature Experience Pack 421.17400.45.3

I have fresh installed Android Studio. Now I want to run the emulator without Intel HAXM as I want to run it alongside wsl2.

So in my optional feature, these two features are enabled

  1. Windows HyperVisor Platform
  2. Virtual Machine Platform

But while running the emulator I’m getting this error:

❯ .emulator.exe -avd Pixel_3a_API_30
emulator: Android emulator version 30.7.5.0 (build_id 7491168) (CL:N/A)
handleCpuAcceleration: feature check for hvf
added library vulkan-1.dll
C:Users....AppDataLocalAndroidSdkemulatorqemuwindows-x86_64qemu-system-x86_64.exe: WHPX: Failed to setup partition, hr=c0350005
C:Users....AppDataLocalAndroidSdkemulatorqemuwindows-x86_64qemu-system-x86_64.exe: failed to initialize WHPX: Invalid argument

Anyone got suggestions, how to resolve this issue.

10

Answers


  1. Final Update:

    As stated by Георги Ангелов:

    The latest version of Android Emulator – 31.1.2 is fixing the issue. Update through SDK Manager. Released 11/11/2021.


    Update:

    As stated in Mark Wood-Patrick answer, the emulator hasn’t been updated yet but you can download the new emulator binaries with the fix!

    From https://issuetracker.google.com/issues/202188690#comment48

    windows: https://dl.google.com/android/repository/emulator-windows_x64-7869535.zip
    linux: https://dl.google.com/android/repository/emulator-linux_x64-7869535.zip
    macosx: https://dl.google.com/android/repository/emulator-darwin_x64-7869535.zip


    WHPX as of now is not working with Windows 11, I will update this answer when it gets fixed.

    There are two possible workarounds:

    Disable Hyper-V (Keep in mind WSL2 or any VM won’t work without this)

    To disable Hyper-V you must follow these steps:

    1. Open Turn Windows features on or off.
    2. Uncheck Hyper-V and Windows Hypervisor platform (it may be required to uncheck Windows Sandbox).
    3. Open Android Studio and SDK Manager.
    4. In SDK tools, install Android Emulator Hypervisor Driver for AMD Processors (installer).

    Open the emulator with no acceleration

    1. Open a terminal.
    2. Enter cd C:UsersUserAppDataLocalAndroidSdkemulator with your user.
    3. Enter .emulator.exe -avd Pixel_4a_API_30 -accel off with your AVD device name.
    Login or Signup to reply.
  2. weird for me.
    two windows machines.
    both with fresh clean iso install of latest windows 11 builds
    (tried both dev and beta channels on both machines).

    the i9-9900KF desktop will run android emulator using whpx acceleration, the XPS13 i7-1185G7 fails

    re-installed windows 10 on the XPS13 and as expected the acceleration works….

    i give up

    Login or Signup to reply.
  3. You must disable "Virtual Machine Platform" too, not just Hyper-V enter image description here

    Login or Signup to reply.
  4. It’s possible to run the emulator from the WSL2 side and it’s what I ended up doing. You can install the GUI version of Android Studio in WSL2 and from there create the emulator as usual.

    How to run GUI apps in WSL2 if it’s not working already: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

    Not an answer to the original problem but a workaround for the time being.

    Login or Signup to reply.
  5. This works for me with an intel I7 11gen processor on latest version of windows 11 pro, Open Turn Windows features on or off Uncheck Hyper-V, Virtual Machine Platform, Windows Hypervisor Platform, Windows Sandbox and close Memory integrity (switch from on to off) from the Windows security Core isolation feature, after that you have to restart your device and install new AVD in your android studio and it will work fine.

    Proof

    Login or Signup to reply.
  6. I have been looking for a solution for a long time, because my Surface Pro 8 came with Windows 11 and I didn’t wanted to switch back to Windows 10. But at the moment there seems to be no really good solution, which made me switch back to Windows 10 for now. Here everything works again. 🙂

    Login or Signup to reply.
  7. Current solution until Google releases a new version of the emulator:

    Download the binaries from https://issuetracker.google.com/issues/202188690#comment27 and extract them into your emulator directory, replacing the qemu binaries.

    Login or Signup to reply.
  8. The latest version of Android Emulator – 31.1.2 is fixing the issue.
    Update through SDK Manager. Released 11/11/2021.

    Login or Signup to reply.
  9. There is a fix for this issue see:

    https://issuetracker.google.com/issues/202188690#comment45
    

    Can I get more details on how you ran the emulator on wsl2 when I ran it the window came up but nothing was displayed. I am able to run nautilus and android studio on wsl2 without issue. I need to be able to run with hyper-v enabled

    Login or Signup to reply.
  10. In the windows 11 Version 22H2 OS Build 22581.200 :
    Goto Windows Security –> Device Security –> Core Isolation –> Memory Integrity (Turn this to Off)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search