laserany
laserany

Reputation: 1451

Can't install Android Emulator for AMD Processors

I have windows 10 Home and AMD ryzen 5 processor. I'm using android studio 4.0 canary 7 (I also tried the latest stable version with the same error). I'm following the official tutorial to enable the Android Emulator for AMD Processors here..

https://androidstudio.googleblog.com/2019/12/emulator-29211-and-amd-hypervisor-12-to.html

This is relatively new and I created an issue for them but wanted to see if someone might help with this or had this problem before. So everything looks good until the step to install gvm as administrator by going to the directory (Android_Emulator_HyperVisor_Driver) and running silent_install.bat. For some reason it is failing to run the service and I get the following error

[SC] ControlService FAILED 1062:

The service has not been started.

[SC] DeleteService SUCCESS
[SC] StartService FAILED with error 4294967201.

Hypervisor platform is disabled (It should according to this latest tutorial as this is different than how it was last year). Any feedback or suggestions are appreciated.

Upvotes: 41

Views: 127973

Answers (9)

Obsidian Jackal
Obsidian Jackal

Reputation: 285

The Microsoft Hypervisor (Hyper-V) feature is only available on Windows 10/11 Pro, Enterprise, & Educational editions.

[SC] ControlService FAILED 1062:

The service has not been started.

[SC] DeleteService SUCCESS
[SC] StartService FAILED with error 4294967201.

This error is shown when the current user doesn't have the necessary permission to do that. The permission needed is called "SeLoadDriverPrivilege" and it lets users "Load and unload device drivers." You can run this to check to see if you have that permission:

whoami /priv

If it's disabled or you don't see it listed, you can use PowerShell, DISM, or bypass the restriction with the 3rd party tool PsExec from Sysinternals.

Try one of these options:

  1. Use Enable-WindowsOptionalFeature
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
    
  2. Use DISM
    dism /online /enable-feature /featurename:Microsoft-Hyper-V /all /norestart
    dism /online /enable-feature /featurename:Microsoft-Hyper-V-Tools-All /all /norestart
    dism /online /enable-feature /featurename:Microsoft-Hyper-V-Management-PowerShell /all /norestart
    dism /online /enable-feature /featurename:Microsoft-Hyper-V-Hypervisor /all /norestart
    dism /online /enable-feature /featurename:Microsoft-Hyper-V-Services /all /norestart
    dism /online /enable-feature /featurename:Microsoft-Hyper-V-Management-Clients /all /norestart
    
  3. Use the psexec app from the Microsoft Sysinternals website.
    psexec -s -i cmd.exe
    
    Verify that you have the SeLoadDriverPrivilege privilege.
    whoami /priv
    
    Replace edit the command below if you installed the Android SDK someplace else:
    cd %LOCALAPPDATA%\Android\Sdk\extras\google\Android_Emulator_Hypervisor_Driver
    
    Run the silent installer
    silent_install.bat
    

Upvotes: 0

saraf
saraf

Reputation: 530

I am using Windows 11.

In addition to all the other answers, I also had to disable Core Isolation (in Windows Defender options).

Windows Security -> Device Security -> Core Isolation -> Memory Integrity

Set to 'Off' and then restart.

Image showing option for disabling Memory Integration Protection

After the reboot, I was able to run the silent_install.bat from an Admin PowerShell prompt as follows:

Pic showing the path where I ran silent_install.bat and the success message

Upvotes: 0

Ruslan Zhomir
Ruslan Zhomir

Reputation: 888

I have tried everything that's written here, with no success.

For me an option in BIOS (AMD V(TM), which is actually the same (or maybe almost the same) as SVM or SVM Mode) was ON already. And I didn't try to touch it at all. So I was going to write to support already. And in the process of gathering information for that I have turned that option off in BIOS. And then ON again (with restarts on every step ofc). Then I have discovered, that the folder with silent_install.bat has dissapeared. So I went to Android Studio and discovered that Emulator just works.

So, If you had tried everything, try to just turn off virtualization in BIOS and after restart turn it back On.

Upvotes: 1

Anwar Benhamada
Anwar Benhamada

Reputation: 345

If you are using Avast antivirus (or AVG), this can be the cause of this problem.

So things to do to fix this:

  • Activate Virtualization in bios
  • Deactivate Hyper-v and hypervisor platform in "activate/desactivate windows function" & run powershell as admin and run the following command: Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
  • In Avast Antivirus. In settings click Troubleshoot on the left side of the screen, uncheck the box next to Enable hardware assisted virtualization, then click OK to confirm and restart your computer

I've got the solution from https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors/issues/10#issuecomment-715423881.

Upvotes: 6

abdou-tech
abdou-tech

Reputation: 868

If you tried everything (turning windows features off, enabling svm in bios..etc) and still didn't work, type bcdedit in the command prompt, and press ENTER. If you see an entry for hypervisorlaunchtype set to Auto, Hyper-V is still enabled. You can try setting the launch type to Off by running the command below.

bcdedit /set hypervisorlaunchtype off

That's the only thing that worked for me after trying literally everything.

Upvotes: 25

laserany
laserany

Reputation: 1451

I found the answer after long time. I had to enable Virtualization on my machine.

Upvotes: 3

ram sankar
ram sankar

Reputation: 201

If You are using AMD Ryzen Just go to bios setting check for SVM Mode if it is Disabled then Enable it .. Emulator work perfectly..Below Link show where to enable SVM Mode in Aorus Gigabyte Motherboard BIOS..

https://www.youtube.com/watch?v=46DfLwX5AFQ

also Disable hyper-v in windows feature.. sample below

https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors/wiki/Is-Hyper-V-really-disabled%3F

After this emulator will works like a charm...

Upvotes: 20

CHAITANYA
CHAITANYA

Reputation: 81

Go to BIOS setting of your laptop/PC, and enable the SVM setting and save it. This should work. This issue is because Virtualization on the PC is disabled once it is enabled it works. Please let me know if it doesn't work.

NOTE : BIOS - As your PC’s most important startup program, BIOS, or Basic Input/Output System, is the built-in core processor software responsible for booting up your system.

Restart your machine and press the hotkey, your BIOS setting will be opened.

These are some brands hotkey, might be useful.

  • Acer: F2 or DEL

  • ASUS: F2 for all PCs, F2 or DEL for motherboards

  • Dell: F2 or F12

  • HP: ESC or F10

  • Lenovo: F2 or Fn + F2

  • Lenovo (Desktops): F1

  • Lenovo (ThinkPads): Enter + F1.

  • MSI: DEL for motherboards and PCs

  • Microsoft Surface Tablets: Press and hold volume up button.

  • Origin PC: F2

  • Samsung: F2

  • Sony: F1, F2, or F3

  • Toshiba: F2

Upvotes: 8

John Edwards
John Edwards

Reputation: 1

I'm just a hobbyist so I have no idea why this works but if you install NoxPlayer (Android emulator), Android Studio emulator works perfectly.

Upvotes: -6

Related Questions