No internet connection for Visual Studio Android Emulator

29,163

Solution 1

It looks like Android is unable to acquire an IP address from DHCP.

In Hyper-V Manager (virtmgmt.msc), select the VM for the emulator profile you are trying to start and go to its Settings... (right click for context menu or see action pane on right side).

Under Hardware, make sure there are two virtual switches:

  1. Emulator Internal Network Adapter
  2. Emulator External Network Adapter

Emulator External Network Adapter must be listed as the second adapter -- the order matters. If they are ordered incorrectly, delete the External adapter and recreate it, giving it the same settings it had before. You can create it by clicking Add Hardware in the VM's hardware list.

Hyper-V Manager - VM Settings

Solution 2

I fixed it by setting the second network adapter to Default switch and not the physical network adapterScreen Grab.

Solution 3

Thought this might help someone out there. Mine had an internet connection, but suddenly it stopped connecting. I resolved it by restarting my emulator with factory settings. enter image description here

Share:
29,163
Blendester
Author by

Blendester

Updated on July 20, 2021

Comments

  • Blendester
    Blendester almost 3 years

    I'm using Android Emulator that comes with Visual Studio 2015. When I run it, in Wi-Fi settings of Android this status appears Obtaining IP Address.. for Wired eth1 network. But it fails after a long time.


    What I've tried:

    • Removed all the virtual switches in Virtual Switch Manager of Hyper-V before running the emulator.
    • Unchecked automatic detect settings in proxy settings
    • Tried different API levels (19,22,..)
    • Windows Phone Emulator doesn't have this problem and has internet connection.
    • Restarted my PC!

    What I guess:

    When I diagnose vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch) it says it has an invalid IP address. Also inside android emulator it tries to obtain an IP. Obviously I need to give the emulator a valid IP, but I don't know how or where or what value.

    How to give the Android emulator internet access? Thanks in advance.