Windows

Configuring Hyper-V Virtual Switch: Complete Guide

This guide will help you properly configure a Hyper-V network switch for virtual machines, ensuring they have access to the host network or an isolated environment.

Updated at February 15, 2026
15-20 minutes
Medium
FixPedia Team
Применимо к:Windows 10 Pro/Enterprise/EducationWindows 11 Pro/Enterprise/EducationHyper-V Role

Introduction / Why This Is Needed

The Virtual Switch in Hyper-V is a key component that enables network communication between virtual machines (VMs), the host system, and the external network. Proper switch configuration resolves most network issues in a virtual environment—from lacking internet access to needing to isolate traffic between servers. After completing this guide, you will be able to create and configure three switch types, understand their purposes, and troubleshoot common issues.

Prerequisites / Preparation

Before you begin, ensure the following conditions are met:

  1. Operating System: Windows 10 Pro/Enterprise/Education or Windows 11 of equivalent editions. Home editions do not support Hyper-V.
  2. Installed Hyper-V Role: Open "Control Panel" → "Programs and Features" → "Turn Windows features on or off". The "Hyper-V" checkbox must be selected. Alternatively, in an administrative PowerShell: Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart.
  3. Administrator Privileges: All operations for creating and configuring switches require running PowerShell or Hyper-V Manager as an administrator.
  4. Physical Network Adapter: To create an External switch, you must have at least one working physical network interface (Ethernet or Wi-Fi).

Step-by-Step Guide

Step 1: View Current Configuration and Adapters

First, understand what already exists in your system. Launch an administrative PowerShell and run the command to view all virtual switches:

Get-VMSwitch | Format-List Name, SwitchType, NetAdapterInterfaceDescription

Example output:

Name           : ExternalSwitch
SwitchType     : External
NetAdapterInterfaceDescription : Intel(R) Ethernet Connection I219-V

Name           : InternalNetwork
SwitchType     : Internal
NetAdapterInterfaceDescription :

Pay attention to SwitchType and NetAdapterInterfaceDescription for external switches.

Also, find the exact names of your physical network adapters:

Get-NetAdapter | Where-Object {$_.Status -eq "Up"} | Select-Object Name, InterfaceDescription, Status

Note the Name of the required adapter, such as Ethernet or Wi-Fi.

Step 2: Create an External Virtual Switch

An External switch provides VMs with direct access to the physical network, as if they were separate computers on your LAN. They receive IP addresses from the same DHCP server as the host.

⚠️ Important: One physical adapter can be bound to only one external switch. If a switch already exists, the New-VMSwitch command will fail.

Via PowerShell (recommended):

New-VMSwitch -Name "GuestInternet" -NetAdapterName "Ethernet" -AllowManagementOS $true
  • -Name "GuestInternet" — sets the switch name. Use letters and digits without spaces for reliability.
  • -NetAdapterName "Ethernet" — specifies the physical adapter name from Step 1.
  • -AllowManagementOS $truecritically important parameter. $true means the host system (Windows) will also use this switch for its network connection. If you are creating a switch only for VMs and want to keep the host's network on a different adapter, set $false. However, the host will then lose connectivity through this adapter.

Via Graphical Interface (Hyper-V Manager):

  1. Open "Hyper-V Manager".
  2. In the right menu, select "Virtual Switch Manager".
  3. Click "Create Virtual Switch" → "External".
  4. In the "Name" field, enter a descriptive name (e.g., External-Net).
  5. Under "Connection to", select the required physical adapter from the list.
  6. Must leave the checkbox "Allow management operating system to use this virtual switch" checked if you want the host to have network access through it.
  7. Click "OK". The system may restart network services and briefly interrupt the connection.

Step 3: Create an Internal or Private Switch

These types have no access to the physical network.

  • Internal: The network is available only between VMs and the host system. The host sees this switch as a separate network adapter. Ideal for test environments or when VMs need to communicate with services on the host.
    New-VMSwitch -Name "LabNetwork" -SwitchType Internal
    

    After creation, configure a static IP on the host's virtual adapter (via ncpa.cpl) and on the VM adapters in the same subnet (e.g., 192.168.100.1 and 192.168.100.2/24).
  • Private: The network is available only between virtual machines. The host does not see this switch. Used to create completely isolated clusters or tests where the host should not intervene.
    New-VMSwitch -Name "IsolatedNetwork" -SwitchType Private
    

    Configure IPs only on the VM adapters.

