WSL: Can't open windows programs in WSL2 that is not under the /mnt/c directory

Version

Microsoft Windows [Version 10.0.19042.1348]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.16

Distro Version

Ubuntu-20.04

Other Software

Any Windows software that you can launch with WSL2 Aka the commands like code

Repro Steps

  1. Leave PC on for a very long time (Around a few hours)
  2. Then try to run code
  3. Program does not launch open and you have to Ctrl C out of it.

Expected Behavior

Program should launch open, even when leaving my computer on for a very long time.

Actual Behavior

When running a command like code, it will show no message nor the windows program will appear.

Diagnostic Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 15 (1 by maintainers)

Most upvoted comments

frhun told me to check to see if mono is installed on ubuntu. They told me that mono installs a binary handler.

I was told to do apt list --installed | grep mono to see if mono was installed. This is the output I then got:

ubuntu-mono/focal,now 19.04-0ubuntu3 all [installed,automatic]

After that I was then told to run this command sudo apt remove ubuntu-mono

Now I can run windows programs again on wsl2 anywhere. I’m not sure if this will work for other people.

Adding what I’ve found:

  • You can only open a Windows exe two or three times before it stops
  • Restarting WSL via wsl --shutdown or wsl --terminate does not help
  • Full reinstall of the distro using wsl --unregister does not help
  • A full reboot of the host Windows OS is required to get applications to start working again for a short time
  • An strace between a working (/mnt/c) and non-working (/home/) showed nothing but an exec and then output stops
  • Distribution isn’t a factor, used Ubuntu 20.04 and 21.04 community preview and both had the same issue (I can’t remember if one breaking also meant the other breaking however, I think it did but I’m not 100%)

Now some good news however, I’ve narrowed it down to Windows Subsystem for Linux Preview from the Microsoft Store. If you go into apps, uninstall it and reboot then launching apps from non-Windows dirs will stay working. I’m at 12+ hours of exe’s launching.