Configure Hyper V Virtual Machine With Internet Connection

Share This Article: Share on Facebook0Share on Google+1Tweet about this on TwitterShare on LinkedIn2Pin on Pinterest2Email this to someone

Hyper V is a virtualization technology introduced by Microsoft. Hyper V allows you to run multiple operating systems on a same physical machine. In my previous post, I talked about installing Hyper V in Windows 8 Pro. To configure Hyper V virtual machine with internet connection, all you need is a virtual machine in Hyper V and an internet connection. You can configure internet connection in virtual machine with both physical adapter and wireless adapter. Here, I will show you configuration of internet connection in virtual machine using both adapters.

Configure Hyper V Virtual Machine With Internet Connection

You can configure virtual switch for virtual machine before or after creating the virtual machine. The process of creating virtual machine in server Hyper V and client Hyper V is same. It is always better to create virtual switches before configuring the virtual machine. Virtual switch is a logical switch where virtual machines are connected to. There are three different types of virtual switch: –

  1. External: – This switch is used to connect the virtual machines to external network and Internet. Host and virtual machine will be on same network. If the host have multiple network adapters, then multiple networks can be configured for virtual machines.
  2. Internal: – This switch is used to create network connection between virtual machines and the host only.
  3. Private: – This switch is used to create network connection between virtual machines only.

Wired Internet Connection

Now let’s create virtual switch. This virtual switch will be used for wired Ethernet adapter. Open Hyper V manager. On the actions pane, click virtual switch manager.

vSwitch Manager

Virtual switch manager will open as shown below. Here, select External as type of virtual switch and click create virtual switch button.

Configure Hyper V Virtual Machine With Internet Connection

Properties of new virtual switch is displayed as shown below. Give the name of the virtual switch. Here, I will give My New Virtual Switch. Then, choose the connection type as External network. Then select Realtek controller. This adapter is a wired Ethernet adapter.

Configure Hyper V Virtual Machine With Internet Connection

Now install the virtual machine if you haven’t. I have already installed Server 2012 as virtual machine. Now we have to put this virtual machine on the virtual switch we just created. After installing the virtual machine open the settings of virtual machine. To open the settings, go to actions pane and click settings under virtual machine options. Settings of Server 2012 virtual machine is shown below. Now click network adapter on the left pane under Hardware options. Now on the main window, choose the virtual switch created earlier from the drop down. Then click OK button. It will give you a little warning, click OK.

Configure Hyper V Virtual Machine With Internet Connection

My internet connection is a broadband connection. After connecting to the internet, broadband connection can be seen in the control panel, network connections. Open the properties of broadband connection. Select the sharing tab. Check the first option of ICS (Internet Connection Sharing). Under home networking connections, choose vEthernet (My new virtual switch). Then click OK. Click OK on the warning message and click OK to close the broadband properties.

Properties of Broadband Connection

Now your virtual machine will have internet access. If you have a wireless adapter and a WiFi connection, you can use WiFi connection to setup internet connection for virtual machine as well. Configuration is similar to Ethernet but works differently in the background. So let’s get started.

At first, create a new virtual switch selecting wireless adapter. The process is same that we did earlier. Open Hyper V manager. Click virtual switch manager. Then, choose new virtual network switch on the left pane and choose External as the type and click create virtual switch. Now give the name for the virtual switch. Choose wireless adapter and click OK. My WiFi device is also configured as DHCP server so clients gets IP address automatically.

vSwitch for WiFi

Now open the settings of virtual machine. On the left pane, select network adapter. Now select vSwtich for WiFi as virtual switch and click OK.

WiFi Settings

Now connect your PC to wireless access point. Your PC will get IP address from DHCP server and your virtual machine inside Hyper V will also get different IP address from the same DHCP server. In this way you can use WiFi to connect your virtual machine to the internet.

The following two tabs change content below.
Bipin is a freelance Network and System Engineer with expertise on Cisco, Juniper, Microsoft, VMware, and other technologies. You can hire him on UpWork . Follow Bipin Giri on Google+. Bipin enjoys writing articles and tutorials related to Network technologies. Some of his certifications are, MCSE:Messaging, JNCIP-SEC, JNCIS-ENT, and others.