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Β
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Β
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Β
To read more about the user experience changes please see our documentation:Β
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:
ΠΡΡΠΎΡΠ½ΠΈΠΊ: habr.com