Ubuntu not connecting to network in Hyper-V

What appears to have been the problem is that the bridging protocol was not supported by the AP (access points) of my university.

Here is the workaround (as far as I can tell this way is more robust than the bridging way that is done by default, but there might be some additional overhead (not sure how much)):

  1. Create an internal network switch
  2. Connect it to the guest OS
  3. Connect the internal virtual adapter to the virtual adapter created by Hyper-V like so: enter image description here.
    Go to the adapter that provides internet access to the machine, and then click sharing. Select the adapter created in step 1.
  4. Everything should work well.

Credit for this solution goes to the networking people at Binghamton University, more specifically Joe and Alan.


I had the same problem. I was using my laptop which only has a wireless connection. No build in Ethernet card.

The system is windows server 2012 standard. I was trying to use hyper-v to install ubuntu 12.04 lts. I got the same issue. Ubuntu wont be able to access the internet, the network keeps connecting and disconnected.

So, i followed "Joe and Alan" 's approach. It works.

But I want to find why the external virtual switch wont work.

After i read through this blog,

Bringing Hyper-V to “Windows 8”

I found the issue and maybe a better solution.

for hyper-v, if the external virtual switch is on top of a wireless NIC, hyper-v used the Microsoft bridge in between to do the MAC translation. Because one wireless channel is bound with one MAC. Read the full article if you really want to understand.

Now, based on the information of that article, I can easily conclude that, there will be two IP addresses for that same MAC of the physical NIC if you look at the server from outside.

Of course the two IP addresses are assigned to two different virtual NIC with different MAC address if you look inside. But those two MAC are hidden behind the bridge and are not visual from outside.

The first IP will be used by host OS ( windows server 2012 in my case). That one has no problem because the DHCP server assign one when the machine boots up.

The issue comes with the second IP address, when you boot up the virtual machine, (ubuntu in my case), the virtual machine will try to get the IP address from DHCP server but it will fail. Most DHCP server, at least the router I have in my home, wont assign two different IP addresses to the same MAC. It probably give the same IP address back upon the virtual machine's DHCP request, but, it wont work because we can not use the same IP address to two machines. If some one can capture the packets of the DHCP might find the detail of the issue.

here some more information on DHCP

I am not sure if any DHCP server can provides two IP to one MAC. Based on @soandos 's description , seems yes.

Now, we know the real issue is that the virtual machine can not get the ip address assigned.

So, what's the solution?

The easiest one is just assign a static IP address in the virtual machine. After you boot up the virtual machine, you can assign a static IP address to that virtual machine. That works for me perfectly because i use my laptop at home only .

But in some situation, for example in a public wifi, you probably can not do this (safely).