This is a well known error, but the common solutions don't seem to work and I'm also seeing something else that I think is new, I'll go through each troubleshooting step because I hope some of them will help identify this problem either for people who know how to solve the issue and for others having the same issue.
When I try to open the Debian app with WSL and whan I try to run wsl
commands in Powershell I get this error: The file cannot be accessed by the system.
. In my case WSL and Debian were installed on my system from the command line, a few days ago (I had reinstalled them because of an unrelated issue).
One of the common solutions is to look for the WSL app entry in the Windows Installed Apps
window, I can't see an entry for WSL there, but I see one for @{MicrosotCorporationll.WindowsSubsystemForLinux_2.1.5.0_x64_8wekyb3d8bbwe?ms-resource://MicrosoftCorporationll.WindowsSubsystemForLinux/Resources/AppName}
(this app is listed with 0 bytes of storage usage).
To sum up the possible solution I found so far:
- try to use the
repair
option from theInstalled Apps
Windows settings, I tried doing so for the app I mentioned above and for the Debian app, the repair reached 100% completion but it didn't work - try to use
dism
from an elevated terminal (DISM.exe /Online /Cleanup-image /Scanhealth
+DISM.exe /Online /Cleanup-image /Restorehealth
), the command ran successfully but it didn't work - try to change permissions for the folder
C:\Program Files\WindowsApps
from theProperties/Security
window, I'm not too sure what to change here but I've seen something that seems interesting (listed below)
From the properties of the WindowsApps
folder I see that the principal for my user seems to be corrupted, when I double click on it I get a window that shows the following error: This access control entry is corrupt. Delete it and create a new one.
This only applied to the "normal" user principal, not to admin entry for the same user. In fact, I then tried to launch WSL with administrator privileges and I could log into Debian without any issue.
Since this seems a file corruption issue I launched sfc scannow
which found a corruption error with C:\WINDOWS\System32\drivers\bthmodem.sys
and solved it, but I still see the error message in the WindowsApps
folder settings and I still can't use WSL without elevation privileges so I guess that was unrelated to this problem.
How can I repair my wsl installation and/or solve the issue with the security settings for my unprivileged user principal?