This question was originally posted on Ask Ubuntu here, but since it turns out to be common to non-Ubuntu WSL distributions (and even non-WSL apps), I was asked to recreate it here on Super User. The original will be closed, but it's still there for reference for now. Please direct all comments and answers to this Super User question.
After installing an app from the Microsoft Store on Windows 10, it initially works. However, when I restart Windows, the app is gone. It does not appear in the Start Menu any longer. What could be causing this?
I originally noticed the problem when installing Ubuntu 20.04 using WSL2 from the Microsoft Store. It worked fine when the system was running, but on restart it was uninstalled or disappeared. I could reinstall it again, and it would work, but each reboot would cause it to disappear again.
From the comments, we determined that:
WSL itself was still installed. The
wsl -l -vcommand worked, but showed:Windows Subsystem for Linux has no installed distributionsBefore rebooting, however, it correctly showed Ubuntu 20.04 at version 2.
Also, the Store packages seem to be uninstalled entirely.
After installing Ubuntu, running
Get-ChildItem -Recurse 'C:\Program Files\WindowsApps\' | Where-Object {$_.Name -eq 'install.tar.gz' } | ForEach-Object { $_.Directory.BaseName }in PowerShell results in:ConicalGroupLimited.Ubuntu20.04onWindows_2004_2021.825.0_x64__79rhkplfndgscBut after rebooting, it shows no results.
The same problem occurs with Ubuntu 18.04.
And then we found that the same problem occurs even with non-WSL apps installed from the Store.