Since I upgraded Docker on my computer to beta27, I have been unable to run Windows containers using the default network. I get the following message:
docker: Error response from daemon: container xxx encountered an error during Start failed in Win32: The system cannot find the path specified. (0x3): Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
I have uninstalled/removed everything (Docker for Windows, Hyper-V, the Containers feature, and files left over in C:\ProgramData\Docker) and then reinstalled everything but the issue persists.
I realised that the nat
adapter was no longer present in Hyper-V, but the DockerNat
adapter was.
This article provides a script to reset the networking components but I am unable to remove the container network.
PS C:\WINDOWS\system32> Get-ContainerNetwork
Name Id Subnets Mode SourceMac DNSServers DNSSuffix
---- -- ------- ---- --------- ---------- ---------
nat 12706897-fc71-41fc-9046-a7be0d01727e {172.16.0.0/12} NAT
PS C:\WINDOWS\system32> Get-ContainerNetwork | Remove-ContainerNetwork
Confirm
Remove-ContainerNetwork will remove the container network "".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
Remove-ContainerNetwork : Unspecified error
At line:1 char:24
+ Get-ContainerNetwork | Remove-ContainerNetwork
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Remove-ContainerNetwork], VirtualizationException
+ FullyQualifiedErrorId : OperationFailed,Microsoft.Containers.PowerShell.Cmdlets.RemoveContainerNetwork
PS C:\WINDOWS\system32> Remove-ContainerNetwork -Name nat
Confirm
Remove-ContainerNetwork will remove the container network "nat".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
Remove-ContainerNetwork : Unspecified error
At line:1 char:1
+ Remove-ContainerNetwork -Name nat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Remove-ContainerNetwork], VirtualizationException
+ FullyQualifiedErrorId : OperationFailed,Microsoft.Containers.PowerShell.Cmdlets.RemoveContainerNetwork
PS C:\WINDOWS\system32>
Is there a registry entry that I can delete to remove the network since it's failing to remove it via PowerShell?
Best Answer
Try removing the NAT network using the following:
You can also try restarting HNS and docker