Unable to connect to internet on hyper v Ubuntu 14.04

I've read a lot of articles about this issues, and many claim to share the internet connection of the wifi adapter to solve the issue. This did not work in my case. What did work for me, and it should answer your question:

  1. Created an internal virtual switch under Hyper-V.

    1. Open "Hyper V Manager"
    2. Select "Virtual Switch Manager"
    3. Under New Virtual Switch, select "Internal"
    4. Select "Create Virtual Switch"
  2. Shutdown the Ubuntu VM

  3. Add a legacy adapter with the internal virtual switch that was just created in step 1.

  4. Open "Network and Sharing Center"

  5. Select "Change Adapter Settings".

  6. Select your Wifi Adapter and the Virtual Switch you just made, right click menu option "Create Bridge"

  7. Start the Ubuntu VM

  8. Login to Ubuntu

  9. Wait a minute, the connection should connect...


After following above steps you should be able to connect but if you are seeing that your host (Windows) and guest (Ubuntu) have the same IP Addresses, you may not be able to connect to the Internet from guest machine:

You can follow steps below to switch to manual IP settings to make it work, as that helped me :)

  1. Run ipconfig /all on windows command prompt and note:

    a) IPv4 Address (may be suffixed as Preferred)

    b) DNS Server IP Address

    c) Subnet Mask

    d) Default Gateway

  2. Open Network and Sharing Center and select Change Adapter Settings

  3. Take your virtual switch vEthernet adapter out of the bridge (if bridged)
  4. Go to properties of the virtual switch
  5. You will found option Internet Protocol Version 4 (TCP/IPv4) under list box
  6. Go to Properties of IPv4 option. It will open another dialog box
  7. Go to Alternate Configuration tab
  8. Select User configured option
  9. You can put an IP address of your choice here. It's easier to change the last portion of IP address (with some higher number) noted at step 1-a and put here. e.g. if my IPv4 IP address at step 1-a is 192.168.0.102, I would put 192.168.0.135 here.
  10. Put address noted at step 1-c in field Subnet Mask
  11. Put address noted at step 1-d in field Default gateway
  12. Put address noted at step 1-b in field Preferred DNS server
  13. You can leave the other fields
  14. Click OK and come out of IPv4 properties and vEthernet properties dialog boxes.
  15. Bridge it again (if you removed it earlier)
  16. Log into the Ubuntu hyper-v machine
  17. Go to Network via Unity
  18. You should see Wired network connected otherwise wait for couple of minutes. (If no wired option is visible there please select Auto Ethernet once from top right desktop menu option)
  19. Click-on Options button that will open dialog box
  20. Go to IPv4 Settings tab
  21. Select Method as Manual
  22. Put IP Address that you have configured in virtual switch (vEthernet) adapter. As per example it should be 192.168.0.135.
  23. Put subnet mask (step 1-c) & default gateway (step 1-d) under Netmask and Gateway field respectively.
  24. Put DNS Server IP Address in DNS servers field.
  25. Check Require IPv4 addressing..... option
  26. Save and close the dialog boxes
  27. This has given a fixed IP Address to your Ubuntu machine. You should be able to ping Default gateway from Ubuntu machine and connect the internet.