What is new for Windows Subsystem for Linux in Windows 10 version 1903

What is new for Windows Subsystem for Linux in Windows 10 version 1903

Last Updated: 25 Feb 2019 at 17:12

The next Windows update is coming soon and we’re bringing exciting new updates to WSL with it! These include accessing the Linux file system from Windows, and improvements to how you manage and configure your distros in the command line.

The best way to get started with this feature is to open your Linux files in File Explorer! To do this, open your favorite distro, make sure your current folder is your Linux home directory, and type in:

explorer.exe .

This will open a File Explorer window, located inside of your Linux distro.

From here you can access whatever Linux files you would like, just like you would any other file through File explorer. This includes operations such as: dragging files back and forth to other locations, copy and paste, and even interesting scenarios like using the context menu to open VSCode in a WSL directory!

Improvements coming soon to the File Explorer experience

When using this feature you’ll notice the distro files are exposed through the path: \\wsl$\<running_distro_name>\. This is due to the way Windows accesses the files inside of each distro (which you can learn the details of in the following section!) The WSL team is actively investigating ways to improve the discoverability of your Linux files inside of File Explorer.

In command line

WSL is primarily a command line tool, and so of course this feature also works in the command line. You can find your distro’s files by accessing \\wsl$\{distro name}\ where {distro name} is the name of a running distro. Here’s what it looks like to access Debian with PowerShell.

How it works

To put it briefly: a 9P protocol file server facilitates file related requests, with Windows acting as the client.

We’ve modified the WSL init daemon to include a 9P server. This server contains protocols that support Linux metadata, including permissions. There is a Windows service and driver that acts as the client and talks to the 9P server (which is running inside of a WSL instance). Client and server communicate over AF_UNIX sockets, since WSL allows interop between a Windows application and a Linux application using AF_UNIX as described in this post.

Known issues

This is a new feature, and some pieces of it may not work perfectly. Here are some known issues that we want to make you aware of when using this feature:

As of right now, the distros files will only be accessible from Windows when the distro is running (We aim to add support for non-running distros in a future update)
Since the 9P file server runs inside of each distro, it is only accessible when that distro is running. The team is looking into ways to help resolve this.

Accessing Linux files is treated the same as accessing a network resource, and any rules for accessing network resources will still apply
e.g: When using CMD, cd \\wsl$\Ubuntu\home will not work (as CMD does not support UNC paths as current directories), however copy \\wsl$\Ubuntu\home\somefile.txt C:\dev\ will work

The old rules still apply, you should NOT access your Linux files inside of the AppData folder!
If you try to access your Linux files through your AppData folder, you are bypassing using the 9P server, which means that you will not have access to your Linux files, and you could possibly corrupt your Linux distro.

Where to file feedback

Our team is incredibly invested in hearing your feedback, in fact this whole feature was created based on our great community feedback! Please file any issues you that you may find on our Github page: https://github.com/Microsoft/WSL and we will do our best to address them.

We can’t thank the community enough for helping make WSL an amazing tool!

Improved wsl.exe command line experience

We’ve also improved the command line experience in this latest update by consolidating our commands to wsl.exe and adding more command line functionality. You can now use wsl.exe to perform all the necessary commands you would need to configure and control WSL on your machine. You can always check all the commands you can run from wsl.exe by running wsl.exe --help

New commands

We’ve also added some new commands that will give you more functionality when using wsl.exe.

You can now run commands as different users, terminate running distributions, and even export and import different distros! Exporting a distro is accomplished by passing in --export as an argument and will output a tar file of your current distro. For example, you could use this functionality to share your distro setup with other people. Additionally, if you pass in --import as an argument you can import a tar file that contains the root file system of a Linux distro, which allows you to import any distro you’d like, with any configuration you’d like.

--export <DistributionName> <FileName>
Exports the distribution to a tar file.
The filename can be – for standard output.

--import <DistributionName> <InstallLocation> <FileName>
Imports the specified tar file as a new distribution.
The filename can be – for standard input.

--terminate, -t <DistributionName>
Terminates the distribution.

Consolidated commands

The commands that existed inside of wslconfig.exe have been added to wsl.exe to allow you to configure your distros more easily. Our goal is to consolidate how you interact with WSL to a single binary.

You beat me to it !!! I was just going to ask if WSL was still in ongoing development or whether it was likely to "Go the way of the Dodo".
@slicendice

A few releases back I managed to get some sort of Linux GUI programs working as well -- not the full Linux GUI but a number of programs which ran with an X-Server. !!

Interested to try this again soon -- seems all is quiet on the Sandbox front too. I'll dig out my old notes when this comes out. I'm still enough of an old dinosaur to take a few notes (old fashioned way with biro and paper !!) -- as an engineer it's good practice since if one makes a load of changes it's difficult to actually fathom out what worked, what didn't and what either broke or fixed it. !!!! Old habits die hard.

Note also for Linux cmd's -- if you can install package ntfs-3g on the wsl interface then accessing Windows files (NTFS) from linux isn't a problem both at read / write level. FAT32 has been supported for years.

Also if you can get samba running on the WSL sharing should be a doddle -- even fully native Linux formatted HDD's such as xfs / ext4 etc.

I'd love to see if WSL can read a Linux software RAID array (mdadm) -- I'll have a go and test 2 small SSD's just for fun --can't wait for this release --something nice to play with --at last !!!!.

Cheers
jimbo

My ComputerYou need to have JavaScript enabled so that you can use this ...

I watched a video about the guy using Windows subsystem and run full Linux desktop without using remote software. There is no white thing on top. He can switch between Linux and Windows using a keyboard shortcut. Linux desktop is smooth, 60 fps, no...

About Us
Windows 10 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 10" and related materials are trademarks of Microsoft Corp.