Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2930

Win32 app can't open file on WSL file system - potential causes? #13409

$
0
0

I am facing a weird problem. In my corporate environment we have a proprietary Win32 CLI program (which I can't disclose a lot about and is also a black box to us) that I would like to invoke like this from inside WSL2:

foo.exe '\\wsl.localhost\Ubuntu\tmp\bar.baz'

This doesn't work: foo says it can't open \\wsl.localhost\Ubuntu\tmp\bar.baz

However, if I copy bar.baz to a different network share and execute

foo.exe '\\ourtrustynetworkshare\stuff\bar.baz'

foo.exe can work with the file just fine.I can also work with \\wsl.localhost\Ubuntu\tmp\bar.baz using different Win32 applications such as Notepad without any issues.Finally, creating a symbolic link on the C: drive or mapping \\wsl.localhost\Ubuntu to a drive letter doesn't help.

So to recap:

  • My file of interest on the WSL2 file system appears to be accessible to any Windows program using its UNC path
  • My application of interest can access files on a network share using a UNC path
    • ... but my application of interest for some bizarre reason can't access my file of interest, neither through a UNC path nor over a symbolic link on the system root to a UNC path

I was wondering whether anyone has some general knowledge on why Win32 programs could face these challenges and how this could be worked around

I thought about implementing a sort of "copy on read" scheme to copy the needed file to the Windows file system before invoking foo.exe but this could incur too high a performance penalty.

Thanks so much in advance for your input!


Viewing all articles
Browse latest Browse all 2930

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>