Microsoft showcased the new feature for Windows Subsystem for Linux
Windows 10 Insiders Preview Build 18945 released, which includes some new features of Windows Subsystem for Linux (WSL), adds the ability to use localhost to access Linux web applications from the WSL 2 release from Windows, global configuration options that will give you greater control over your Linux distros, such as specifying a custom kernel for the WSL 2 Virtual Machine (VM).
Use localhost to connect to your Linux applications from Windows
In the first release using WSL 2, the web application was accessed via a remote IP address, but now the issue has been resolved and Linux network applications can now be accessed from Windows using localhost. For example, the image below shows launching a NodeJS server in the WSL 2 release and then using localhost to connect to the NodeJS server in the Edge browser.
WSL global configuration
All WSL 2 releases run on the same virtual machine (VM), so any configuration options for this VM will be applied globally to all WSL 2 releases. In this new update, the ability to use global configuration options for WSL is added for those who want to further customize their WSL experience.
“To get started, create a new file called .wslconfig
in your Users folder ( C:\Users\<yourUsername>\
where <yourUsername>
is your Windows login name). The .wslconfig
file is modeled after an INI file, just like .gitconfig.”
Using a custom kernel in WSL 2
A WSL 2 Linux kernel is provided, which is available in Windows. If you want a specific kernel to power your WSL 2 release, such as using a specific kernel module, you can now use the kernel option in the .wslconfig file to specify the path to the kernel on the machine, and the kernel is booting will be loaded into the WSL 2 VM. If no options are specified, you will be returned to using the Linux kernel provided by Windows as part of WSL 2.