44

I have Windows 8 installed inside of an emulator, and the new WP8 SDK installed on it. My problem is that the emulator can't connect to the internet. I don't have any proxy, and even disabled the firewall. It still doesn't seem to work though. When I look at the Network Connections sections I can see the new connections the hyper-v manager created for the emulator, and also the automatic bridge created, but even there the network status is "No Internet Connection".

Are there some properties I can manually change in Hyper-V or for the network to make everything work?

Update: I've done everything suggested including create my own switch and delete all others. It still doesn't work however. It doesn't work on cable and not on wifi. Maybe I'm missing something with how to set this up?

Also the WP emulator keeps offering me to connect to the internet every time. It always erases all of the definitions I've set up, replacing it with it's own definitions.

Earlz
  • 62,085
  • 98
  • 303
  • 499
CodingChick
  • 483
  • 1
  • 4
  • 7
  • See http://stackoverflow.com/questions/13149509/windows-phone-8-emulator-error-something-happened-while-creating-a-switch and http://stackoverflow.com/questions/13148828/windows-phone-8-unable-to-create-the-virtual-machine – Claus Jørgensen Oct 31 '12 at 15:16
  • I already tried these things, when starting the emulator is asked "do you want to connect to the internet?" I pressed yes, but... no. – CodingChick Oct 31 '12 at 16:07
  • 5
    Why was this question closed? The questions @ClausJørgensen linked to have nothing to do with this problem. and how is this off topic? Last I checked the FAQ includes "programming tools" – Earlz Nov 01 '12 at 18:23
  • Actually the links have *everything* to do with the problem. Same as my comment about not using WiFi. – Claus Jørgensen Nov 01 '12 at 18:35
  • 2
    @ClausJørgensen Well, I have that problem, except for no error messages, just the emulator can't connect to the internet. Neither of those questions has an answer which even sounds close and I've tried it all and no success so far. And WiFi is disabled. – Earlz Nov 01 '12 at 18:47
  • I'm not sure why this was closed. My solution was much easier. In case someone reads this, go to your network and sharing center in the control panel. Click on the Change Adaptor Settings (left panel). I noticed I had a bridge connection on my wireless network. I right-clicked on the wireless connection adaptor and removed the bridge. The browser loaded in the background, and I was back up an running. Hope someone finds this helpful. – Rogala Apr 05 '15 at 13:25

14 Answers14

27

I think I've finally found the answer, but you're probably not going to like it. It would appear that the phone emulator requires you to have a second network adapter to dedicate to this purpose. Personally, I run Windows 8 in VMWare, and so a second network adapter is free for me.

Anyway, after you get the second network adapter that you can dedicate for the phone emulator(must have internet)

  1. Start from scratch. Go to the Hyper-V manager and delete the emulator along with all of the virtual switches
  2. Start the emulator from Visual Studio; this will recreate it with all default settings(select yes you want to configure it to connect to the internet)
  3. Shut it down
  4. Now, go back to the Hyper-V manager
  5. Delete the snapshot that was just created for the emulator. This will prevent your changes from disappearing
  6. Find the virtual switch for your second network adapter in the Network Adapter settings(under control panel)
  7. Disable TCP/IPv4, 6 and all other services. This prevents your host machine from trying to use the connection. While you're there, get the MAC(Physical) address of this adapter
  8. Find the virtual-switch for your second network adapter under the Hyper-V settings for the emulator
  9. Change the MAC type to static and paste in the MAC address of the adapter
  10. Enable MAC spoofing (not sure if required, but just in case)
  11. Then, find your virtual switch under "Virtual Switch Manager".
  12. Ensure "Allow management operating system to share this network adapter" is unchecked and that all extensions are disabled
  13. Click OK and then start the emulator from Visual Studio!

Basically, it appears that for some odd reason it won't properly work unless the phone has the same MAC address as the network adapter. However, we can't just set it to use the same MAC address because address conflicts are very very bad. So, we need a second adapter that we can dedicate to the Phone emulator. The reason we disable TCP/IP on this adapter is so our host machine doesn't use it and cause these conflicts.

Other things to try:

The emulator keeps randomly breaking for me. I'll list a few other things I messed with this last time that got it to work(not sure if related, so only try these if the steps above aren't working

  • "Reordering" of network adapters for the emulator so that the external virtual switch is at the top (make sure to copy over the MAC address for the internal adapter)
  • Removing unrelated network adapters
  • Restarting your machine after recongiguring virtual switches
  • Praying to your local Microsoft evangilist

Seriously. Everytime I stop phone work for a while and come back, the emulator is always magically broken without me changing anything. No idea how to get it to work "permanently".

Earlz
  • 62,085
  • 98
  • 303
  • 499
  • [Would the Loopback Adapter work?](http://stackoverflow.com/questions/47854/how-do-you-create-a-virtual-network-interface-on-windows) – user7116 Nov 02 '12 at 15:43
  • @sixlettervariables It might, actually! You'd probably have to create that, and then bridge the loopback adapter with the external interface. I'm not for sure it'd work, but worth a shot – Earlz Nov 02 '12 at 15:47
  • @Earlz At Step 2, the emulator starts and I get a popup that says "Do you want to configure the emulator to connect to the Internet." Do I select Yes or No? – Lisa Nov 08 '12 at 06:17
  • 1
    @Lisa you select "yes". This will restore the default configuration to the virtual switches, otherwise, the virtual switches won't be created and you'll have a lot of problems – Earlz Nov 08 '12 at 06:44
  • Ironically enough, now that I've had to return to doing a bit of phone development, this process no longer works for me. Ughhh – Earlz Nov 28 '12 at 20:14
  • 3
    I cannot emphasize how important is this answer here. After 2 days trying to figure it out, this thing finally worked for me. Just some details: The virtual switch referred here is the "external" one. That means that after doing these steps, the virtual switch will disappear from Windows control panel, and the emulator will control it. Also removing your MAC address from the router list might help it out. Another thing that I want to point out: MSDN forums SUCK. All the documentation they've sent me was already clicked/seen by me, and they cannot think outside the box. Thanks stackoverflow!;D – José Leal Mar 11 '13 at 09:59
  • Thanks for this solution, it worked for me. I just don't understand Step7. Where should I do this? Which adapter should I do this with? I have the expected operation: I have internet either on WP Emulator or on host, never on both at the same time. After shutting down the Emulator, the host internet works. Could you, or someone help me with this? – Lgn Apr 23 '13 at 14:29
  • This was the only solution that worked for me (Windows 8 inside a Parallels for Mac virtual machine). Added two Network Adapters to the Parallels VM, both connected to the Default Adapter. – o_o Oct 04 '13 at 13:56
  • This solved it for me, I think the problem was that when I first tried it I was not running VS as an admin and it prompted me to elevate to build the VM and after that it never asked me about configuring for internet. The VM was left in some kind of a bad state. – justin.m.chase Nov 16 '13 at 18:20
  • @Earlz - could you add screenshots, finding it hard to follow, get lost on step 7 – chobo2 Nov 23 '13 at 01:13
24

I had the same issue as well. However as someone else pointed out on the official forums it didn't work if you had a static IP for your PC set up in your router. Removing it and let the DHCP assign my PC an IP solved the issue for me.

Source

Amit Singh
  • 2,698
  • 21
  • 49
robertk
  • 2,461
  • 1
  • 27
  • 39
  • Yes! That was that finally fixed the problem for me I used a wi-fi router that could give the emulator its own ip, problem solved – CodingChick Nov 07 '12 at 19:28
  • I saw this in the [System Requirements](https://msdn.microsoft.com/en-us/library/mt228280.aspx) documentation for the emulator, but the strange thing is that in my environment I could access the internet with a static IP (as said in this [SO answer](http://stackoverflow.com/a/43615819/2160765)). – Rosberg Linhares Apr 25 '17 at 18:22
7

Here's what worked for me:

  1. Go into the internal network connection created by hyper-v in network connections on the host computer. Go to TCP/IP V4 and go to advanced. Change the metric from automatic to 10.
  2. Go to the external network connection, do the same but set the metric to 1.

Volia, internet in the emulator.

James Hancock
  • 3,348
  • 5
  • 34
  • 59
6

I tried following steps , Not sure if it will work for you

1> Delete All emulators in Hyper-v
2> Remove all virtual switches from virtual switch manager
3> Go to Network connections in control panel and manually disable (right click and click disable) all the connection except the one which provides internet.
4> Start the emulator from Visual studio

samywat
  • 61
  • 1
  • This works for hosts that have more than one physical network adapter. I couldn't figure out why it would work the first time I deleted all of the virtual switches and recreated the VM, but wouldn't work afterwards. This answer works in that scenario. – JD Courtoy Feb 16 '13 at 05:01
2

Something else that seems to also cause an issue is Fiddler.

I had Fiddler open and running (as I was monitoring other HTTP requests), and it was stopping the emulator from connecting.

As soon as I closed Fiddler, the emulator starting connecting perfectly.

Alastair Pitts
  • 19,423
  • 9
  • 68
  • 97
2
  1. Start Hyper-V Manager
  2. Open Virtual Switch Manager
  3. Remove the Windows Phone Emulator Internal Switch from the list and apply changes
Petr Voborník
  • 1,249
  • 1
  • 14
  • 11
1

I went through many of the suggested solutions, also with no luck. What finally worked for me was to fix a vmware warning about guest OS trying to set promiscuous mode for ethernet adapter (http://kb.vmware.com/kb/287).

jmalmari
  • 139
  • 1
  • 4
1

After installing Windows Phone Emulator on my Yoga laptop, I immediately had the following problems:

  • emulator apps cannot reach the internet
  • host computer internet connection is terribly slow and almost unusable

I was discouraged and thought I would have to do some drastic and desperate acts to fix things, but got lucky with the following steps which completely solved my problems (for now). The steps are verbose (intended for the readers' benefit), but are actually very simple in practice.

....0: Unplugged ethernet cable (to remove it from the equation) but stayed connected to WiFi. Problems still remain but at least there is less complexity now.

....1: In Control Panel / Network Connections / Change Adapter Settings, deleted Network Bridge (required for Step 2 to work).

....2: Opened Hyper-V Manager, right-clicked on the emulator VM item and selected Virtual Switch Manager. Selected "Windows Phone Emulator Internal Switch" and changed the radio button from Internal to External (this was only possible after deleting the Network Bridge (Step 1)).

At this point, the emulator can now connect to the internet (and Control Panel shows WPEIS finally 'has internet access'); however deployment of WP build binary from VS to emulator fails - it just hangs when I try to build-and-deploy from Visual Studio (so a new problem has surfaced (temporarily)).

....3: Returned to HyperV Manager, went back to Emulator VM's Virtual Switch Manager and reverted Windows Phone Emulator Internal Switch from External back to Internal.

I can now successfully build-and-deploy WP build from Visual Studio to emulator. And emulator retains its networking ability. Also the host machine's network connection also returned to healthy.

I hope this helps someone. Good luck!

Jo Jo
  • 7,245
  • 5
  • 34
  • 49
  • Worked for me. Was glad all the suggestions where in here. I did one thing different. In Virtual Switch Manager I have wireless as external and phone emulator as internal (I actually think that might be the state you ended up in, not sure). Just wanted to add my experience to keep helping people with options. – ToddB Dec 15 '13 at 03:57
0

Try this solution, it works for me (no need of DHCP)

Step 1 - using Hyper-V start the server, once started u can see the two new network adapters added in the (network sharing) page.

Step 2 - go to your visual studio IDE where your application runs, using Emulator run your application, once started try to open IE, it will not connect to internet.

Step 3 - now again come back to network sharing page right click on external adapter which was created newly select properties, hit on sharing tab, now check the two options to have tick mark if not tick that two options and click on OK.

Step 4 - internal adapter which was created newly will be changing the domain name from Unidentified network to your shared Domain name, once changed try to access the IE again in emulator which runs already. now i hope the internet connection works.

Thanks,

Baskar

0

After spending about 3 days on this i finally got it working. (on Windows 8 using WiFi)

  1. Start Fresh, Remove HyperV, Restart, Install Hyper V, Restart
  2. Open your VS solution and run the emulator.
  3. When prompted for letting the emulator access the internet say yes.
  4. Let the emulator and your project fully load
  5. Shut down the emulator and VS
  6. Open Network and Sharing Centre
  7. Click change Adapter Settings (on the left hand side)
  8. You should have some new adapter created by HyperV, they should be called "vEthernet(...)"
  9. The ones you are interested in are the vEthernet( Virtual Switch) and vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)
  10. Open the properties on your vEthernet( Virtual Switch) and navigate to the sharing tab.
  11. Choose Allow other Network users to connect and choose the vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch) as the adapter
  12. Ok the changes, and then open the properties on vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)
  13. Disable Internet Protocol Version 6 and double click on Internet Protocol Version 4
  14. Use the following IP address: 169.254.169.177 Subnet mask:255.255.0.0
  15. Click advanced, under the IP settings tab, assign an interface metric: 1
  16. Open VS and re run your project under and emulator, wait a few minutes for it to load.
  17. Try and open IE within the emulator and confirm you have internet access.

Good luck

Lukie
  • 905
  • 1
  • 11
  • 21
0

After 3 days we have finally solved it. We had to make ip address dynamic. After making it dynamic emulator could reach internet. We didn't have to change anything else.

0

Good article: http://blogs.msdn.com/b/wsdevsol/archive/2013/10/01/why-can-t-the-windows-phone-emulator-go-online.aspx

I had DHCP reservation on my router, like @robertftw said. I configured a static IP for vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch) adapter and everything works.

Der_Meister
  • 4,771
  • 2
  • 46
  • 53
0

Disabling the Wifi, and Virtual Wifi inside "Network Connections" worked for me.

Quincy
  • 1,710
  • 14
  • 20
0

My Windows Phone emulator had been assigned an IP address by DHCP on a different Subnet to the one I am using.

Manually assigning an IP address on the same subnet as my PC to the vEthernet port created by Hyper-V resolved this issue.

JMK
  • 27,273
  • 52
  • 163
  • 280