{"id":4576,"date":"2019-02-15T16:26:43","date_gmt":"2019-02-16T00:26:43","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/commandline\/?p=4576"},"modified":"2019-03-25T11:26:39","modified_gmt":"2019-03-25T18:26:39","slug":"whats-new-for-wsl-in-windows-10-version-1903","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/commandline\/whats-new-for-wsl-in-windows-10-version-1903\/","title":{"rendered":"What\u2019s new for WSL in Windows 10 version 1903?"},"content":{"rendered":"<p>The next Windows update is coming soon and we\u2019re 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.<\/p>\n<h2>Accessing Linux files from Windows<\/h2>\n<p>In the past, creating and changing Linux files from Windows resulted in losing files or corrupting data. Making this possible has been a highly requested and long anticipated feature. We\u2019re proud to announce you can now easily access all the files in your Linux distros from Windows.<\/p>\n<h3>Linux Files inside of File Explorer<\/h3>\n<p>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:<\/p>\n<pre>explorer.exe .<\/pre>\n<p>This will open a File Explorer window, showing the files located inside of your Linux distro&#8217;s filesystem:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindows.png\" alt=\"Accessing Linux distro filesystem from Windows\" width=\"955\" height=\"908\" class=\"alignnone size-full wp-image-4579\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindows.png 955w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindows-300x285.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindows-768x730.png 768w\" sizes=\"(max-width: 955px) 100vw, 955px\" \/><\/p>\n<p>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!<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindowsvscode-800x537.png\" alt=\"Accessing Linux distro files via VSCode\" width=\"800\" height=\"537\" class=\"alignnone size-full wp-image-4581\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindowsvscode-800x537.png 800w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindowsvscode-800x537-300x201.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindowsvscode-800x537-768x516.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h3>Improvements coming soon to the File Explorer experience<\/h3>\n<p>When using this feature you\u2019ll notice the distro files are exposed through the path: &#92;&#92;wsl$&#92;<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.<\/running_distro_name><\/p>\n<h2>In command line<\/h2>\n<p>WSL is primarily a command line tool, and so of course this feature also works in the command line. You can find your distro\u2019s files by accessing &#92;&#92;wsl$&#92;{distro name}&#92; where {distro name} is the name of a running distro. Here\u2019s what it looks like to access Debian with PowerShell.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindowsps.png\" alt=\"\" width=\"693\" height=\"394\" class=\"alignnone size-full wp-image-4580\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindowsps.png 693w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2019\/03\/linuxfromwindowsps-300x171.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/p>\n<h2>How it works<\/h2>\n<p>To put it briefly: a <a href=\"https:\/\/en.wikipedia.org\/wiki\/9P_%28protocol%29\">9P protocol file server<\/a> facilitates file related requests, with Windows acting as the client.<\/p>\n<p>We\u2019ve modified the WSL init daemon to initiate a 9P server. This server contains protocols that support Linux metadata, including permissions. A Windows service and driver that act 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 <a href=\"https:\/\/devblogs.microsoft.com\/commandline\/windowswsl-interop-with-af_unix\/\">this post<\/a>.<\/p>\n<h2>Known issues<\/h2>\n<p>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:<\/p>\n<ul>\n<li>Currently, the distros files will only be accessible from Windows when the distro is running. 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.<\/li>\n<li>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 &#92;&#92;wsl$\\Ubuntu\\home will not work (as CMD does not support UNC paths as current directories), however copy &#92;&#92;wsl$\\Ubuntu\\home\\somefile.txt C:\\dev\\ will work <\/li>\n<li><span style=\"color:red\"><a href=\"https:\/\/blogs.msdn.microsoft.com\/commandline\/2016\/11\/17\/do-not-change-linux-files-using-windows-apps-and-tools\/\">Do NOT access your Linux files via the AppData folder<\/a>!<\/span> If you try to access your Linux files through your AppData folder, you are bypassing using the 9P server, which means that you will likely corrupt your Linux files!<\/li>\n<\/ul>\n<h2>Where to file feedback<\/h2>\n<p>Our team is keen to hear your feedback. In fact WSL itself was created based on our great community feedback! Please file any issues you that you may find on our Github page: <a href=\"https:\/\/github.com\/Microsoft\/WSL\">https:\/\/github.com\/Microsoft\/WSL<\/a> and we will do our best to address them.<\/p>\n<p>We can\u2019t thank the community enough for helping make WSL an amazing tool!<\/p>\n<h2>Improved wsl.exe command line experience<\/h2>\n<p>We\u2019ve 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 &#8211;help<\/p>\n<h2>New commands<\/h2>\n<p>We\u2019ve also added some new commands that will give you more functionality when using wsl.exe.<\/p>\n<p>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 <strong>&#8211;export<\/strong> 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 <strong>&#8211;import<\/strong> 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\u2019d like, with any configuration you\u2019d like.<\/p>\n<p>Here is the full list of commands that we\u2019ve added to wsl.exe.<\/p>\n<ul>\n<li>&#8211;user, -u <username> Run as the specified user<\/username><\/li>\n<li>&#8211;export <distributionname> <filename> Exports the distribution to a tar file. The filename can be \u2013 for standard output. <\/filename><\/distributionname><\/li>\n<li>&#8211;import <distributionname> <installlocation> <filename> Imports the specified tar file as a new distribution. The filename can be \u2013 for standard input. <\/filename><\/installlocation><\/distributionname><\/li>\n<li>&#8211;terminate, -t <distributionname> Terminates the distribution. <\/distributionname><\/li>\n<\/ul>\n<h2>Consolidated commands<\/h2>\n<p>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.<\/p>\n<h3>Commands Added to wsl.exe from wslconfig.exe<\/h3>\n<ul>\n<li>&#8211;list , -l Lists all distributions available on your machine Can also contain further options: &#8211;all Lists all distributions, including distributions that are currently being installed or uninstalled \u2013running Lists only distributions that are currently running <\/li>\n<li>&#8211;setdefault, -s <distributionname> Sets the distribution as default. <\/distributionname><\/li>\n<li>&#8211;unregister <distributionname> Unregisters the distribution <\/distributionname><\/li>\n<li>&#8211;upgrade <distributionname> Upgrades the distribution to the WslFs file system format. <\/distributionname><\/li>\n<\/ul>\n<h2>Console improvements<\/h2>\n<p>The Windows Console team has also made some improvements that you\u2019ll notice when using WSL. The Console team will soon post an update of what\u2019s new in Windows 10 version 1903. Stay tuned!<\/p>\n<h2>Thanks and feedback<\/h2>\n<p>As always, we want to thank you for providing your feedback and encourage you to keep doing so! You can file issues on our Github at Microsoft\/WSL or reach out to Craig Loewen <a href=\"https:\/\/twitter.com\/craigaloewen\">@craigaloewen on Twitter<\/a>.<\/p>\n<p>We\u2019re looking forward to seeing the fantastic work that you\u2019ll do with this update.<\/p>\n<p>Sincerely,<\/p>\n<p>The WSL Team<\/p>\n<h2>Q&amp;A<\/h2>\n<ol>\n<li><strong>Why is the WSL resource name in the filepath called wsl$?<\/strong> Since wsl is a short acronym we realize that some resources on networks may already have that name. So we\u2019ve added a dollar sign, since a machine name can\u2019t have a dollar sign in it, which ensures that the name will be accessible with any existing network configuration.<\/li>\n<\/ol>\n<h2>Update Log:<\/h2>\n<p><strong>[2019-02-15]<\/strong> Updated the &#8216;How it works&#8217; section to detail that a P9 server is used, and not Plan 9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The next Windows update is coming soon and we\u2019re 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. Accessing Linux files from Windows In the past, creating and changing Linux files from Windows [&hellip;]<\/p>\n","protected":false},"author":2191,"featured_media":4579,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11,3,5,9],"tags":[67,70,72],"class_list":["post-4576","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-distros","category-linux-tools","category-windows-10","category-bash-on-ubuntu-on-windows","tag-whats-new","tag-windows-10","tag-wsl"],"acf":[],"blog_post_summary":"<p>The next Windows update is coming soon and we\u2019re 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. Accessing Linux files from Windows In the past, creating and changing Linux files from Windows [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/4576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/users\/2191"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/comments?post=4576"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/4576\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media\/4579"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media?parent=4576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/categories?post=4576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/tags?post=4576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}