New Hyper-V switch on Windows 10

My test/lab machine had been running Windows Server 2016 TP 5. With Server 2016 now RTM it was time for a rebuild.  Unfortunately, 2016 RTM carried on from TP5 and decided not to work with my wireless card.

Decided to try using Hyper-V on Windows 10 – it recognises the wifi card and is happy to work with it.

After installing the Hyper-V feature I needed to create some Hyper-v virtual switches

PS> New-VMSwitch -SwitchType External -Name ‘LAN’ -NetAdapterName ‘LAN’
New-VMSwitch : Cannot validate argument on parameter ‘SwitchType’. The argument “External” does not belong to the set
“Internal,Private” specified by the ValidateSet attribute. Supply an argument that is in the set and then try the
command again.
At line:1 char:26
+ New-VMSwitch -SwitchType External -Name ‘LAN’ -NetAdapterName ‘LAN’
+                          ~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-VMSwitch], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.HyperV.PowerShell.Commands.NewVMSwitch

But External is a valid switch type

PS> New-VMSwitch -SwitchType x
New-VMSwitch : Cannot bind parameter ‘SwitchType’. Cannot convert value “x” to type
“Microsoft.HyperV.PowerShell.VMSwitchType”. Error: “Unable to match the identifier name x to a valid enumerator name.
Specify one of the following enumerator names and try again:
Private, Internal, External”
At line:1 char:26
+ New-VMSwitch -SwitchType x
+                          ~
    + CategoryInfo          : InvalidArgument: (:) [New-VMSwitch], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.HyperV.PowerShell.Commands.NewVMSwitch

Wonder how many of these issues I’m going to find!

Advertisements
This entry was posted in Hyper-V, Windows 10. Bookmark the permalink.

2 Responses to New Hyper-V switch on Windows 10

  1. This article really helped me https://msdn.microsoft.com/en-us/virtualization/hyperv_on_windows/user_guide/setup_nat_network. I haven’t tried setting up an external switch, but I was able to get an internal switch working where I can run VMs and Docker containers NATed so that they can access the Internet. It is also working over my laptop’s WiFi to boot. The only thing I don’t have working is this setup, but over my work’s VPN.

    • NAT for containers is a good idea. BTW they not Docker containers but Windows or Hyper-V containers. Docker is just a management API for containers. Using NAT still assumes you have a Hyper-V switch. My post was pointing out that there is a problem with the New-VMswitch cmdlet shipping in Windows 10

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s