4

I have set up a Ubuntu 18.04 instance in Hyper-V. But I don't have any internet connection withing my VM.

I am working on a laptop, connected with Wifi.

I have tried the following.

  1. Created an internal virtual switch under Hyper-V.
  2. Open "Hyper V Manager"
  3. Select "Virtual Switch Manager"
  4. Under New Virtual Switch, select "Internal"
  5. Select "Create Virtual Switch"
  6. Shutdown the Ubuntu VM
  7. In your VM settings, under "Network adapters" add the virtual switch which you created in step 1
  8. Open "Network and Sharing Center"
  9. Select "Change Adapter Settings".
  10. Select your Wifi Adapter and the Virtual Switch you just made, right click menu option "Create Bridge"
  11. Start the Ubuntu VM
  12. Login to Ubuntu
  13. Wait a minute, the connection should connect..

But it still won't connect.

I have also enabled the MS services:

Routing and Remote Access + Internet Connection Sharing

But still no luck.

How do I get to a working Internet connection over wifi on my VM?

3
  • Try an external switch and pick your Wi-Fi adapter. Internal switch is for "communication between virtual machines" while external "Gives virtual machines access to a physical network to communicate with servers and clients on an external network'
    – lx07
    Commented Feb 7, 2019 at 11:16
  • Thanks for your suggestion, I tried it. But sadly it has not worked for me.
    – Ceesiebird
    Commented Feb 8, 2019 at 15:50
  • Can you update your question to include your network environment? Do you get IPs from DHCP? From an internal router, from your ISP? What version of Windows 10 do you have, run "winver" to find out. When you say "it has not worked," can you add details? Did you remove the bridge, RRAS and/or ICS when you were using the default switch?
    – essjae
    Commented Feb 8, 2019 at 23:03

1 Answer 1

4

I had to share my host network adapter and made virtual network switch External. Details are.

  1. Open Hyper-V Manager
  2. Click "Virtual Switch Manager"
  3. Click "New virtual network switch"
  4. Name: NAT, Connection type: "External network", Select the correct network adapter. Tick "Allow management operating system to share this network adapter. See pic 1.
  5. Right click Ubuntu, select "Settings"
  6. In Network Adapter, Virtual switch, select "NAT"
  7. Go to "Control Panel > Network and Internet > Network Connections" in Windows 10
  8. Right click the network adapter that is in use. For me, it is "Ethernet 2"
  9. "Properties > Sharing", tick "Allow other network users to connect through this computer's Internet connection" and select "vEthernet (NAT)" in the drop down.
  10. Tick "Allow other network users to control or disable the shared Internet connection", then OK. See pic 2.
  11. Start Ubuntu virtual machine and test!

Hope this works for you too!

1
  • When I do step 10, should this be performed on the vEthernet adapter (i.e. HyperV adapter setup in step 4)? At step 10 I also get a prompt saying "your LAN adapter will be set to use IP address 192.168.137.1)"I don't think I want my IP to change...
    – 2one
    Commented Feb 7, 2020 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .