Troubleshooting networking on Windows

Troubleshooting networking on Windows

Architecture

Multipass uses the native “Hyper-V” hypervisor on Windows, along with the “Default Switch” created for it. That, in turn, uses the “Internet Sharing” functionality, providing DHCP (IP addresses) and DNS (domain name resolution) to the instances.

Known issues

Default Switch going awry

Unfortunately the Default Switch is known to be quirky and Windows updates often put it in a weird state. This may result in new instances failing to launch, and existing ones timing out to start.

The broken state also persists over reboots. The one approach that has helped is removing the network sharing from the default switch and rebooting:

PS> Get-HNSNetwork | ? Name -Like "Default Switch" | Remove-HNSNetwork
PS> Restart-Computer

Hyper-V will recreate it on next boot.

Stale Internet Connection Sharing lease

Another reason for instance timeouts may be that a “stale” IP address for a particular instance name is stored in the Internet Connection Sharing hosts file.

Using Administrator privileges, edit C:\WINDOWS\System32\drivers\etc\hosts.ics and look for any entries that have your instance name in it. If there is more than 1 entry, remove any of them except for the first listed. Save the file and try again.

If you have a networking issue with Multipass on Windows that isn’t solved by the above, please file an issue on our GitHub page - and if you have a solution, please add it to the first post.

In the first known issue, the workaround doesn’t explain what will happen after the reboot. The implication is that things will “just work”, but if any step is needed to add back that default switch, then the instructions should say so and show how. It would be helpful to clarify things either way.

Also, it would also be very helpful to give that first issue a subheadings, like the next one has, to make it easier to refer to.

Thanks @carehart, fixed it up!

Note all the documentation are wiki posts, so feel free to update them (here in Discourse) yourself :slight_smile:

Note this only solves issues using Hyper-V networking on Windows. There is a current open bug (by me) on the Github repo, asking for more options around networking with VirtualBox on Windows.