Using the Visual Studio Android emulator inside VMWare


I do my development in Virtual machines.  It makes it much easier to to back up and transfer my dev environments.  However not everything works inside a virtual machine :(.  Emulator that themselves rely on a virtual machine are problematic.When Visual Studio 2015 was released, I built a new VM and installed everything.  VS2015 worked fine but the new shiny Android emulator wasn’t so happy.The first error was around Hyper-V.Visual Studio Emulator for AndroidThe emulator is unable to verify that the virtual machine is running:Something happened while starting a virtual machine: ‘VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.bob’ failed to start. (Virtual machine ID 889F3EA2-7B0E-4873-9180-C765E4293D4E)The Virtual Machine Management Service failed to start the virtual machine ‘VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.bob’ because one of the Hyper-V components is not running (Virtual machine ID 889F3EA2-7B0E-4873-9180-C765E4293D4E).This a fairly common error and once that is easy to fix.Open the .vmx file in notepad and ad the following lines:hypervisor.cpuid.v0 = “FALSE”mce.enable = “TRUE”vhu.enable = “TRUE”Run the VM.  Go to “Programs and Features” and ensure that Hyper-V is installedRunning the emulator now gives a completely different error.  Yay, progress.Visual Studio Emulator for AndroidAn OpenGL error has occurred:Failed to create Context 0x3005The emulator will now shut down.There are multiple ways to fix this:Turn off “Accelerate 3D Graphics” in the VM settingsIn the VM, edit the c:program files (x86)Microsoft XDE10.0.10240.0skusandroidxdesku.xml file and remove the following line from the file: GuestDisplayProvider=”VsEmulator.OpenGLGuestDisplay”Either way works:

Comments are closed.