How to enable hardware acceleration for Android Emulator in Windows Server 2019?

Viewed 1690

I have an AMD CPU, with Windows Server 2019 (dont ask why), where I enabled Hyper-V. However, in my (stable channel) Android Studio, it still says

Unfortunately, your computer does not support hardware accelerated virtualization. Here are some of your options:

1) Use a physical device for testing

2) Develop on a Windows/OSX computer with an Intel processor that supports VT-x and NX

3) Develop on a Linux computer that supports VT-x or SVM

4) Use an Android Virtual Device based on an ARM system image (This is 10x slower than hardware accelerated virtualization)

Is it that the Hyper-V enabled emulator option only available in the beta channel of Android Studio? How to enable hardware acceleration for Android Emulator in Windows Server 2019?

1 Answers

After an hour of searching, I've found that Hyper-V and Windows Hypervisor Platform (WHPX) are not the same. While you can enable Hyper-V through GUI in Windows Server 2019, you can't do the same for WHPX. Aside from enabling Virtualization in BIOS and Hyper-V through the GUI mode, to enable WHPX on Windows Server 2019 (and possibly other Server editions), run the following command in PowerShell with elevated permissions:

Dism /Online /Enable-Feature:HypervisorPlatform

It is working after running the command, even without a restart.

Related