Skip to content

Handle the new WSL filesystem path for the last Windows Build #17640

@fMichaleczek

Description

@fMichaleczek

Summary of the new feature / enhancement

The PR #13120 added a feature on Windows so that the paths of scripts hosted in WSL are recognized as in the computer security zone.

Over the last builds of WSL, paths have been added:

WSL Release Change (default in bold)

Initial 20175 21354
\\wsl$ \\wsl$ \\wsl$\
\\wsl \\wsl.localhost
  • WSL Build 20175 :

  • WSL Build 21354 :

    • Switch the \\wsl prefix to \\wsl.localhost to avoid issues when there is a machine on the network named "wsl".
    • \\wsl$ will continue to work.
      WSL/release-notes#build-21354

#13106 is came back depending on Windows version and channel.

Proposed technical implementation details (optional)

  • Append the path \\wsl.localhost to the computer security zone.

internal const string WslRootPath = @"\\wsl$";

  • Support both path :
# Execute a script inside the home Ubuntu-20.04
pwsh.exe -file '\\wsl$\Ubuntu-20.04\home\flavien\test.ps1'
pwsh.exe -file '\\wsl.localhost\Ubuntu-20.04\home\flavien\test.ps1'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Securitysecurity related areas such as JEA

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions