One day I came across the following error when I tried to create a Hyper-V vSwitch using a WiFi network adapter.
As some of you may know, a wireless network is a bit tricky in virtualization and sometimes doesn’t work.
There is a great post that addresses the need-hungry details of why Support for VM communication via wireless network devices is sometimes problematic.
As you can see from the error message above, we don’t have much information to find the root cause of the problem.
Let’s try to create the same virtual switch with PowerShell this time.
The error is now different, [The virtual switch cannot be bound to the WiFi adapter because the network bridge is already in use]. No, we’re not talking about it San Francisco Bridge here
When you create a Hyper-V vSwitch and bind it to a WiFi adapter, the Hyper-V behind the scene integrates the bridge as part of creating a virtual switch so that when you create an external virtual switch using a WiFi adapter, Hyper-V does the following:
- Create one adapter bridge connected to the WiFi adapter.
- Create an external virtual switch.
- Tie an external virtual switch to use the bridge directly instead of a WiFi adapter.
The error message clearly indicates that we have already created a network bridge and are connected to a WiFi adapter.
We can confirm this by running: netsh bridge show adapter
Yes, we do have a network bridge.
Open the Network and Connections application from the control panel
Yes, Network Bridge is already available and connected, but have you noticed anything different here?
The virtual switch has been disconnected, we can confirm this in Hyper-V Manager under Virtual Switch Manager:
We can see the Ethernet external vSwitch, but where is the WiFi vSwitch?
Sometimes, when you remove a virtual switch that is tied to a WiFi adapter, the network bridge is not removed automatically.
The resolution is very simple. We manually remove the network bridge and re-create the virtual switch:
Here it is, WiFi vSwitch has now been created successfully
However, there is a better way to use Hyper-V with a wireless network adapter, here is a great message on how to do it, documented by Ben Armstrong (Hyper-V Team Chief Program Manager).
Hopefully this will help!
Enjoy your day…