Step 4: Assign a Switch to a Virtual Machine

  1. In Hyper-V Manager, select the required VM from the list.
  2. Right-click → "Settings" (or "Properties" in older versions).
  3. In the left menu, select "Advanced" (or "Network Adapter" in simple mode).
  4. In the "Virtual switch" dropdown, select the created switch (e.g., GuestInternet).
  5. Click "OK".
  6. Restart the virtual machine so the network adapter reinitializes with the new settings.

Step 5: Verify Network Operation Inside the Virtual Machine

Start the VM and perform checks:

  1. Open Command Prompt or PowerShell inside the VM.
  2. Check for a network adapter and IP acquisition:
    ipconfig /all
    
    You should have an adapter with an IP address (for an external switch—from your DHCP, for internal/private—static, which you configured).
  3. Check connectivity with the host (for Internal/Private):
    ping <host_IP_address_in_this_network>
    
  4. Check internet access (for External):
    ping 8.8.8.8
    
    If pings work but sites don't open, check DNS settings (ipconfig shows DNS servers).

Result Verification

The main indicator of successful configuration is that the VM receives a correct IP address and can communicate in the required direction:

  • For an External switch: The VM should obtain an IP from your router/DHCP server and have access to the internet and local network.
  • For an Internal switch: The VM and host should see each other (check ping by the IP set on the host's virtual adapter). The host's name in this network is usually Host or Windows.
  • For a Private switch: Two or more VMs connected to the same Private switch should be able to "ping" each other.

Also, on the host, you can run in PowerShell:

Get-VMNetworkAdapter -VMName "YourVMName" | Select-Object -ExpandProperty IPAddresses

This will show the IP addresses that Hyper-V sees for a specific VM's adapter.

Possible Issues

Error: "Failed to add virtual switch... Adapter already in use"

This means the selected physical adapter is already bound to another external switch. Solution:

  1. Remove or reconfigure the existing switch: Remove-VMSwitch -Name "OldSwitch" (or via GUI).
  2. If the adapter is used by the host (e.g., for Wi-Fi), create an Internal/Private switch or disable -AllowManagementOS for the External switch, but then the host will lose network access through that adapter.

VM does not receive an IP address (DHCP)

  1. Ensure the physical adapter bound to the External switch has access to a DHCP server (try releasing/renewing from the host with ipconfig /release and ipconfig /renew).
  2. Verify that in the VM's Hyper-V settings, the correct switch is selected for the network adapter.
  3. Inside the VM, restart the DHCP client service: net stop dhcp && net start dhcp (cmd) or Restart-Service Dhcp (PowerShell).

No connectivity, but IP is present (for External)

Most often, the issue is the Windows Firewall on the host or inside the VM. When an External switch is created with -AllowManagementOS $true, host traffic is filtered. Try temporarily disabling the host firewall for testing. Also check if antivirus or corporate security policies are blocking traffic.

Host "loses" network after creating External switch

This happens if the "Allow management operating system to use this virtual switch" checkbox was unchecked (-AllowManagementOS $false) during creation. The host will create a new virtual adapter, but the physical adapter remains "clean". Solution: either create a new External switch with $true (after removing the old one), or configure a static IP on the host's virtual adapter that appears in ncpa.cpl (it will have a name like "vEthernet (SwitchName)") and set up routing.

F.A.Q.

Which type of virtual switch should I choose for a virtual machine with internet access?
Why doesn't a virtual machine in Hyper-V get an IP address?
Can I use one physical adapter for multiple external switches?
What is the 'Default Virtual Switch' and can it be removed?

Hints

Preparation: Check Hyper-V role and administrator privileges
View existing virtual switches
Create an external switch via PowerShell
Configure an internal switch for an isolated network
Configure virtual machine network adapters

Did this article help you solve the problem?

FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community