0% found this document useful (0 votes)
125 views

Access Linux Filesystems in Windows and WSL 2 - Windows Command Line

Computer

Uploaded by

Bobby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views

Access Linux Filesystems in Windows and WSL 2 - Windows Command Line

Computer

Uploaded by

Bobby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

9/11/2020 Access Linux filesystems in Windows and WSL 2 | Windows Command Line

DevBlogs
Windows Command Line
Product Blogs

DevOps

Access Linux
Languagesfilesystems in Windows and WSL 2

.NET Avatar
Pierre
Platform Development
September 10th, 2020

Data Development   

Starting with Windows Insiders preview build 20211, WSL 2 will be offering a new
feature: wsl --mount. This new parameter allows a physical disk to be attached and
mounted inside WSL 2, which enables you to access filesystems that aren’t natively
supported by Windows (such as ext4).

So, if you’re dual booting with Windows & Linux using different disks, you can now
access your Linux files from Windows!

Getting started
To mount a disk, open a PowerShell window with administrator privileges and run:

wsl --mount <DiskPath>

To list the available disks in Windows, run:

wmic diskdrive list brief

To unmount and detach the disk from WSL 2, run

wsl --unmount <Diskpath>

The disks paths are available under the ‘DeviceID’ columns. Usually under the
\\.\\\.\PHYSICALDRIVE* format. Below is an example of mounting a specific partition of
a given hard disk into WSL and browsing its files.

Accessing these files with File Explorer


Once mounted, it’s also possible to access these disks through the Windows explorer by
navigating to \wsl$ and then to the mount folder.
https://devblogs.microsoft.com/commandline/access-linux-filesystems-in-windows-and-wsl-2/ 1/4
9/11/2020 Access Linux filesystems in Windows and WSL 2 | Windows Command Line

Limitations
By default, wsl --mount attempts to mount the disk as ext4. To specify a filesystem, or
for more advanced scenarios, check out Mount a disk in WSL 2.

Also please note that this feature comes with the limitation that only physical disks can
be attached to WSL 2. At this time, it’s not possible to attach a single partition. More
details on the limitations here.

Give us your feedback!


If you run into any issues, or have feedback for our team please file an issue on our
Github , and if you have general questions about WSL you can find all of our team
members that are on Twitter on this twitter list.

Avatar Pierre Boulay


Software Engineer II, Linux on Windows

Posted in Command Line

Read next

Building Windows Terminal with WinUI Windows Terminal Preview 1.3 Release
WinUI and Windows Terminal have a strong relationship We are back with another release for Windows Terminal
that goes back to the origins of Windows Terminal. This and Windows Terminal Preview! This release adds all of
blog post goes into the history and architecture of how ... the 1.2 features into Windows Terminal and introduces
new ...
Av
Kayla Cinnamon September 8, 2020 Av
ata
Kayla Cinnamon August 26, 2020
r ata
r
3 comments
10 comments

https://devblogs.microsoft.com/commandline/access-linux-filesystems-in-windows-and-wsl-2/ 2/4
9/11/2020 Access Linux filesystems in Windows and WSL 2 | Windows Command Line

2 comments

Log in to join the discussion.

Avatar JinShil September 10, 2020 6:45 pm  

But, can you edit the files?

 Log in to Reply

Avatar Ascii Wolf September 11, 2020 2:32 am  

Cool! Now, if only SFTP support was added to Explorer as well, I would be happy. 🙂

 Log in to Reply

Topics

Accessibility AF_UNIX ANSI/VT Sequences automount background tasks Bash BASIC Buffers Build2017 Build2019 Build2020 chmod

Chocolatey cmd Color Command-Line ConPTY Console containers Creators Update daemons DrvFs DvfFs Encoding filesystem

font ifconfig inotify interop Linux LinuxTools metadata MS-DOS networking Open-Source OpenSSH PowerShell PseduoConsole

Pseudo Console PTY release Rendering settings sockets Store Syscalls Tabs & Sets Teletype Terminal Themes Tmux TTY

Ubuntu Unicode UTF-8 VIntage Visual Studio What's New Win10S Windows Windows 10 Windows 10 S Windows Package Manager

winget winget.exe winui WSL wslconf Zoom

Top Bloggers

Kayla Cinnamon
Program Manager

Craig Loewen
Program Manager

Demitrius Nelon
Senior Program Manager

Rich Turner
Sr. Program Manager

Mike Battista
Senior Program Manager

Archive

September 2020
August 2020
July 2020
https://devblogs.microsoft.com/commandline/access-linux-filesystems-in-windows-and-wsl-2/ 3/4
9/11/2020 Access Linux filesystems in Windows and WSL 2 | Windows Command Line

June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019

Stay informed

What's new Microsoft Store Education Enterprise Developer Company


Surface Go 2 Account profile Microsoft in education Azure Microsoft Visual Studio Careers

Surface Book 3 Download Center Office for students AppSource Windows Dev Center About Microsoft

Microsoft 365 Microsoft Store support Office 365 for schools Automotive Developer Center Company news

Surface Pro X Returns Deals for students & Government Microsoft developer Privacy at Microsoft
parents program
Windows 10 apps Order tracking Healthcare Investors
Microsoft Azure in Channel 9
Store locations education Manufacturing Diversity and inclusion
Office Dev Center
Virtual workshops and Financial services Accessibility
training Microsoft Garage
Retail Security
Microsoft Store Promise

 English (United States) Sitemap Contact Microsoft Privacy & cookies Terms of use Trademarks Safety & eco About our ads © Microsoft 2020

https://devblogs.microsoft.com/commandline/access-linux-filesystems-in-windows-and-wsl-2/ 4/4

You might also like