Windows 10: Access WSL Linux Files in Windows 10

Discus and support Access WSL Linux Files in Windows 10 in Windows 10 Tutorials to solve the problem; How to: Access WSL Linux Files in Windows 10 How to Access Linux Files in a Windows Subsystem for Linux (WSL) Distro from Windows 10 The Windows... Discussion in 'Windows 10 Tutorials' started by WinLatest, Jun 2, 2018.

  1. WinLatest New Member

    Access WSL Linux Files in Windows 10


    How to: Access WSL Linux Files in Windows 10

    How to Access Linux Files in a Windows Subsystem for Linux (WSL) Distro from Windows 10


    The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows, alongside your traditional Windows desktop and modern store apps.

    When you have export and import WSL distros.

    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.

    Starting with Windows 10 build 18342, Microsoft added the ability for users to access Linux files in a WSL distro from Windows 10. These files can be accessed through the command line, and also Windows apps, like File Explorer, VSCode, etc. can interact with these files.

    Linux files for a running WSL distro are located at \\wsl$\<distro_name>.

    *Warning Known issues

    This is a new feature, and some pieces of it may not work perfectly. Here are some known issues that Microsoft wants 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.
    See also:

    This tutorial will show you how to access all the Linux files of a Windows Subsystem for Linux (WSL) distro from Windows 10.


    CONTENTS:
    • Option One: Access Linux Files in File Explorer from Running WSL Distro
    • Option Two: Access Linux Files of Running WSL Distro in File Explorer
    • Option Three: Access Linux Files of Running WSL Distro in PowerShell




    OPTION ONE [/i] Access Linux Files in File Explorer from Running WSL Distro
    1. Open the WSL distro (ex: "Ubuntu") you want, and make sure your current folder is your Linux home directory.

    2. Copy and paste explorer.exe . in the WSL distro console window, and press Enter. (see screenshot below)

    Access WSL Linux Files in Windows 10 [​IMG]

    3. File Explorer will now open directly to the Linux files for this WSL 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. (see screenshot below)

    Access WSL Linux Files in Windows 10 [​IMG]






    OPTION TWO [/i] Access Linux Files of Running WSL Distro in File Explorer
    1. Open File Explorer (Win+E).

    2. Click/tap on Linux in the navigation pane of File Explorer, and click/tap on the Distros shortcut. (see screenshot below)

    Access WSL Linux Files in Windows 10 [​IMG]

    3. Click/tap on the running WSL distro (ex: "Ubuntu") you want to see the files for. (see screenshot below)

    Access WSL Linux Files in Windows 10 [​IMG]

    4. Click/tap on the Home folder. (see screenshot below)

    Access WSL Linux Files in Windows 10 [​IMG]

    5. Click/tap on the <username> folder of the user (ex: "brink") you want for this WSL distro (ex: "Ubuntu") . (see screenshot below)

    Access WSL Linux Files in Windows 10 [​IMG]

    6. You will now see the Linux files of the user for this WSL 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. (see screenshot below)

    Access WSL Linux Files in Windows 10 [​IMG]






    OPTION THREE [/i] Access Linux Files of Running WSL Distro in PowerShell
    1. Open a elevated PowerShell.

    2. Copy and paste the wsl --list --running into PowerShell, and press Enter to see all currently running WSL distros. Make note of the WSL distro name (ex: "Ubuntu") you want to access files for. (see screenshot below)

    3. Type the command below into PowerShell, and press Enter to change to the WSL distro's directory.
    *Arrow cd \\wsl$\<DistributionName>

    *note Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Ubuntu") you wanted from step 2.

    For example: cd \\wsl$\Ubuntu

    4. Type ls at the prompt, and press Enter to list the directory above.

    5. You can now access your Linux files as usual in PowerShell.


    Access WSL Linux Files in Windows 10 [​IMG]


    That's it,
    Shawn


    Related Tutorials

    :)
     
    WinLatest, Jun 2, 2018
    #1
  2. Brink Win User

    A Deep Dive Into How WSL Allows Windows 10 to Access Linux Files

    Source: https://devblogs.microsoft.com/comma...s-linux-files/



    Access WSL Linux Files in Windows 10 [​IMG]
    Tip How to Enable or Disable Windows Subsystem for Linux (Bash on Ubuntu) in Windows 10

    How to Access Linux Files in a Windows Subsystem for Linux (WSL) Distro from Windows 10
     
    Brink, Oct 27, 2019
    #2
  3. Brink Win User
    A Deep Dive Into How WSL Allows Windows 10 to Access Linux Files

    Source: https://devblogs.microsoft.com/comma...s-linux-files/



    Access WSL Linux Files in Windows 10 [​IMG]
    Tip How to Enable or Disable Windows Subsystem for Linux (Bash on Ubuntu) in Windows 10

    How to Access Linux Files in a Windows Subsystem for Linux (WSL) Distro from Windows 10
     
    Brink, Oct 27, 2019
    #3
  4. Access WSL Linux Files in Windows 10

    Windows Subsystem Linux

    Hello,

    We would like to know more about the issue you're experiencing with using
    Windows Subsystem for Linux
    . Kindly answer the following questions:

    • Are you developing a program, an app, or a software for Linux?
    • Is your Window 10 PC connected to a domain?
    • Are you managing a Windows Server PC?
    • What troubleshooting steps have you tried so far?
    • Can you tell us the Version and OS build of your Windows 10 device? You can find this information by clicking the
      Start button, type About your PC, and then press
      Enter.

    We need the following information in order to determine if we need to refer your concern to the
    TechNet forums or the Microsoft Developer Network (MSDN) forums.

    For now, we suggest reviewing these support articles to find out if there's an issue with the installation of
    Windows Subsystem for Linux:


    We'll be waiting for your response.
     
    Devlin Sco, Oct 27, 2019
    #4
  5. Ahhzz Win User
    Windows 10 Tweaks

    Pressing “Windows+Pause Break” (it’s up there next to scroll lock) opens the “System” Window.

    Windows 10: In the new version of Windows, Explorer has a section called Quick Access. This includes your frequent folders and recent files. Explorer defaults to opening this page when you open a new window. If you’d rather open the usual This PC, with links to your drives and library folders, follow these steps:

    • Open a new Explorer window.
    • Click View in the ribbon.
    • Click Options.
    • Under General, next to “Open File Explorer to:” choose “This PC.”
    • Click OK


    credit to Lifehacker.
     
    Ahhzz, Oct 27, 2019
    #5
  6. John Zab Win User
    How to Access USB Drives via WSL

    Hi Gagan,

    To better assist you regarding with USB drive issue, we just want to confirm if you're referring to Windows Subsystem for Linux?

    If you do, we suggest that you check this
    article
    for more information.

    Keep us posted.
     
    John Zab, Oct 27, 2019
    #6
