In Hyper-v you can connect Hyper-v machines to Internet with two methods that I’m going to explain all step by step. This article is for those, who know the basic of Server Virtualization with Hyper-v. If you don’t know about Hyper-v Virtualization software, I recommend you to read the previews articles of Hyper-V installation and configuration posts.
- Install Hyper-V: Hyper-v Beginner: A Practical Guide to Virtualization. This post shows you how to install Hyper-v on Windows client 8.1, 10 and Windows Server 2012 and Windows Server 2016.
- Configure the necessary Hyper-V settings: Essential Hyper-V Configuration. Explain the configuration of Hyper-v for beginner to create a virtualization testing Lab.
Hyper-v Virtual Switches
The virtual switch is a logical switch which connects virtual machines. Currently, Hyper-v has three different types of virtual switch which I told the preview article also.
- External: Switch is used to connect the virtual machines to external network and Internet. The virtual machines (Guest) and Host will be on the same network.
- Internal: Switch is used to create network connection between guest machines and the host.
- Private: The private switch is used to create network connection between virtual machines only.
Connect Hyper-v Machines to Internet Using External vSwitch
1. Create an external virtual switch in Hyper-v and then link it to the physical host network card. To create a virtual switch, open Hyper-v Manager then clicks Action and click Virtual Switches Manager.
2. From Virtual Switch Manager, select External virtual switch and click Create Virtual Switch.
3. Type a name for this virtual switch and select the exact physical network card which currently connects your host to the internet then click OK to apply the changes.
4. Now, to connect a virtual machine to the internet just select this external virtual switch as network adapter of the virtual machine. Let’s test it on a Windows 10 Pro.
5. Run a virtual machine then click File and click Settings then select Network Adapter from Virtual Machine Settings. From right side select the external virtual switch as the virtual switch to connect hyper-v machines to internet.
The virtual machine is successfully connected to the internet through the external virtual switch.
Connect Hyper-v Machines to Internet Using ICS
The second method is using Internet Connection Sharing (ICS). ICS is another best practice to connect Hyper-v Machines to the internet. But in this method, you must share the original internet connection for virtual machines. So with ICS, you can connect your all private network machines to the internet. Let’s do it.
The process is the same as creating an external virtual switch. Open the Virtual Switch Manager and create a new one. Only select Internal instead of external the click OK to create the Internal virtual switch.
Enable ICS to Host Machine
1. Type “ncpa.cpl” to Windows Run and press enter to go to network connections of your host machine. Then right-click the Ethernet connection which is connected to the internet then click Properties.
2. On the Ethernet Properties page click Sharing tab then tick the checkbox of Allow other network users to connect through this computer’s internet connection then click OK to apply the changes.
3. Now for your virtual machines, you should choose Internal vSwitch as a virtual switch to connect them to the internet.
Yes, it works fine.
In the environment where your internet connection is a Wi-Fi connection, you can use the second method ICS to connect Hyper-v machines to the internet.
Connect Hyper-V Virtual Machine to Internet – Video
OK, that’s all. Hope you enjoy this Virtualization related article to Hyper-v beginner guide. If you have any questions, please ask us in the comment box. We will help you fix the problems fast and easy.