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:
Created an internal virtual switch under Hyper-V.
- Open "Hyper V Manager"
- Select "Virtual Switch Manager"
- Under New Virtual Switch, select "Internal"
- Select "Create Virtual Switch"
Shutdown the Ubuntu VM
Add a legacy adapter with the internal virtual switch that was just created in step 1.
Open "Network and Sharing Center"
Select "Change Adapter Settings".
Select your Wifi Adapter and the Virtual Switch you just made, right click menu option "Create Bridge"
Start the Ubuntu VM
Login to Ubuntu
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 :)
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
Open Network and Sharing Center and select Change Adapter Settings
- Take your virtual switch vEthernet adapter out of the bridge (if bridged)
- Go to properties of the virtual switch
- You will found option Internet Protocol Version 4 (TCP/IPv4) under list box
- Go to Properties of IPv4 option. It will open another dialog box
- Go to Alternate Configuration tab
- Select User configured option
- 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.
- Put address noted at step 1-c in field Subnet Mask
- Put address noted at step 1-d in field Default gateway
- Put address noted at step 1-b in field Preferred DNS server
- You can leave the other fields
- Click OK and come out of IPv4 properties and vEthernet properties dialog boxes.
- Bridge it again (if you removed it earlier)
- Log into the Ubuntu hyper-v machine
- Go to Network via Unity
- 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)
- Click-on Options button that will open dialog box
- Go to IPv4 Settings tab
- Select Method as Manual
- Put IP Address that you have configured in virtual switch (vEthernet) adapter. As per example it should be 192.168.0.135.
- Put subnet mask (step 1-c) & default gateway (step 1-d) under Netmask and Gateway field respectively.
- Put DNS Server IP Address in DNS servers field.
- Check Require IPv4 addressing..... option
- Save and close the dialog boxes
- 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.