Failed to create Switch "DockerNAT" with comments and ideas

So, I too have this problem as a few other people. With the can’t create DockerNAT.

For some reason there is a ghost adapter called vEthernet (DockerNAT), which makes it impossible to use this name. I can’t find this adapter anywhere, but it’s easy to check that it’s there, as I can’t rename any adapter to be this name, as I get an error that this adapter already exists. Docker creates the switch in hyperv, and hyperv, because it can’t create vEthernet (DockerNAT), as it already exists, creates an adapter called vEthernet (DockerNAT) 2 instead. Docker is searching for an adapter called vEthernet (DockerNAT), but it’s a ghost so Docker can’t find it. Docker doesn’t get, that the adapter it wants to use is called vEthernet (DockerNAT) 2.

I’ve tried digging in the command line, in the registry and in adapter/hyperv settings.
I’ve reset hyperv, I’ve reset network setting (a function available in newest insider), reinstalled docker a few times, tried to create the switch manually. Whenever I create the DockerNAT switch manually, it gets the name vEthernet (DockerNAT) 2 in adapters. Have no idea what to do further.

1 Like

I had tried the same things as you, the following blog post finally solved it for me: https://cloudtidings.com/2013/11/20/removing-the-ghost-hyper-v-vnic-adapter-when-using-converged-networks-after-in-place-upgrade-to-w2012r2/

Sadly it doesn’t work for me. Docker insists on creating vEthernet (DockerNAT) 2, same for hyperv. My hyperv also is #2. I think I’ll have to do a windows reinstall to fix all this. And first update to insider, and later turn on hyperv/docker.

I am seeing the exact same issue on 14342. I even tried to rename the adapter and it says the object already exists. I tried a work around to change the switch name in the MobyLinux.ps1 script to DockerNAT2 and that at least got me an adapter that matched and could be found. However, I then had issues with DHCP.

Apart from that I also tried digging into the registry, deleting anything possible, resetting the network interface… It’s a known hyperv problem and basically just remember to turn hyperv off when you’re updating your system. Ended up doing a reinstall of windows.

Thanks, that is a pain because I get updates all the time and typically at night when I am not around.

I also had this same issue in windows 10 pro 64bit, however in my case the root cause is due to Trend Micro Officescan was running. This prevents Hyper-V to create DockerNAT virtual switch. I had to ask our administrator to disable Trend Micro (unload), then install docker.

sequence:
uninstall docker, uninstall hyper-v & containers, reboot pc, disable trend micro, install hyper-v & containers, reboot pc, disable trend micro, install docker for desktop

Hope this helps others who has similar issue.