Virtual Switch Manager can be used in different scenarios according to your network topology. However, you can apply two different methods for the virtual machine Internet connection. You can use the following two methods for the Internet connection.
Adding both Internal and External Virtual Switch to the virtual machine.
In this article, the solution we will use to connect the virtual computer to the Internet is the 2nd method.
How to Create Internal and External Virtual Switch on Hyper-V
Follow the steps below in order for the virtual machine Internet settings.
Run the Hyper-V Manager virtualization program.
Click the Virtual Switch Manager from the Actions panel.
First, add the Internal Virtual Switch to the virtual machine.
Name the Internal Virtual Key and then click the OK button.
For example, to add a network adapter for the Windows 7 virtual machine, right-click on the virtual machine and select the Internal Virtual Switch created by clicking the Network Adapter in the left panel of the pop-up window and click OK.
Connect and run the Windows 7 virtual machine.
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.
Configure the TCP/IP settings of the Windows 7 VM as shown in the image below.
Pinging from the virtual machine to the default gateway (192.168.10.1) will succeed as follows.
From Step 1 to Step 9, we actually configured an Internal Virtual Switch. The reason for this is to show 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 in the same way and select External as below and click Create Virtual Switch.
Type a name for the External Virtual Switch and also fill in the description. When adding an external network, you must select the network card of your physical machine connected to the Internet.
Open the Windows 7 machine network settings again and add a new Network Adapter by clicking Add Hardware as follows.
Add the External Virtual Switch that you created to the virtual machine.
Check the virtual machine network settings. It needs to get an IP address from our local network as in the image below. If it does not obtain an automatic IP address, you may need to check your DHCP settings.
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.
Finally, you can check the VM Internet connection by viewing any website by opening an Internet browser from the virtual machine.
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 also subscribe to our YouTube channel to support us!
In this article, we examine step by step how to configure a virtual machine Internet connection on Windows 10 operating system using Microsoft virtualization program. Thanks for following us!