How to correctly create Virtual Switch in Windows Server 2016 TP4 while installing Docker? (not boot2docker)

0

I have an installed Windows Server 2016 Technical Preview 4 on VMware Warkstation.
It has 2 GB RAM and 60 GB disk space.

I try to install Windows Server Host for Docker according to official Microsoft instruction.
Instruction in general in the picture

I don't need a Hyper-V Containers technology so for this guide i don't have to make steps marked with a one asterisk '*'

So we have six steps that we have to do for install Windows Server Host and Docker:

  1. Install the Container Feature
  2. Create Virtual Switch
  3. Configure NAT
  4. Configure MAC Address Spoofing
  5. Install Container OS Images
  6. Install Docker **

I have a problem in step two: Creat Virtual Switch while typing next cmdlet in PowerShell:

PS C:\> New-VMSwitch -Name "Virtual Switch" -SwitchType NAT -NATSubnetAddress 172.16.0.0/12
New-VMSwitch : Failed while adding virtual Ethernet switch connections.
Internal miniport create failed, name = '8A407781-1BF5-4BB0-8538-35CFF056C598', friendly name = 'vEthernet (Virtual Switch)', MAC = 'DYNAMIC': One or more arguments are invalid
(0x80070057).
At line:1 char:1
+ New-VMSwitch -Name "Virtual Switch" -SwitchType NAT -NATSubnetAddress ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-VMSwitch], VirtualizationException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.NewVMSwitch

What should I do in this case?

windows
powershell
docker
asked on Stack Overflow Jan 20, 2016 by Reputet • edited Sep 22, 2018 by Cœur

2 Answers

1

I was able to install docker using Microsoft guide about auto-install instead of using manual guide:

# Auto-install instruction.

PS C:\> powershell.exe
PS C:\> start-process powershell -Verb runas
PS C:\> wget -uri https://aka.ms/tp4/Install-ContainerHost -OutFile C:\Install-ContainerHost.ps1
PS C:\> C:\Install-ContainerHost.ps1 -HyperV

# Wrong!

But there is an error in the last line in key -HyperV.
We need to ingore it, so the last line looks like:

PS C:\> powershell.exe
PS C:\> start-process powershell -Verb runas
PS C:\> wget -uri https://aka.ms/tp4/Install-ContainerHost -OutFile C:\Install-ContainerHost.ps1
PS C:\> C:\Install-ContainerHost.ps1

# Currect!

Using correct instruction i was able to install docker.

answered on Stack Overflow Feb 5, 2016 by Reputet
1

I had the same error on a Nano Server the first time I ran:

PS C:\> New-VMSwitch -Name "Virtual Switch" -SwitchType NAT -NATSubnetAddress 172.16.0.0/12

SwitchType NAT is definitely correct because the command doesn't accept the NATSubnetAddress parameter for anything other then a NAT switchtype. Run it a second time and then it worked on my Nano Server.

answered on Stack Overflow Feb 15, 2016 by Serge Meeuwsen

User contributions licensed under CC BY-SA 3.0