Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save miguelangelgonzalez/35c6c9ba65dd9ab4a595a029f949c056 to your computer and use it in GitHub Desktop.
Save miguelangelgonzalez/35c6c9ba65dd9ab4a595a029f949c056 to your computer and use it in GitHub Desktop.
Docker on windows server 2016. HNS failed with error : Element not found.

Stop the docker service (PS C:> stop-service docker)

Stop the HNS service (PS C:> stop-service hns)

In regedit, delete all of the registry keys under these paths: HKLM:\SYSTEM\CurrentControlSet\Services\vmsmp\parameters\SwitchList HKLM:\SYSTEM\CurrentControlSet\Services\vmsmp\parameters\NicList

Run get-containernetwork | remove-containernetwork

Attempt to clean up Get-VMSwitch | Where-Object {$_.SwitchType -eq “External”} | Remove-VMSwitch

Get-ContainerNetwork | Remove-ContainerNetwork

Restart-Computer -Force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment