How do I setup a working Wifi/Internet connection on Windows 10 hyper-v?

14,012

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!

Share:
14,012

Related videos on Youtube

Ceesiebird
Author by

Ceesiebird

I am a software tester with a love for tech and code. Eager to learn and eager to help where I can. Automate the world! :)

Updated on September 18, 2022

Comments

  • Ceesiebird
    Ceesiebird over 1 year

    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?

    • lx07
      lx07 about 5 years
      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'
    • Ceesiebird
      Ceesiebird about 5 years
      Thanks for your suggestion, I tried it. But sadly it has not worked for me.
    • essjae
      essjae about 5 years
      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?
  • 2one
    2one about 4 years
    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...