How to configure the Network in Hyper-V Virtual Machine in Windows 2012 Server

This post aims to show the network configuration for communication between Hyper-V Virtual Machines in Windows 2012 Server.

Test environment for this Tutorial

  • Windows Server 2012 R2
  • Hyper-V

1 – Network adapter (Switch) configuration for Hyper-V

Objective: Configure a Network adapter (Switch) to connect the Hyper-V Virtual Machine with the external network (Internet), the HOST and between the HOST Virtual Machines.

  1. Open Hyper-V Manager
  2. Select the HOST
  3. on the tab "Actions", click on the option “Virtual Switch Manager…”

Gerenciador do Hyper-V

 

  1. In the settings of the  “Virtual Switch Manager…”
  2. Select option "New Virtual Network Switch"
  3. Select option "External".
    This type of Switch uses the server's physical network card to create a “SWITCH” that will allow you to configure the network on Hyper-V Virtual Machines.
  4. Click on the option "Create Virtual Switch"

Gerenciador de Comutador Virtual Hyper-V 1

 

  1. Still in the settings of the  “Virtual Switch Manager…”
  2. define a "Name" for the Virtual Switch. In this example I define with INTERNET.
  3. Choose option "External Network"
  4. Choose the Network card which will serve as a Switch.
  5. Enable the option "Allow management operating system to share this network adapter"
    This option allows this switch to be used by the Virtual Machines and the Host.

click in OK to create the switch

Gerenciador de Comutador Virtual Hyper-V 2

 

2 – Defining Fixed IP for HOST Hyper-V

Once the “Configuration of Network Adapter (Switch) for Hyper-V” is complete, note that the new adapter will be created in "Network connections" of Windows.

O "Ethernet 2" is the physical network card installed on the machine. Once the Switch was created, a board "vEthernet (INTERNET)" has been added. If you have to define a fixed IP in the HOST, this IP must be configured in the new adapter that was created, in this case the "vEthernet (INTERNET)". See the image below.

Configurações Adaptador de Rede Comutador Hyper-V

 

 

3 – Configuring Network Card in Hyper-V Virtual Machine

  1. At the "Hyper-V Manager"
  2. Select the HOST
  3. Select Hyper-V Virtual Machine in "Virtual Machines"
  4. on the tab "Actions" of the Virtual Machine, click on "Settings".
    NOTE:
    The Virtual Machine must be turned off or restarted for the settings to apply.

Gerenciador do Hyper-V Maquina Virtual

 

  1.  In "Settings" of the Virtual Machine
  2. Click on Option "Add Hardware"
  3. Select Option "Network Adapter"
  4. click in "To add"

Configurações de Rede Hyper-V 1

 

 

  1. Still in "Settings" of the Virtual Machine
  2. Select the Virtual Switch that was created. In that case "INTERNET".
  3. click in "OK" to add Network Adapter on Hyper-V Virtual Machine

Configurações de Rede Hyper-V 2

 

4 – Setting Fixed IP on Hyper-V Virtual Machine

Power on your virtual machine, and open the "Network connections". Please note that there is a network adapter available. Open adapter properties and configure fixed IP in Virtual Machine.

NOTE: Check on a common machine that the IP information is valid and correct.

Configurações Rede Maquina Virtual Hyper-V 1

 

 

After configuring the Network in Hyper-V:

  • Virtual Machines will be able to communicate with each other
  • The Virtual Machines will be able to communicate with the HOST and the HOST with the Machines
  • Virtual Machines will be able to access the Internet
  • Virtual Machines can be accessed Remotely by a machine on the network
  • Virtual Machines will be able to remotely access any machine on the network

 

 

Solving Connection Problems

  1. check on "Remote Settings"
  2. If the option "Allow remote connections to this computer" is enabled.

Configurações Remotas do Windows 1

 

 

  1. Access server settings "sconfig"
  2. Choose the Option 4
  3. In "Configure Remote Management" make sure "Remote Management" is enabled (Option 1), and if “Configure Server Response for Ping” is Enabled (Option 3).

Configurações Remotas do Windows 2

 

Sometimes connection problems are related to Windows Firewall.

  1. find "Firewall" Windows
  2. Open it “Windows Firewall with Advanced Security”
  3. click in “Windows Firewall Properties”
  4. In "Domain Profile", "Private Profile" and "Public Profile", check if the "Incoming Connections" are "Blocked" or "Allowed".

Firewall do Windows 1

 12,266 Total Visualizações,  6 Visualizações Hoje

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.