Miro
Miro

Reputation: 1806

Visual Studio Emulator for Android - An internal virtual network switch is required for emulated devices to run

Problem

I want to use Visual Studio Emulator for Android but whenever I try to start it it fails.

enter image description here

The final part of the Log is:

27.9.2015. 11:10:38: [Informational] ===== Session Started =====
27.9.2015. 11:10:38: [Informational] Microsoft Windows NT 6.3.9600.0 Windows 8.1 Pro with Media Center
27.9.2015. 11:10:38: [Informational] Virtualization type: UnknownOrNotVirtual
27.9.2015. 11:10:38: [Informational] Virtualization Version: alaska - 1072009
27.9.2015. 11:10:38: [Informational] Virtualization Serial Number: to be filled by o.e.m.
27.9.2015. 11:10:38: [Informational] Virtualization Product: z97-d3h-cf
27.9.2015. 11:10:38: [Informational] Display Adapter 0: Name: NVIDIA GeForce GTX 960, Version: 10.18.13.5362
27.9.2015. 11:10:38: [Informational] Display Adapter 1: Name: Intel(R) HD Graphics 4600, Version: 10.18.14.4170
27.9.2015. 11:10:39: [Informational] Reinitializing installed profiles.
27.9.2015. 11:10:39: [Informational] Installed profiles initialized. Devices: 3 Platforms: 2
27.9.2015. 11:10:39: [Informational] Reinitializing installable profiles.
27.9.2015. 11:10:39: [Informational] Installable profiles initialized. Devices:     30 Platforms: 4
27.9.2015. 11:10:41: [Informational] Waiting to launch device...
27.9.2015. 11:10:41: [Informational] Launching Device: 10.1" Lollipop (5.1.1) XHDPI Tablet
27.9.2015. 11:10:41: [Informational] Validating emulator arguments...
27.9.2015. 11:10:41: [Informational] Determining if emulator is already running...
27.9.2015. 11:10:41: [Informational] Preparing virtual machine...
27.9.2015. 11:10:47: [Critical] An internal virtual network switch is required for emulated devices to run.
27.9.2015. 11:10:47: [Critical] XDE Path: C:\Program Files (x86)\Microsoft XDE\10.0.10240.0\xde.exe
27.9.2015. 11:10:47: [Critical] XDE Arguments: /sku Android /displayName "VS Emulator 10.1\" Lollipop (5.1.1) XHDPI Tablet" /memSize 2048 /diagonalSize 10.1 /video "2560x1600" /vhd "C:\Users\Miro\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\10.1_Lollipop_(5.1.1)_XHDPI_Tablet\image.vhd" /name "VS Emulator 10.1-inch Lollipop (5.1.1) XHDPI Tablet.miro" /noStart /silent
27.9.2015. 11:10:47: [Critical] XDE Exit Code: CouldntCreateInternalSwitch (16)

So far I've tried...

  1. Done all steps from How to enable Hyper-V for the emulator for Windows Phone 8
    • VMX and EPT are enabled - checked with coreinfo.exe
    • SLAT is enabled - checked with CheckSLATStatusOfMachine.exe
    • Disabled Intel VT-d
    • Enabled Hyper-V in Windows features
  2. After all the relevant changes I've unpluged PC from power supply and tried again
  3. Repaired Visual Studio Emulator for Android and run XdeCleanup.exe
  4. Disabled Kaspersky Internet Security (I've read that sometimes security software interfere)
  5. Checked if I'm member of the Hyper-V Administrators group
  6. Successfully created and started new VM directly in Hyper-V Manager (This was just to check could I run any VM)

System info

Comment

I've spent a lot of time to figure out the solution and I've failed. What am I missing?

I saw that for Windows phone sometimes they set their own virtual switch in Hyper-V Manager. Is that something I should also do, and how should it be done?

Edit #1

In the meantime:

  1. I manually added private and internal switch networks (named "Windows Phone Emulator Private Switch" and "Windows Phone Emulator Internal Switch", if naming matters). Restarted afterwards, tried again. Didn't work.
  2. I've noticed that XdeCleanup.exe deletes manually created internal private switch. enter image description here

Edit #2

I've tired method suggested by @John Kemnetz.The emulator environment starts.

enter image description here After selecting Yes this exception is shown. enter image description here

Edit #3 :: Solution ☺ ::

I've came to the second attempt suggested by @John Kemnetz in later answer. These are all the steps:

  1. Opened Device Manager and deleted one and only Intel(R) Ethernet Connection I217-V from Network adapters
  2. Then I couldn't find Network adapters at all, it disappeared so I couldn't reinstall network driver
  3. After I had rebooted machine not only Intel(R) Ethernet Connection I217-V was installed automatically in Network adapters but also Microsoft Hyper-V Network Switch Default Miniport was installed. Something that I saw for the first time. enter image description here
  4. Then I tried the same console entry as in Edit #2. The console didn't started as in Edit #2. Instead I got this. enter image description here Well at least there was no error!
  5. So I ran strait to VS2015, created Cordova app from template and tried to run emulator. After I gave all the requested user privileges it successfully started!
  6. Then I saw under Network adapters two new entries that were created automatically in process. enter image description here

Upvotes: 9

Views: 8736

Answers (5)

freeyxm
freeyxm

Reputation: 1

Visual studio (2015) emulator for android not working - XDE.exe - Exit Code 3

Follow the steps in above URL, it's also doesn't work.

Then I do the steps below, it's work!

  1. Uninstall all net work adapter in device manager, reboot computer.

  2. Open Visual Studio Emulator for Android, click "Uninstall profile" of the device you want to lunch, then click "Install profile" to reinstall it. Now, lunch the device, it should work.

Upvotes: 0

Kasper
Kasper

Reputation: 821

This error took me weeks to finally resolve. The above solutions did not work for me when doing only what was mentioned. Finally I did all of the following which resolved my issue.

  1. Closed all EXD.exe in task manager.
  2. Exported and then deleted all VMs in Hyper-V.
  3. Deleted all Network Switches in Hyper-V (except the default which would not delete).
  4. Deleted my Network Adapters, restarted (it recreated all of them automatically).
  5. Went to Add Remove Program > Selected Microsoft Visual Studio Emulator for Android > Clicked Modify > Clicked Repair.
  6. Ran XdeCleanup.exe in C:\Program Files (x86)\Microsoft XDE\10.0.15063.0.
  7. Went to Network Connections and disabled all unnecessary connections.

Installed the Emulator again and it worked!!!

Upvotes: 0

Dawid
Dawid

Reputation: 1

Upgrade the network adapter drivers (I didn't even need to uninstall it) and restart the computer

Upvotes: -2

John Engel-Kemnetz
John Engel-Kemnetz

Reputation: 2565

Looks like a problem with Hyper-V. You may want to try the following (in order):*

  1. Open Hyper-V Manager, delete all virtual switches via the Virtual Switch Manager, delete all VMs, and reboot. Now, try to restart the emulator.
  2. If that also fails, attempt to upgrade your drivers for the adapter connecting you to the internet (I'm guessing it's a WiFi adapter?). Go to Control Panel > Device Manager and under "Network Adapters" find your WiFi/internet adapter, right click, and uninstall. When done, right click on Network adapters and scan for hardware changes. This will reinstall your adapter. Reboot, then try to start the emulator again.
  3. If that still fails, the last course of action is to run a "repair" on Windows. If there truly is a problem between Hyper-V and your network adapters, this may resolve the issue

*note that #2 was the solution that worked for kr85

Upvotes: 7

John Engel-Kemnetz
John Engel-Kemnetz

Reputation: 2565

In the log file you've got:

27.9.2015. 11:10:47: [Critical] XDE Path: C:\Program Files (x86)\Microsoft XDE\10.0.10240.0\xde.exe
27.9.2015. 11:10:47: [Critical] XDE Arguments: /sku Android /displayName "VS Emulator 10.1\" Lollipop (5.1.1) XHDPI Tablet" /memSize 2048 /diagonalSize 10.1 /video "2560x1600" /vhd "C:\Users\Miro\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\10.1_Lollipop_(5.1.1)_XHDPI_Tablet\image.vhd" /name "VS Emulator 10.1-inch Lollipop (5.1.1) XHDPI Tablet.miro" /noStart /silent

If you run that command manually in Command Prompt, but without the /noStart and /silent flags, it will tell you why it can't create the virtual switch.

Upvotes: 2

Related Questions