Skip to content

Cannot change directory into wsl distro  #15773

Closed

Description

@clayms

Prerequisites

Steps to reproduce

This issue was supposedly fixed #10674

However, I am still seeing the exact same issue described in #10360 and #15497.

Expected behavior

PS C:\Users> cd //wsl$/fedoraremix/
PS Microsoft.PowerShell.Core\FileSystem::\\wsl$\fedoraremix>

Actual behavior

PS C:\Users> cd //wsl$/fedoraremix/
Set-Location: Cannot find path '//wsl$/fedoraremix/' because it does not exist.

Error details

Set-Location: Cannot find path '//wsl$/fedoraremix/' because it does not exist.

Environment data

PS> $psversiontable

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.7
PSEdition                      Core
GitCommitId                    7.2.0-preview.7
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

and

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}       
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. added
    Needs-Triage
    on Jul 14, 2021
  2. added
    Area-FileSystem-Provider
    on Jul 14, 2021
  3. iSazonov commented on Jul 14, 2021

    @iSazonov
    Collaborator

    Do you see the issue without final '/'?

  4. clayms commented on Jul 14, 2021

    @clayms
    Author

    Ilya (@iSazonov)
    Yes. All of the following return the same error

    • cd //wsl$/fedoraremix/
    • cd //wsl`$/fedoraremix/
    • cd "//wsl$/fedoraremix/"
    • cd "//wsl`$/fedoraremix/"
    • cd "//wsl$/fedoraremix"
    • cd "//wsl`$/fedoraremix"
    • cd //wsl$/fedoraremix
    • cd //wsl`$/fedoraremix
  5. vexx32 commented on Jul 14, 2021

    @vexx32
    Collaborator

    I thought you needed to target \\wsl$\distro rather than //wsl$/distro? I know Windows is usually indifferent to what slashes you use, but I thought the \\ prefix was specifically backslashes?

  6. rkeithhill commented on Jul 14, 2021

    @rkeithhill
    Collaborator

    Both backward and forward slashes work for me:

    PS> dir //wsl$/Ubuntu
    
            Directory: \\wsl$\Ubuntu
    
    
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d----        11/21/2019   6:51 PM                bin
    d----         9/22/2017  10:15 AM                boot
    d----          7/9/2021  12:16 PM                dev
    d----          7/9/2021   5:12 PM                etc
    ...
    
  7. iSazonov commented on Jul 15, 2021

    @iSazonov
    Collaborator

    Keith Hill (@rkeithhill) Please share your Windows version.

    clayms Is WSL running in your test?

  8. rkeithhill commented on Jul 15, 2021

    @rkeithhill
    Collaborator

    I'm using 21H1 (10.0.19043).

  9. clayms commented on Jul 15, 2021

    @clayms
    Author

    Ilya (@iSazonov)
    Yes, in another shell, because I thought it had to be actively running. So I started it in another shell on the same computer and left it running before I started another shell and tried to cd into the wsl directories.

    However, I just found out that I have to run wsl in the exact same shell session that I want to cd into the wsl directories. After exiting wsl back to PowerShell can I then successfully cd into the wsl directories from that session and only that session. It does not matter how many other active wsl sessions are running on the same computer.

  10. SteveL-MSFT commented on Aug 4, 2021

    @SteveL-MSFT
    Member

    This is working for me without starting wsl in the same process. If this still repros for you, try from cmd.exe and see if it repros to determine if it's WSL.

  11. added
    Needs-Repro
    and removed
    Needs-Triage
    on May 16, 2022
  12. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  13. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  14. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  15. added
    Resolution-No Activity
    on Nov 16, 2023
  16. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

  17. Thynix commented on Sep 22, 2026

    @Thynix

    For what it's worth to other people from the future, this now works for me:

    PS C:\Users\Steve> cd \\wsl$\Ubuntu-20.04
    PS Microsoft.PowerShell.Core\FileSystem::\\wsl$\Ubuntu-20.04>
    
    > $psversiontable
    
    Name                           Value
    ----                           -----
    PSVersion                      5.1.26100.9444
    PSEdition                      Desktop
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    BuildVersion                   10.0.26100.9444
    CLRVersion                     4.0.30319.42000
    WSManStackVersion              3.0
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FileSystem-ProviderNeeds-ReproResolution-No Activity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions