Bug 419813 - Okular on Windows cannot open WSL 2 files
Summary: Okular on Windows cannot open WSL 2 files
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-07 19:30 UTC by wjb
Modified: 2020-04-30 21:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wjb 2020-04-07 19:30:13 UTC
SUMMARY

This might be more of a wish than a bug but: Okular doesn't seem to handle WSL 2 paths correctly, and thus cannot open files on WSL 2.


STEPS TO REPRODUCE
1. Set Okular as your default PDF reader
2. In Explorer, open a PDF that is in your WSL 2 image. The explorer path will be "\\wsl$\<wsl-name>\path\to\file.pdf".
3. Okular reports an error: "Could not open file:///<wsl-name>/path/to/file.pdf"

OBSERVED RESULT

Cannot open WSL 2 files at all.

EXPECTED RESULT

Can open WSL 2 files normally.


SOFTWARE/OS VERSIONS
Windows: 10


ADDITIONAL INFORMATION

I thought this might be due to handling of Windows network paths incorrectly, since the WSL acts like a network path, but I could access network files correctly so maybe not.
Comment 1 wjb 2020-04-30 21:18:58 UTC
I found a workaround that suggests this may have something to do with the WSL 2 path. If we remount WSL 2 as a drive explicitly, we can open files using Okular.

1. Navigate to `\\wsl$` in Explorer.
2. Right click on the `<wsl-name>` folder and click "Map network drive...".
3. Mount the folder as a new drive, such as `Z:`.
4. Open the same PDF from `Z:path\to\file.pdf` instead of from `\\wsl$\<wsl-name>\path\to\file.pdf`. It will open correctly.