Microsoft corporate blog
Configuring Linux
Development for Linux
Development for Windows
June 20

WSL 2 is now available in Windows Insiders

We’re excited to announce starting today you can try the Windows Subsystem for Linux 2 by installing Windows build 18917 in the Insider Fast ring! In this blog post we’ll cover how to get started, the new wsl.exe commands, and some important tips. Full documentation about WSL 2 is available on our docs page.




Getting Started with WSL 2


We can’t wait to see how you start using WSL 2. Our goal is to make WSL 2 feel the same as WSL 1, and we look forward to hearing your feedback on how we can improve. The Installing WSL 2 docs explains how to get up and running with WSL 2.


There are some user experience changes that you’ll notice when you first start using WSL 2. Here are the two most important changes in this initial preview.


Place your Linux files in your Linux root file system


Make sure to put the files that you will be accessing frequently with Linux applications inside of your Linux root file system to enjoy the file performance benefits. We understand that we have spent the past three years telling you to put your files into your C drive when using WSL 1, but this is not the case in WSL 2. To enjoy the faster file system access in WSL 2 these files must be inside of the Linux root file system. We have also made it possible for Windows apps to access the Linux root file system (like File Explorer! Try running: explorer.exe . in the home directory of your Linux distro and see what happens) which will make this transition significantly easier.


Access your Linux network applications with a dynamic IP address in initial builds


WSL 2 includes a huge architecture change using virtualization technology, and we are still working on improving the networking support. Since WSL 2 now runs in a virtual machine, you will need to use that VM’s IP address to access Linux networking applications from Windows, and vice versa you will need the Windows host’s IP address to access Windows networking applications from Linux. We aim to include the ability for WSL 2 to access network applications with localhost as soon as we can! You can find full details and steps on how to do this in our documentation here.


To read more about the user experience changes please see our documentation: User Experience Changes Between WSL 1 and WSL 2.


New WSL Commands


We’ve also added some new commands to help you control and view your WSL versions and distros.


  • wsl --set-version <Distro> <Version>
    Use this command to convert a distro to use the WSL 2 architecture or use the WSL 1 architecture.


    : the specific Linux distro (e.g. “Ubuntu”)


    : 1 or 2 (for WSL 1 or 2)

  • wsl --set-default-version <Version>
    Changes the default install version (WSL 1 or 2) for new distributions.

  • wsl --shutdown
    Immediately terminates all running distributions and the WSL 2 lightweight utility virtual machine.


    The VM that powers WSL 2 distros is something that we aim to manage entirely for you, and so we spin it up when you need it and shut it down when you don’t. There could be cases where you would want to shut it down manually, and this command lets you do that by terminating all distributions and shutting down the WSL 2 VM.

  • wsl --list --quiet
    Only list the distribution names.


    This command is useful for scripting since it will only output the names of distributions you have installed without showing other information like the default distro, versions, etc.

  • wsl --list --verbose
    Shows detailed information about all the distributions.


    This command lists the name of each distro, what state the distro is in, and what version it is running. It also shows which distributions is default with an asterisk.


Looking ahead and hearing your feedback


You can expect to get more features, bugfixes, and general updates to WSL 2 inside of the Windows Insiders program. Stay tuned to their experience blog and this blog right here to learn more WSL 2 news.


If you run into any issues, or have feedback for our team please file an issue on our Github at: github.com/microsoft/wsl/issues, and if you have general questions about WSL you can find all of our team members that are on Twitter on this twitter list.


+17
2.1k 1
Comments 1