X
Tech

Next Windows update brings better Linux integration

The Windows 10 April 2019 Update boasts many improvements, not least of which is Windows Subsystem for Linux's new ability to let you access Linux files safely from Windows.
Written by Steven Vaughan-Nichols, Senior Contributing Editor

One of Windows Subsystem for Linux's more annoying tricks is it's hard to get at your Linux files from Windows. Oh, you can do it, but you take a real chance of ruining the files. To quote Microsoft, "DO NOT, under ANY circumstances, access, create, and/or modify files in your distro's filesystem using Windows apps, tools, scripts, consoles, etc." 

In the forthcoming Windows 10 April 2019 Update, aka Windows 10 19H1, this Linux file problem will finally be fixed.

According to Craig Loewen, a Microsoft programming manger working on Windows Subsystem for Linux (WSL), "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."

With this latest update, you'll be able to "easily access all the files in your Linux distros from Windows." It works by running a  9P protocol file server in your Linux instance. This is a distributed file network protocol. In WSL, it enables you to work with Linux files and file systems while supporting their metadata and permissions. Windows file programs act as clients to the server. These communicate with each other using AF_Unix sockets. Linux uses AF_Unix to communicate between processes.

If the technical details leave you with your eyes glazing over, don't worry about it. Accessing Linux files from Windows will be easy.

For example, to use File Explorer, start running Linux, make sure your current folder is your Linux home directory, and type in "Explorer." When it's launched, you're ready to go. You will also be able to use most Windows file commands on the Linux files.

Straight from Windows you can find your distro's files by accessing \\wsl$\{distro name}\ where {distro name} is the name of a running distro.

You still won't be able to access your WSL files if Linux isn't running. That will come in a later Windows 10 release. I doubt we'll see it in this forthcoming version.


Must read


There are other issues you should be wary of as well. First, since you're using a network protocol to access your local Linux files, all the usual rules for accessing network resources apply, For instance, the command CMD cd \\wsl$\Ubuntu\home won't work since CMD doesn't support UNC paths as current directories. You also can't safely access your Linux files within the AppData folder. If you try that, you're bypassing the 9P server, and you're in real danger of corrupting the files. Indeed, you might wreck your Linux instance.

While the file improvement is the biggest improvement, there are other significant new command line features. These include being able to run commands as different users, terminate running distributions, and export and import different distros.

With the last, you'll be able to export a tar file of your current distro. With this, you can then share your distro setup with other people. They could then import a tar file so they could run their own instance of your customized distro.

WSL has always been useful. With this latest revision, it will be even handier than ever.

Linux survival guide: These 21 applications let you move easily between Linux and Windows

Related Stories:

Editorial standards