Microsoft announced some new features that are coming to the Windows Subsystem for Linux (WSL) in version 1903 today, and it's updated the changelog for build 18836 to reflect the changes. While it's currently only in yesterday's 20H1 build, the features will also be in the next Windows 10 Insider Preview from the 19H1 branch.
You'll now be able to access your Linux files from within Windows. From your Linux distro, just type in explorer.exe and you'll get a File Explorer window inside of the distro. You should be able to do all of the things that you could normally do with files in File Explorer.
Microsoft also said that the team is still looking at ways to improve this experience.
Naturally, you can also do this from the command line. You've just got to find your distro's file path (\\wsl$\distro name\), and you can access the files through PowerShell or other command line tools.
There are some known issues, such as that the Linux distro actually has to be running for you to access the files. Also, this is the same as accessing a network, so the files will behave in the same way. And finally, Microsoft warns that you should not access files from the AppData folder.
Microsoft also made some improvements to the command line, allowing you to "run commands as different users, terminate running distributions, and even export and import different distros". There are some new commands:
Run as the specified user
Exports the distribution to a tar file.
The filename can be – for standard output.
Imports the specified tar file as a new distribution.
The filename can be – for standard input.
Terminates the distribution.
And there are some consolidated commands:
- --list , -l
Lists all distributions available on your machine
Can also contain further options:
Lists all distributions, including distributions that are currently being installed or uninstalled
Lists only distributions that are currently running
Sets the distribution as default.
Unregisters the distribution
Upgrades the distribution to the WslFs file system format.
Again, while you can do all of this stuff now in the Skip Ahead ring of the Windows Insider Program, these features will be in the next Fast ring build.