WSL icon indicating copy to clipboard operation
WSL copied to clipboard

wsl$ is invalid hostname

Open hetasanghvi-zz opened this issue 5 years ago • 2 comments

Windows Build Number

Microsoft Windows [Version 10.0.19042.985]

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

No response

Distro Version

Ubuntu-18.04

Other Software

You will have to install liveshare extension on the VSCode.

Repro Steps

  1. Open temirnal Ubuntu (WSL2)
  2. open VSC by 'code .'
  3. Try to start a live share
  4. see error, Share Failure: Invalid URI: The hostname could not be parsed

when we narrowed down this error we saw that the underlying issue is we have been passing, \\wsl$\Ubuntu-18.04\home, as path. if we look at UNC path $ is not valid character in hostname.

I can provide a little more insight into this. On Windows, network file paths are represented as \<share><path...> So when Windows mounts the WSL2 drive into the Windows filesystem, it is apparently mounted as a virtual network drive, in the form \wsl$<distro><path...>

However that seems to fail with a $ in the host name.

I am hoping to get some help here.

Expected Behavior

  1. Open temirnal Ubuntu (WSL2)
  2. open VSC by 'code .'
  3. Try to start a live share
  4. User able to do liveshare

Actual Behavior

Diagnostic Logs

No response

hetasanghvi-zz avatar May 14 '21 23:05 hetasanghvi-zz

Variation of #4308.

therealkenc avatar May 17 '21 20:05 therealkenc

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!