I'm having trouble creating a virtual switch for a virtual machine I have in hyper-v. I had a virtual ethernet switch set up and connected to the machine before, after deleting this at some point, I now cannot create one again.
Within hyper-v the error is:
After researching the problem, this appears to be related to the 'Hyper-V Virtual Extensible Switch' item not being checked in the ethernet adapters properties.
Trying to enable this in the GUI isn't possible, as after checking the item then clicking on OK the message is "Your current selection will also disable the following features: Hyper-V Extensible Virtual Switch", like here:
Within powershell when trying to enable this the error is
PS C:\Windows\System32\WindowsPowerShell\v1.0> Set-VMSwitch Internet -NetAdapterName "Ethernet"
Set-VMSwitch : Hyper-V was unable to find a virtual switch with name "Internet". At line:1 char:1Set-VMSwitch Internet -NetAdapterName "Ethernet" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Set-VMSwitch], VirtualizationException + FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.SetVMSwitch
Using the following command with a microsft uitilty called nvspbind:
nvspbind.exe" /b "Realtek PCIe GbE Family Controller"
the result is:
applying changes... cleaning up...releasing write lock...success finished (0)
But inspection afterwards using the properties GUI, powershell and nsvpbind reveals that the virtual switch is in not binded (all list as not binded).
Any ideas?
Specs: Windows 10 64 bit.
32 Answers
With Get-NetAdapter you can get a list of your physically network adapters.
Here the documentation of Set-VMSwitch.
Call this as admin in a Powershell Window:
Set-VMSwitch -Name "My New vSwitch" -NetAdapterName "Ethernet" -SwitchType "External"
My New vSwitch --> Name of new virtual Switch
Ethernet --> Name of Adapter (LAN, WLAN) from the output of Get-NetAdapter
External --> Switch Type, could be internal, external or private
You have tried everything, including re-installing the Hyper-V feature in Windows, but it didn't work out.
The explanation might be some over-active security application or a corruption in Windows.
I suggest the following measures:
Disable all security software, antivirus and firewall and try again
Run chkdsk
Runsfc /scannow and DISM
If all fails then doRepair Install of Windows 10 with an In-place Upgrade.