

#XSHELL 5 SLOW TO OPEN HOST UPDATE#
Note that, since the address for WSL2 changes after each reboot, it can be difficult to update your configuration each time.
#XSHELL 5 SLOW TO OPEN HOST WINDOWS#
Because WSL2 appears to Windows as a remote network, you'll typically need to update your configuration to bind to 0.0.0.0 or a specific address. Many servers are configured by default to bind to localhost/ 127.0.0.1. Remember to have your Windows service accept connections from remote hosts So concatenating $(hostname) (or it's equivalent in your programming/language environment) with ".local" should get you access. local domain) using the Windows "computer name", which is also used as the hostname of the WSL instance. You could, of course, parse it from the route (or, as in an earlier answer, from /etc/nf), but WSL sets up a convenience mDNS (the. This is the address you need to use for the Windows host. WSL2 also sets up a virtual router on the Windows host to allow connectivity to both the outside world as well as the Windows host. Inside WSL2, localhost is the address of the vNIC.

WSL2 is running with a virtual network (vNIC) that is created by the Windows Virtual Machine Platform (a subset of Hyper-V).

It's available by default in the WSL Ubuntu installation, but may need to be installed in other distributions like openSUSE: nc -zv "$(hostname).local" If ICMP is blocked (as it seems to be on new Windows 11 installs), or if you want to test the connection to the actual port, then use netcat. Concatenating your WSL2 hostname (or the equivalent command/function in your programming/language environment) with ".local" should get you access.įor example, from Bash, try: ping "$(hostname).local"įor instance, if your hostname is "M圜omputer", then the mDNS should be M圜omputer.local. MDNS has been a feature of WSL2 for a while now. Short answer for most recent Windows versions
