How to Connect Virtual Machine to Internet in Hyper-V

This article will illustrate the steps for connecting or disconnecting virtual machines operating on the Hyper-V virtualization platform, which is integrated into Windows 10 or Windows 11, from the local network to the Internet. By following this guide, you can effortlessly manage the connectivity of your virtual machines.

How to Connect Virtual Machine to Internet in Hyper-V

How to Connect the VM to the Internet on Hyper-V

After installing a virtual machine on Hyper-V, the initial step is to generate a Network Adapter utilizing the Virtual Switch Manager. Once the Network Adapter is created, you can add this network card to the virtual machine. Doing so lets you establish a network connection for your virtual machine.

Virtual Switch Manager can be used in different scenarios according to your network topology. However, you can apply two other virtual machine Internet connection methods. You can use the following two methods for the Internet connection.

This article supports utilizing the 2nd method to connect the virtual computer to the Internet. By following this way, you can ensure that your virtual computer is correctly connected to the Internet.

How to Create Internal and External Virtual Switch on Hyper-V

Follow the steps below for the virtual machine’s Internet settings.

Step 1

Run the Hyper-V Manager virtualization program.

Hyper-V Manager

Step 2

Click the Virtual Switch Manager from the Actions panel.

Virtual Switch Manager

Step 3

First, add the Internal Virtual Switch to the virtual machine.

Internal / Create Virtual Switch

Step 4

Name the Internal Virtual Key and then click the OK button.

Internal Network

Step 5

To enhance the Windows 7 virtual machine with a network adapter, click on it and select the Internal Virtual Switch that you created by clicking the Network Adapter in the left panel of the pop-up window. Then, confirm your selection by clicking OK. It will add the network adapter to your virtual machine.

Selecting a Network Card for a Virtual Machine

Step 6

Connect and run the Windows 7 virtual machine.

Running the Virtual Machine

Step 7

When opening the virtual machine, configure the TCP/IP configuration of the vEthernet network card created by Hyper-V on your physical computer as follows.

Configuring the Host Computer's Adapter

Step 8

To configure the TCP/IP settings of the Windows 7 VM, refer to the image provided below and follow the steps accordingly. It will ensure that your virtual machine’s TCP/IP settings are appropriately set up.

Configuring the Virtual Computer Adapter

Step 9

Pinging from the virtual machine to the default gateway ( will succeed as follows.

Ping Operation

Step 10

From Step 1 to Step 9, we configured an Internal Virtual Switch. It shows you how to get an Internal VM to the Internet.

In this step, we will add an External Virtual Switch to the Internal VM and bring it to the Internet. Open Virtual Switch Manager similarly, select External as below and click Create Virtual Switch.

Creating a Virtual Switch

Step 11

Type a name for the External Virtual Switch and fill in the description. When adding an external network, you must select the network card of your physical machine connected to the Internet.

External Virtual Switch

Step 12

Open the Windows 7 machine network settings again and add a new Network Adapter by clicking Add Hardware.

Adding Hardware to a Virtual Machine on Hyper-V

Step 13

Add the External Virtual Switch that you created to the virtual machine.

Adding Switch to VM

Step 14

Check the virtual machine network settings. It needs to get an IP address from our local network, as in the image below. You may need to check your DHCP settings if it does not obtain an automatic IP address.

Checking DHCP Settings

Step 15

Run the CMD command prompt on the Windows 7 machine and test the Internet connection by pinging the Modem IP address to the Google DNS server.

Taking the Virtual Machine to the Internet

Step 16

Finally, you can check the VM Internet connection by viewing any website by opening an Internet browser from the virtual machine.

Google Search Engine

How to Configure Internet Settings in Hyper-V ⇒ Video

You can watch the video below to connect a virtual computer to the physical network and subscribe to our YouTube channel to support us!


This article has demonstrated how to configure an Internet connection for a virtual machine on the Windows 10 operating system by utilizing the Microsoft virtualization program. You can successfully establish an Internet connection for your virtual machine through this guide.

Related Articles

How to Install Hyper-V on Windows 10
♦ How to Enable Hyper-V using Powershell
♦ How to Configure Hyper-V using CMD
♦ How to Install Windows 10 in Hyper-V
♦ How to Install Windows 7 in Hyper-V

  1. K 11 April 2019

    I followed the steps but ping fails. I am running hyperventilate in Windows 10 and guest is server 2012 r2.

  2. AaronW 24 March 2020

    I am curious how you would have multiple VMs to the switch while acquiring unique IP addresses from your DHCP/Router to access the internet. I am stumped on this currently.

    • Tolga Bagci 25 March 2020

      Hello, AaronW!

      By simply adding “External Switch” to your VMs in Hyper-V, you can get them all on the Internet. In short, you have to follow after Step 10.

      If you want to try different network scenarios, you must add Internal Switch. For example, you can add 2 NICs to a server and enable the IP Routing service and then connect two different IP blocks ( – with each other.

  3. Bryan Gallardo 8 July 2023

    I’ve created 3 VMs using hyper-V. I made 1 the Domain Controller. Then I added the other 2 as a member on the same domain using “Ncpa.cpl” and “Sysdm.cpl”. In other words, I placed all 3 under same subnet mask. Then I followed these steps; created the External Switch and still have zero internet access. Any clue as to why?

Add a Comment

Your email address will not be published. Required fields are marked *