Here's a breakdown of the technical changes that occur when you create an external switch in Hyper-V with a network adapter assigned, and what happens when you remove it or change the sharing setting for the management OS.
What happens when you create an external switch in Hyper-V with a network adapter assigned?
When you create an external virtual switch in Hyper-V and bind it to a physical network adapter, Hyper-V makes significant changes to the host's networking configuration. This process is designed to route both the host's network traffic and the virtual machine traffic through the new virtual switch.
Here are the key changes:
- Creation of a Virtual Switch: Hyper-V creates a software-defined, layer-2 Ethernet switch within the host's memory[1][2][3]. This virtual switch acts as the central point for network traffic for the virtual machines and potentially the host[1].
- Binding to the Physical Adapter: The external virtual switch is bound to the physical network adapter you selected[1][4][2]. This physical adapter then serves as the uplink from the virtual switch to your physical network (like your router or corporate LAN)[1][2].
- Physical Adapter Dedication: Crucially, the physical adapter assigned to the external switch is largely taken over by Hyper-V[1][2]. It is no longer used directly by the host operating system for its primary network communication[1][7][8]. TCP/IP and most other standard protocols and services are unbound from the physical adapter itself[1][2]. Attempting to configure TCP/IP directly on this physical adapter after the switch is bound will likely have no effect or break the virtual switch[1].
- Packet Flow Change: The default network packet flow on the host changes. Instead of the host OS sending traffic directly through the physical adapter, all network connections, including those from the host, are routed through a new virtual network adapter, then through the virtual switch, and finally out the original physical adapter[7].
- Protocol Binding: The "Microsoft Virtual Network Switch Protocol" is bound to the physical network adapter. This protocol is responsible for listening to network traffic coming from the external virtual switch[5].
Impact of 'Allow management operating system to share this network adapter':
This setting determines whether the host operating system will have a virtual network adapter connected to the newly created external virtual switch. The term "sharing" is somewhat misleading; the physical adapter isn't truly shared in the traditional sense[1][2].
What happens when you remove an external switch in Hyper-V?
When you remove an external virtual switch in Hyper-V, the system reverses the changes made during its creation.
Here are the key actions:
- Virtual Switch Deletion: The software-defined virtual switch is removed from the host's memory[6].
- Physical Adapter Release: The physical network adapter that was bound to the virtual switch is released from Hyper-V's control. This means the physical adapter is no longer dedicated to the virtual switch.
- Protocol Unbinding: The "Microsoft Virtual Network Switch Protocol" is unbound from the physical network adapter. This allows the physical adapter to revert to its normal function[5].
- Reversion of Host Networking: The host's network stack configuration is reverted. The host operating system can now directly use the physical adapter again for its network communication.
- Removal of Management OS Virtual Adapter (if applicable): If the "Allow management operating system to share this network adapter" setting was enabled when the switch was created, the virtual network adapter that was created for the management OS will be removed[6].
- Disconnection of VMs: Any virtual machines that were connected to the removed virtual switch will become disconnected from the network[6].
- Potential for Temporary Connectivity Loss: The process of removing the switch and reconfiguring the physical adapter can cause a brief disruption in network connectivity for the host[8].
Sometimes, remnants of virtual adapters might persist after removal, which can cause issues. These might need to be manually uninstalled from Device Manager[1][4][2].
What happens when you check or uncheck 'allow the management operating system to share this network adapter' after creating a Hyper-V external virtual switch?
Changing the "Allow management operating system to share this network adapter" setting after an external virtual switch has already been created involves dynamically adding or removing the management OS's virtual network adapter from the existing switch.
In both cases, changing this setting dynamically modifies the presence and connection of the management OS's virtual network adapter to the switch. It doesn't fundamentally change the binding of the external virtual switch to the physical adapter, which remains dedicated to the virtual switch[1][2].