I have created a new Blank App (Xamarin.Forms Portable) project in Visual Studio 2015.

When I try to run Droid project in Visual Studio Emulator for Android, I just get a generic error message:

An error occured while creating 'VS Emulator 5" KitKat (4.4) XXHDPI Phone' device.

So I looked into Tools->Visual Studio Emulator for Android, and tried to run emulator manually. After a while it fails and log says:

24.7.2015 16:22:52: [Informational] Reinitializing installed profiles.

24.7.2015 16:22:52: [Informational] Installed profiles initialized. Devices: 2 Platforms: 1

24.7.2015 16:22:52: [Informational] Reinitializing installable profiles.

24.7.2015 16:22:52: [Informational] Installable profiles initialized. Devices: 30 Platforms: 4

24.7.2015 16:22:56: [Informational] Waiting to launch device...

24.7.2015 16:22:56: [Informational] Launching Device: 5" KitKat (4.4) XXHDPI Phone

24.7.2015 16:22:56: [Informational] Validating emulator arguments...

24.7.2015 16:22:56: [Informational] Determining if emulator is already running...

24.7.2015 16:22:56: [Informational] Preparing virtual machine...

24.7.2015 16:22:58: [Critical] An error occured while creating 'VS Emulator 5" KitKat (4.4) XXHDPI Phone' device.

24.7.2015 16:22:58: [Critical] XDE Path: C:\Program Files (x86)\Microsoft XDE\10.0.10240.0\xde.exe

24.7.2015 16:22:58: [Critical] XDE Arguments: /sku Android /displayName "VS Emulator 5\" KitKat (4.4) XXHDPI Phone" /memSize 2048 /diagonalSize 5 /video "1080x1920" /vhd "C:\Users\lacike\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\5_KitKat_(4.4)_XXHDPI_Phone\image.vhd" /name "VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.lacike" /noStart /silent

24.7.2015 16:22:58: [Critical] XDE Exit Code: 3

However when I run WinPhone project in Windows Phone emulator, it works. It uses XDE.exe like Android Emulator, so Hyper-V network is working.

Any ideas?


When I tried to install a new device profile, I run to this same issue:

Visual Studio 2015 RC Emulator for Android doesn't start

The process is stuck on "Copying .vhd files and creating virtual machine".


When I open a command prompt and then run xde.exe with following xde arguments:

xde.exe /sku Android /displayName "VS Emulator 5\" KitKat (4.4) XXHDPI Phone" /memSize 2048 /diagonalSize 5 /video "1080x1920" /vhd "C:\Users\lacike\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\5_KitKat_(4.4)_XXHDPI_Phone\image.vhd" /name "VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.lacike

I get following error:Service Host Error

error 3 = ERROR_PATH_NOT_FOUND. Do you see the VHD in "C:\Users\lacike\AppData\Local\Microsoft\VisualStudioEmulato‌​r\Android\Containers‌​\Local\Devices\vhd\5‌​_KitKat_(4.4)_XXHDPI‌​_Phone\"? – magicandre1981
Yes, I do. That folder contains two files: image.version.txt and image.vhd – Ladislav Margai
What OS are you running? Is it Win10? If so, what build? – John Kemnetz
No, it isn't. I am using Windows 8.1 Enterprise 64-bit. – Ladislav Margai

16 Answers 11

I ran into the same problem. However, I have managed to get the emulator running by doing the following. Browse to the xde.exe directory and open a command prompt then run xde.exe with the xde arguments in your log minus the /nostart /silent commands. So in your case:

xde.exe /sku Android /displayName "VS Emulator 5\" KitKat (4.4) XXHDPI Phone" /memSize 2048 /diagonalSize 5 /video "1080x1920" /vhd "C:\Users\lacike\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\5_KitKat_(4.4)_XXHDPI_Phone\image.vhd" /name "VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.lacike"

It's probably also worth opening task manager first and end all running xde.exe processes first.

However I don't have Xamarin, so I'm not able to confirm that this will then let you deploy to the emulator.

