Bug 419813

Summary: Okular on Windows cannot open WSL 2 files
Product: [Applications] okular Reporter: wjb
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: wodsfort
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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.
Comment 2 Wodsfort 2025-08-12 17:58:13 UTC
Now all works  fine with Windows 10 22H2(19045.5131) and Okular 25.07.70.Please,update okular+windows,if you will see problem after updating ,reopen this big