WSL2 now supports connecting Localhost from Windows 10 applications

Windows 10 Insider build 18945 has just been released by Microsoft with many noticeable improvements, including Windows Subsystem for Linux version 2 (WSL2) that has been integrated with support for seamless connectivity. Directly, Windows 10 applications with WSL2 applications via localhost.

  1. Live Tiles will really go into oblivion if the Windows 10 20H1 Start Menu looks great like this

WSL2 now supports connecting Localhost from Windows 10 applications Picture 1 Localhost has now been added back to WSL2

When WSL2 was released with the first version, the tool no longer supported the ability to connect to Linux WSL2 servers from Windows 10 applications using localhost addresses. Therefore, in case you want to connect to the WSL2 application from your Windows applications, you will have to find the IP address assigned to the running Linux distribution and connect to it as an alternative.

As for the version of Windows 10 Insider build 18945, the localhost feature has now been added back to WSL2, and you can connect directly to Docker, NPM or other services running locally on the system through Localhost. This task can be performed using the command nc as shown in the example below.

  1. Appeared to design Microsoft's new Action Center, the corners are more elegant and modern

WSL2 now supports connecting Localhost from Windows 10 applications Picture 2 Connect via Localhost

With the 're-export' of the localhost feature, users can now fully enjoy the benefits from the increase in performance of WSL2, while still easily accessible to any Linux server. Which they are running.

Link servers to 0.0.0.0 so that localhost works

Some users said they had trouble activating the localhost feature in WSL2 because their server is bound to 127.0.0.1.

The engineer responsible for WSL program manager Craig Loewen stated in a post of the WSL2 error message on the blog that in order for localhost to work, the server needs to be able to access all IP addresses, and therefore limited to 0.0.0.0. Originally written by Craig Loewen as follows:

"Can you check which IP address your php object is bound to? I suspect that it only accepts connections from localhost (127.0.0.1), while also requiring acceptability. The connections come from all IP addresses (for example, link it to 0.0.0.0) so you will need to run the command: php -S 0.0.0.0:8000 '.

For example, users have reported that they cannot let PHP work on localhost with the php -S localhost: 8000 command. This may be because the HOSTS file maps localhost to a specific loopback 127.0.0.1 address and therefore this feature will not work.

  1. Microsoft releases a new Windows 10 update, Microsoft Edge will be hidden if you install Edge Chromium

WSL2 now supports connecting Localhost from Windows 10 applications Picture 3 Distribution server file WSL2 (WSL2 File Hosts File)

When users bind PHP with 0.0.0.0, use the php -S 0.0.0.0:8000 command, the localhost connection will most likely work properly.

4 ★ | 24 Vote

May be interested

  • Will Windows RT support Outlook?Will Windows RT support Outlook?
    one of the biggest complaints about windows rt is that it does not support the popular microsoft outlook email application. however, it seems that this drawback is about to be overcome.
  • What is special about connecting Windows 10 with Microsoft's iPhone?What is special about connecting Windows 10 with Microsoft's iPhone?
    the us patent office (uspto) has published a microsoft patent application, showing the company is designing an iphone-specific dock, making it easier to connect windows 10 and iphone devices. .
  • Microsoft allows users to install Windows Store applications on up to 2000 devicesMicrosoft allows users to install Windows Store applications on up to 2000 devices
    if you have multiple windows devices linked to your microsoft account, you'll probably be happy to know that microsoft is raising the device load limit of more than 20 times the current application.
  • Instructions allow applications to communicate with each other via Windows FirewallInstructions allow applications to communicate with each other via Windows Firewall
    windows firewall acts as a barrier to prevent your computer from connecting to the rest of the internet. the firewall retains unwanted network traffic and allows applications on your computer to communicate with the outside world. but each fence needs a gate, and that's where exceptions come in.
  • How to turn off Wi-Fi when connecting to Ethernet in Windows 10How to turn off Wi-Fi when connecting to Ethernet in Windows 10
    the use of wi-fi on mobile devices and computers is extremely convenient, but on the flip side is very battery consuming. therefore, whenever you can use ethernet (wired network), you should make the most of it. however, the problem here is that windows does not automatically disconnect from wi-fi every time you plug in an ethernet network. so in this article, tipsmake.com will guide you to do that.
  • 7 utility applications should install for Windows7 utility applications should install for Windows
    7 useful and compact applications suitable for windows installation.
  • Why doesn't Windows 11 support my CPU?Why doesn't Windows 11 support my CPU?
    besides tpm 2.0, windows 11 also requires some other things about the cpu. specifically, windows 11 requires your computer to have an intel 8th generation cpu or higher or an amd ryzen 2000 or higher. microsoft did not explain the reason, so many users were confused.
  • The software supports Bluetooth connection with the computerThe software supports Bluetooth connection with the computer
    bluetooth is very handy but does not always work well even if you have bluetooth enabled on your computer. so if one day you have tried all the ways but still can not connect bluetooth to the computer, how to do? don't worry, the software that supports bluetooth connectivity with the computer below will help you quickly solve this problem. in addition to the ability to turn on bluetooth, they also optimize the ability to capture waves and compatibility of bluetooth devices.
  • Fix PS5 not connect to WiFiFix PS5 not connect to WiFi
    your playstation 5 is not connecting to the wifi network, and you are not sure if it is a hardware problem on the device or caused by software settings?
  • How to fix 'Try Connecting Your Device' Bluetooth pairing error in Windows 10/11How to fix 'Try Connecting Your Device' Bluetooth pairing error in Windows 10/11
    some users said they see 'try connecting your device again' or 'try connecting again' error messages in windows when they try to pair bluetooth devices.