Strange, when I run it from command prompt I get this error – Ladislav Margai
Mhmm, have you tried repairing/reinstalling the Android SDK's via the Visual Studio installer? Also I'm guessing you are using Visual Studio 2015 RTM? – Mark Hebden
Yes, I am using Visual Studio 2015 RTM, I tried to re-install whole Visual Studio 2015 with all components, but it didn't help. – Ladislav Margai
This helped identify my problem, which turned out to be a bad Hyper-V path. I moved my VMs to a different hard drive, but never updated the default paths in the Hyper-V Settings so it wasn't able to create any new Android emulator images. – Dan Dautrich

Usually, the System.ServiceModel.ServiceHost error means there is some residue from a botched installation.

First, go to Task Manager and kill any running XDE processes. If that doesn't fix it, go to Programs and Features > Microsoft Visual Studio Emulator for Android > Change and hit "Repair"

up vote 69 down vote accepted

After hours and hours of research, and applying following steps I finally get it working:

1) Repair Android SDK - go to Programs and Features > Microsoft Visual Studio Emulator for Android > Change and hit "Repair"

2) Remove All Hyper-V virtual switches - go to Hyper-V > Virtual switch manager > Remove all virtual switches

3) Run XdeCleanup.exe - In my case: "C:\Program Files (x86)\Microsoft XDE\10.0.10240.0"

4) In my case I had configured Internet connection sharing on Ethernet adapter before so I had to disable it

1 upvote
I was running into the same problem and this did the trick. Please note the importance of step 4 (I had network sharing enabled on my Wi-Fi). I have now been able to pass the "Preparing virtual machine" step. Now "Launching the emulator" (OS is starting). This seems to be taking a while though... I hope I'm not going to get stuck here. – Gyum Fox
1 upvote
FYI: the OS did fail to start (same as //…). But as far as I'm concerned, your answer solves the original question. – Gyum Fox
1 upvote
I deleted the .suo files underneath the .vs folder. After that my emulators worked and ripple worked – Brian
Worked perfect for me. Thanks – ShahiM
it fixed without step 4. – Nuri YILMAZ
I couldn't do 2) before I finish 3) because some VMs were still using virtual switches. However, 3) deleted these VMs and all virtual switches. So 2) was, at least for me, not necessary. – Dennis Schröer

I have found the following to work for me:

  1. Disable your WiFi connection.
  2. Launch your app.
  3. Observe Emulator gets loaded
  4. Re-enable WiFi.
  5. Note how restarting your app should not be an issue anymore as long as the emulator is initially loaded.
It could be a solution, but if you use WiFi as a primary connection to the internet, it brings a little discomfort for you. – Ladislav Margai

I think the root cause of the problem varies from machine to machine but seems to have something to do with how the Device Drivers of various network interfaces interact with the HyperV system (by the way, I am running Windows 10; some things are bound to be slightly different than Windows 8).

I have a MiFi device that draws power from my laptop's USB port. The device can allow direct connection to it over USB by the host system. When disconnected from the USB port, it routes traffic over WiFi.

@Ladislav's steps were a good starting point for me. It took a lot of monkeying around - after deleting all Emulator Images and Virtual Switches, then repairing the Emulator for Android installation - I stumbled on the likely cause of my problem being the MiFi unit.

I tried different configurations and noticed that if you disable the Ethernet Connection created automatically by windows (it has a description of Remote NDIS based Internet Sharing Device), the Emulators - Android and WindowsPhone now agree to start.

I plan to do more digging but I noticed that HyperV automatically creates virtual switches for all Bluetooth, WiFi and the main Ethernet port but not for the MiFi USB connection. Perhaps that creates some confusion in the underlying HyperV system and getting it out of the way makes everything run fine.

Perhaps others can also share their findings?

I agree. I used to disable the Ethernet Connection leaving just the WiFi connectiong before creating the first VM device to get it working. Yesterday just upgraded to Windows 10.0.14372 I notice a new network device for Wireless Hosted Network (they say it is a Windows 7 feature but I don't remember seeing it before) - stopping the service and uninstall the device from Device Manager helped things move along instead of failing at creating the virtual switch. I will try this again a few times and find where to report it to Microsoft. – Dan Dar3
1 upvote
@DanDar3, thanks for the added info. I also didn't think of reporting to Microsoft; perhaps it's something they can address for all of us. – Eniola

Just thought I'd add the solution that solved my problem.

After some digging around I realized that, for some reason, Hypervisor wasn't started with my computer. I have an vague feeling that the VirtualBox setup might be responsible for this, but that is not confirmed.

Anyhow, for me the solution was to enable hypervisor startup at boot time using BCDEDIT.

In an admin console enter:

BCDEDIT /Set {current} hypervisorlaunchtype auto 

and restart the computer.

+1 I can confirm connection with VirtualBox: On my machine, VirtualBox VMs only start when hypervisorlaunchtype is set to off. VS emulators OTOH only start when hypervisorlaunchtype is set to auto :-/. – Andreas Huber

I faced the same issue for a week. i followed below steps to fix this, 1) Reset your PC.It will clear all your data and installation file and restore the OS to earlier stage Reset PC 2) Reinstall the visual studio emulator for android 3) Start any profile and it works emulator

Good Luck:)

This seems like a very heavy-handed approach... – Jarrod Mosen

After formatting my computer I faced the same issue.

The issue was fixed by updating my LAN card drivers, although I don't know why that is.

I encountered the same problem. It has manifested itself ever since I upgraded to Windows 10 (regardless of the build).

None of the solution stated above seemed to work. However, after deactivating all but one of my network interfaces (I have three : Ethernet x 2 and Wifi), the solution proposed by Ladislav Margai above just worked.

This is what i've done :

1) Repair Android SDK - go to Programs and Features > Microsoft Visual Studio Emulator for Android > Change and hit "Repair"

2) Remove All Hyper-V virtual switches - go to Hyper-V > Virtual switch manager Remove all virtual switches

3) Run XdeCleanup.exe - In my case: "C:\Program Files (x86)\Microsoft XDE\10.0.10240.0"

3 bis) Deactivate all but one of your network interface

4) Launch Android emulator for VS with administrator privileges

5) Activate your network interfaces back

I solved the problem simply by running the VS Android Emulator as an admin.

Running Visual Studio as an admin also solved instant crashes that I had on every start.

I had the same problem to solve it I followed the different step as recommended but nothing, and at the end I simply copied the name of the emulator appears in error message in the log file and following the path to open the .cfg C:\Users\lacike\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\5_KitKat_(4.4)_XXHDPI_Phone and paste this name before

I had the same problem after installing Android Studio.

Android Studio needs "bcdedit /set hypervisorlaunchtype off"

Visual Studio Emulator for Android needs "bcdedit /set hypervisorlaunchtype auto"

Because of that, I switch to "off" or "auto" and reboot my system.

Thanks it solved my problem of getting the message n error occured while creating "VS Emulator 5" KitKat (4.4) XXHDPI Phone' device I tried all other solutions in this thread but yours was the only one that worked – devc2

I had hard times setting this up, but after a couple of days of R&D and trying with other people answers I could got this done. Hurray!!!

1) Issue 1: My Visual Studio 2015 Community Edition was halting at 'Preparing virtual machine'. Solution: - After analysis I saw that in my VS -> Tools -> Android -> Android Emulator Manager, my AVD (AVD_GalaxyNexus_ToolsForApacheCordova) was showing a res cross(x). - I corrected this by installing this. This is because my emulator device is: VS Emulator 5-inch KitKat (4.4) XXHDPI Phone for API-19. enter image description here

2) Issue 2: It passed the 'Preparing virtual machine' step, but I faces numerous network creation issue. Solution: This was resolved under the following situation. The emulator always created the virtual switch using my ethernet while I was connected by wifi. So, I switched to a LAN cable provided internet and temporarily disabled my wifi.

Then it was a success. I needed to do the steps mentioned by Ladislav Margai several times in between.

I hope it might help others.

I had this problem, removal of virtual switches in Hyper V was not enough. To resolve it I needed to turn off and then turned back on Hyper V itself.

I did this and my problem was fixed

  • Start cmd.exe with Admin rights and type

  • bcdedit /set hypervisorlaunchtype auto

  • Restart pc.

  • run as administrator visual studio.

Good luck!

I tried a bunch of the steps here and they didn't work, so I stepped through this in-depth troubleshooter from Microsoft and found the problem.

In my case, while Hyper-V had been installed, the Hyper-V Hypervisor (under Hyper-V Platform) had not been installed.

I installed it, re-started, and suddenly the issue was resolved. Can't believe I overlooked it - but maybe someone else has overlooked it too and this helps! :D

Not the answer you're looking for? Browse other questions tagged or ask your own question.