Troubleshoot Docker EE on Windows Server 2016 (“HNS Failed with error: …”)
Fix HNS Related errors
To fix HNS Related errors, Clean Up Windows Server 2016 Host networking configuration
Run following script provide by Microsoft in PowerShell as admin to cleanup your Windows Host (Read the instructions carefully before running this script provided by Microsoft)
To capture basic logs* to assist with container network troubleshooting, run this script without any arguments: PS C:\>…
(Optionally) Clean Up your host manually -
Run following commands on an administrator PowerShell console :
# MAKE SURE HOST IS NOT IN SWARM MODE
docker swarm leave --force# removes all container networks on the system.
docker network prune -f# removes all containers on the system.
docker container prune -f# stop docker service
net stop docker# clean up networking components on the container hostGet-NetNatStaticMapping | Remove-NetNatStaticMapping
Get-NetNat | Remove-NetNat
Get-ContainerNetwork | Remove-ContainerNetworkStop-Service hns -Force
Restart-Service hns -ErrorAction SilentlyContinue# Restart host
Also try to clean Unwanted/Duplicate/Hidden duplicated unwanted network adapters from Device Manger (if any). Below screenshot shows good case -
If nothing works try running docker daemon in debug mode to check for the errors -
net stop docker
Docker on Windows Server 2016 will probably cause issues if you have third party softwares like
- Process monitoring tools
installed on your server.
Another reason if you are facing trouble with docker on Windows Server 2016 can be your network security configuration.
Recommended antivirus exclusions for Hyper-V hosts
Some links explaining Docker issues with 3rd party softwares installed on Windows Server 2016 -
Endpoint Standard: Docker EE fails to run
Environment Endpoint Standard Sensor: Version 188.8.131.52 and higher Docker: Enterprise Edition Symptoms Docker Enterprise…
Docker can not start to run. · Issue #2085 · docker/for-win
Dismiss GitHub is home to over 50 million developers working together to host and review code, manage projects, and…
Recommendation from Docker for Antivirus Softwares :
Antivirus software and Docker
When antivirus software scans files used by Docker, these files may be locked in a way that causes Docker commands to…
Check out this link for “Anti-Virus optimization for Windows Containers” -
Anti-virus optimization for Windows Containers — Windows drivers
Windows 10, versions 1607 and later Windows Server 2016 and later versions Anti-virus (AV) products running on the Host…
Get help from #Microsoft, check out this link “Support policy for Windows containers and Docker in on-premises scenarios”.
Docker on Windows Server 2016 is officially supported by Microsoft without any additional charge.