WSL2

With the release of the Windows 10 Insider build 18945, the Windows Subsystem for Linux version 2 now supports the ability for Windows 10 applications to connect to WSL2 apps via localhost.

When WSL2 was first released, it no longer had the ability to connect to a WSL2 Linux server from Windows 10 applications using the localhost address.

If you wanted to connect to a WSL2 app from your Windows applications, you would now have to look up the IP address assigned to the running Linux distribution and connect to that instead.

Windows 10 Insider build 18945 has now added the localhost feature to WSL2 and you can connect to your locally running Docker, NPM, or other services via Localhost. This is illustrated using the nc command in the image below.

Connecting via Localhost
Connecting via Localhost

With this feature added, users can now enjoy the benefits of the increased WSL2 performance while still being able to easily access any linux servers that they are running.

Bind servers to 0.0.0.0 for localhost to work

Some users have had issues getting the localhost feature to work in WSL2 because their servers are bound to 127.0.0.1.

WSL program manager Craig Loewen has stated in a WSL2 bug post that in order for the localhost to work, a server needs to be accessible to all IP address and thus bound to 0.0.0.0.

"Can you check what IP address your php instance is bound to? I suspect that it's only accepting connections from localhost (127.0.0.1) and it needs to be able to accept incoming connections from all IP addresses (i.e: bind it to 0.0.0.0).

So you would need to run the command: php -S 0.0.0.0:8000"

For example, the user reported that they were unable to get PHP working on localhost with the php -S localhost:8000 command.

This is because the HOSTS file maps localhost to the specific 127.0.0.1 loopback address and thus the feature didn't work.

WSL2 Distribution Hosts File
WSL2 Distribution Hosts File

When the user bound PHP to 0.0.0.0, using the php -S 0.0.0.0:8000 command, the localhost connection feature worked.

Break down IAM silos like Bitpanda, KnowBe4, and PathAI

Broken IAM isn't just an IT problem - the impact ripples across your whole business.

This practical guide covers why traditional IAM practices fail to keep up with modern demands, examples of what "good" IAM looks like, and a simple checklist for building a scalable strategy.

Related Articles:

Microsoft: Windows 10 KB5072653 OOB update fixes ESU install errors

Turn your Windows 11 migration into a security opportunity

Still on Windows 10? Enroll in free ESU before next week’s Patch Tuesday

Microsoft: Windows 10 KB5068781 ESU update may fail with 0x800f0922 errors

Microsoft releases KB5068781 — The first Windows 10 extended security update