Thema:

Access WSL Linux Files in Windows 10

Loading...
  1. Access WSL Linux Files in Windows 10 - Similar Threads - Access WSL Linux

  2. WSL Windows Subsystem For Linux "wsl" command not found

    in Windows 10 Gaming
    WSL Windows Subsystem For Linux "wsl" command not found: Guys help, I've contacted ms support multiple times and none of the agents have been able to solve the issue.so, I have Windows Subsystem for Linux WSL with Ubuntu installed. yesterday, i tried to install docker, and it was kind of a mess, so i just uninstalled it in every...
  3. WSL Windows Subsystem For Linux "wsl" command not found

    in Windows 10 Software and Apps
    WSL Windows Subsystem For Linux "wsl" command not found: Guys help, I've contacted ms support multiple times and none of the agents have been able to solve the issue.so, I have Windows Subsystem for Linux WSL with Ubuntu installed. yesterday, i tried to install docker, and it was kind of a mess, so i just uninstalled it in every...
  4. WSL Windows Subsystem For Linux "wsl" command not found

    in Windows 10 BSOD Crashes and Debugging
    WSL Windows Subsystem For Linux "wsl" command not found: Guys help, I've contacted ms support multiple times and none of the agents have been able to solve the issue.so, I have Windows Subsystem for Linux WSL with Ubuntu installed. yesterday, i tried to install docker, and it was kind of a mess, so i just uninstalled it in every...
  5. windows 10 subsystem linux wsl on desktop

    in Windows 10 Gaming
    windows 10 subsystem linux wsl on desktop: Has anyone been able to get the sub-system Linux to run on Windows 10 desktop? I have followed different tutorials but to date none of them have actually opened Ubuntu in Windows 10. Just curious to know if it can be made to work....
  6. windows 10 subsystem linux wsl on desktop

    in Windows 10 Drivers and Hardware
    windows 10 subsystem linux wsl on desktop: Has anyone been able to get the sub-system Linux to run on Windows 10 desktop? I have followed different tutorials but to date none of them have actually opened Ubuntu in Windows 10. Just curious to know if it can be made to work....
  7. windows 10 subsystem linux wsl on desktop

    in Windows 10 Software and Apps
    windows 10 subsystem linux wsl on desktop: Has anyone been able to get the sub-system Linux to run on Windows 10 desktop? I have followed different tutorials but to date none of them have actually opened Ubuntu in Windows 10. Just curious to know if it can be made to work....
  8. WSL Linux for Windows 10

    in Windows 10 Virtualization
    WSL Linux for Windows 10: Hi, Just curious if anyone here has tried or uses the WSL Virtualization for Linux for Windows10? I am curious to see how Ubuntu 20.04 LTS will look in Windows10. I'm just curious... 181521
  9. WSL and Linux apps

    in Windows 10 Software and Apps
    WSL and Linux apps: Hey there Linux enthusiasts! I wonder what you think about this Windows Subsystem for Linux and which apps you installed. I installed openSUSE from Microsoft store (sounds weird right? *Biggrin) just to check the feature out. So far I can only play around with Linux commands...
  10. A Deep Dive Into How WSL Allows Windows 10 to Access Linux Files

    in Windows 10 News
    A Deep Dive Into How WSL Allows Windows 10 to Access Linux Files: Three months ago, we announced that the Windows Subsystem for Linux will be able to access Linux files from Windows in the blog post: What’s new for WSL in Windows 10 version 1903, and in today’s post we will be showing you how we made these changes possible. Let’s jump in!...