Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I map a \\wsl$\ type unc path to a windows drive letter?

I'm using eclipse on windows to connect to files on a wsl, and I have run into what is apparently an eclipse bug which file names such as \wsl$\folder1\pom.xml get mangled. https://bugs.eclipse.org/bugs/show_bug.cgi?id=577938

A comment in the bug report suggests a possible workaround

A workaround is to map the UNC path to a drive letter, but this shouldn't be necessary

How would I do that?

like image 978
Gonen I Avatar asked Aug 31 '25 22:08

Gonen I


1 Answers

I did it this way (drive j: was available)

net use j: \\wsl$\Ubuntu

Note that this is persistent, and if not deleted can cause wsl2 to restart by itself. After doing this I was able to access files on the Ubuntu distro from windows emacs.

to delete it:

net use /del j:
like image 87
ian Avatar answered Sep 05 '25 05:09

ian