New-VMSwitch fails on nanoserver TP4 : Failed while adding virtual Ethernet switch connections for only. netnat dependency? RRS feed

  • Question

  • Ive been trying to get  Neil Petersons  windows container creation (on nanoserver) script to work and cannot. It cannot create the VM-switch. It couldnt download the nanoserver base os image for containers either, but I did that manually:]: PS C:\> get-containerimage

    Name       Publisher    Version      IsOSImage
    ----       ---------    -------      ---------
    NanoServer CN=Microsoft 10.0.10586.0 True  

    Then i tried to manually create the switch but the  switch addition fails with:

    []: PS C:\> New-VMSwitch -Name "Virtual Switch" -SwitchType NAT -NATSubnetAddress "" -Force
    A parameter cannot be found that matches parameter name 'Force'.
        + CategoryInfo          : InvalidArgument: (:) [New-VMSwitch], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.HyperV.PowerShell.Commands.NewVMSwitch

    I deleted all the netnat configurations to see if this would help. It did not. There was one netnat config called containerNAT that had subnet config.

    I successfully created a container once, but was unable to add the IIS package inside the nanoserver container, again based on some Neil articles. DISM failed during container online update and appeared to implicate corrupt packages, but after multiple re-downloads, there was no change in behaviour so i gave up and resolved to start again with fresh nanoserver TP4 image.

    Where i want to get to is this: I have nanoserver TP4 with all the options running on physical box. This is the (windows) container host OS. I want to create widows containers on this host, and i understand that these must be based on nanoserver container os image.  


    Name                 Version                 Description                        
    ----                 -------                 -----------                        
    NanoServer           10.0.10586.0            Container OS Image of Windows Se...

    Have i thrashed something by deleting NetNAT? I dont use docker. Is there any dependency that means you should not delete netnat configs after you have downloaded container host image?

    Right now, New VM-switch simply wont work for the following ip subnet.

     New-VMSwitch -Name "Fred" -SwitchType NAT -NATSubnetAddress "" 


    New-VMSwitch -Name "Fred" -SwitchType NAT -NATSubnetAddress "" 

    will work for this different subnet.

    Thursday, March 31, 2016 10:30 AM


  • I power cycle rebooted the server and this somehow fixed this problem or at least its symptoms, as I can create a switch again. There is some residual record of this ip address that is preventing it from being re-used if it was previously used and then deleted.

    • Marked as answer by ctgarvey Thursday, March 31, 2016 12:53 PM
    Thursday, March 31, 2016 12:53 PM