How to Connect Hyper-v Machines to Internet?
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 knows the basic of 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.
- To install Hyper-V: Hyper-v Beginner: A Practical Guide to Virtualization. This post show you how to install Hyper-v on Windows client 8.1, 10 and Windows Server 2012 R2.
- To configure the essential Hyper-V settings: Essential Hyper-V Configuration. Shows the configuration of Hyper-v for beginner to create a virtualization testing Lab.
The virtual switch is a logical switch which connect virtual machines together. 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 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.
1. Connect Hyper-v Machines to Internet Using External vSwitch
Create and external virtual switch in Hyper-v and then link it to the physical host network card. In order to create virtual switches, open Hyper-v Manager then click Action and click Virtual Switches Manager.
From Virtual Switch Manager window, select External virtual switch and click Create Virtual Switch.
Type a name for this virtual switch and select the exact physical network card which currently connect your host to internet then click OK to apply the changes.
Now, to connect a machine to internet just select this external virtual switch as network adapter of the virtual machines. Let’s test on a Windows 10 Pro.
Open a virtual machine then click File and click Settings then select network adapter. From right side select the external virtual switch as virtual switch to connect hyper-v machines to internet.
The virtual machine is successfully connected to the internet through external virtual switch.
2. Connect Hyper-v Machines to Internet Using ICS
Internet Connection Sharing (ICS) is another best practice to connect Hyper-v Machines to 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 internet. Let’s do it.
The process is the same as creating 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 on Host Machine
Type “ncpa.cpl” to Windows Run and press enter to go to network connections of you host machine. Then right click the Ethernet connection which is connected to internet the click Properties.
On the Ethernet Properties page click Sharing tab then tick the check box of Allow other network user to connect through this computer’s internet connection then click OK to apply the changes.
Now for your virtual machines you should choose Internal vSwitch as virtual switch in order to connect them to internet.
Yes 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 internet.
OK, that’s all. Hope you enjoy this Virtualization related article to Hyper-v Beginner. If you have any question, please ask through comment.