7

I've seen related questions, but none offer the answer to my question. I ask because, whenever I invoke xdg-open from the command line, I get the following error instructing me to enable WSL Interoperability. I tried opening a PNG file and a PDF file. Both present me with the same message.

I'm on Ubuntu 22.04.

$ xdg-open IMG_20220629_131736841.jpg 
$ grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
WSL Interopability is disabled. Please enable it before using WSL.
grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
[error] WSL Interoperability is disabled. Please enable it before using WSL.
/usr/bin/wslview: line 216: /mnt/c/Windows/System32/reg.exe: No such file or directory
/usr/bin/wslview: line 308: [: -ge: unary operator expected
[error] This protocol is not supported before version 1903.
Rinzwind
  • 309,379

2 Answers2

9

Running the following command worked on Kubuntu 22.04 with a newly upgraded Plasma version 5.25.5:

sudo apt purge wslu
0

Delete the file /usr/share/applications/wslview.desktop.

I hit this too on a fresh Ubuntu 22.04.1 LTS release.

I deleted the file /usr/share/applications/wslview.desktop and xdg-open started to work as expected.

I don't know what exactly happens but it seems that the wslview.desktop launcher is meant for using Ubuntu in Windows WSL. But for some reason it's launched for every xdg-open invocation. When it's removed, xdg-open will use another launcher associated with the URL, the correct one.