The other day, I came across the following error when I was trying to create a Hyper-V vSwitch using a WiFi network adapter.
As some of you might know that wireless networking is a bit tricky in virtualization, and sometimes does not work.
There is a great post that goes into the needy-greedy details on why supporting VM communication through wireless network adapters is sometimes problematic.
As you can see in the error message above, we don’t have much information to find the root cause of the issue.
Let’s try to create the same Virtual Switch with PowerShell this time.
The error is different now, [The virtual switch cannot be bound to the WiFi adapter because the network bridge is already in use]. No, we are not talking about San Francisco bridge here
When you create a Hyper-V vSwitch and bound it to a WiFi Adapter, Hyper-V behind the scene integrates the bridge as part of creating the virtual switch in such a way that when you create an external virtual switch using a WiFi adapter, Hyper-V will do the following:
- Create a single adapter bridge connected to the WiFi adapter.
- Create the external virtual switch.
- Bind the external virtual switch to use the bridge, instead of the WiFi adapter directly.
The error message shows clearly that we have a network bridge already created and bound to the WiFi adapter.
We can confirm this by running: netsh bridge show adapter
Yes indeed we have a network bridge.
Let’s open Network and Connections applet in control panel
Yes, the Network Bridge is already available and connected, but have you noticed something different here?
The Virtual Switch is unplugged, 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 the virtual switch that is bound to the WiFi adapter, the network bridge is not deleted automatically.
The resolution is very simple. We will remove the network bridge manually and create the Virtual Switch again:
Here you go, the WiFi vSwitch is created successfully now
However there is a better way to use Hyper-V with a Wireless Network adapter, here is a great post on how to do it documented by Ben Armstrong (Principal program manager on the Hyper-V team).
Hope this helps!
Enjoy your day…