What’s new for WSL in Insiders Preview Build 18945
A new Windows insiders build has just released, and it contains some hot off the press features for the Windows Subsystem for Linux (WSL)! We’ve added the ability to access Linux networking applications in a WSL 2 distro from Windows with
localhost, as well as 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). You can find the full release notes for the WSL updates in this build here and you can view all of the updates in this build here.
localhost to connect to your Linux applications from Windows
In the first released build with WSL 2, you needed to access your networking applications via remote IP addresses. We stated that this was high on our priority list to fix, and so we are happy to say that we’ve started this process already by giving you the ability to access your Linux networking apps from Windows with
In the future we want to make sure that you can access your Windows networking applications from Linux using
localhost as well. We’ve prioritized Linux apps from Windows as that’s the most common networking use case, such as a web developer accessing their website in a browser. Stay tuned for more improvements in this area!
WSL global configuration
Since Insider Build 17093 you have been able to configure your WSL distros using
wsl.conf. These options are great to configure individual distros, such as enabling or disabling automounting Windows drives, changing mount locations, disabling interop, etc. However, there are some possible options that need to be applied to all distributions. This has become especially important recently due to WSL 2. All WSL 2 distros are run on the same virtual machine (VM), and therefore any configuration options to this VM will be applied globally to all WSL 2 distros. In this new update we’ve added the ability to start using global config options for WSL. These options are targeted towards power users who want to further customize their WSL experience.
To get started, create a new file called
.wslconfig in your Users folder (
<yourUsername> is your Windows login name). The
.wslconfig file is modelled after an INI file, just like .gitconfig.
We’ve added some initial configuration options, and you can find the full list of what was added in this build here. The most exciting one is specifying a custom kernel!
Using a custom kernel in WSL 2
We provide a Linux kernel with WSL 2, and it’s shipped within Windows. However, there may be a case where you want a specific kernel powering your WSL 2 distros, such as using a certain kernel module, etc. You can now use the
kernel option in the
.wslconfig file to specify a path to a kernel on your machine, and that kernel will be loaded into the WSL 2 VM when it’s started. If no option is specified, you’ll go back to using the Linux kernel provided with Windows as part of WSL 2.
Tell us what you think!
If you run into any technical issues using this build please file an issue on our Github repo: Microsoft/WSL. Additionally, if you have any WSL related questions or want to stay up to date with WSL news you can find a list of WSL team members that are active on Twitter here.
We’ll be looking forwards to delivering more updates in the future.
Can we run Docker on WSL?
Yes. In WSL 2 I run native Docker and Docker Compose. You have to remember to sudo service start docker but that is it. Very fast.
Magnificent. I was really hoping for “very fast”.
Yuuup! 🙂 https://blog.docker.com/2019/07/5-things-docker-desktop-wsl2-tech-preview/