3

I have had the Windows Subsystem for Linux installed for a long time. Today, after a clean boot of my Windows 10, it fails to start, with the regular error message:

Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Press any key to continue...

In my %LOCALAPPDATA%\lxss, I see that WSL is still completely there. Can I somehow still start this? If not, if I perform a new installation, can I mount the old directories somehow in such a way that not just all data, but also all permissions etc. are visible, and move them to a new installation?

I shouldn't need to spell this out, but when WSL doesn't work, any back-up utility that has to be run from WSL also won't work.

I'm hesitant to just try lxrun /install for fear that it will nuke all of my data.


For no reason that I can tell, it started working again. I'd still like to know what happened and what fixed it, so that I know what to do if this happens again in the future.

7
  • Best you could do is backup %LOCALAPPDATA%/lxss. Ensure it also contains the home folder, or backup that too. Afterward it all depends on the destruction - you might need to uninstall and reinstall again.
    – harrymc
    Jun 18, 2018 at 8:31
  • Oddly, it started working again without me having done anything (knowingly, at any rate) to fix it. I'll leave this question up, I'd still like to know what happened, what I can do if this happens again, and what made it work again.
    – hvd
    Jun 18, 2018 at 8:39
  • 2
    Some knowledge is not meant for us mere mortals.
    – harrymc
    Jun 18, 2018 at 9:08
  • 2
  • @Biswapriyo No, not a duplicate of that. That assumes your WSL is still operable. Mine wasn't, so I'd have had no way to run tar or anything like that, unless I'd have done it from the Windows side, which wouldn't have preserved permissions etc.
    – hvd
    Jun 18, 2018 at 14:40

2 Answers 2

0

I understand that you have the root folder of your distribution, but you cannot run it using bash or wsl. I think you may try to register again your old installation folder using lxRunOffline


Registering an existing installation

# lxrunoffline register -n <distro name> -d <basepath>
C:> lxrunoffline register -n copy -d %LOCALAPPDATA%\Packages\...\LocalState

I think that the BasePath is the parent of your rootfs folder. For instance, if the root folder is

%LOCALAPPDATA%\Packages\...\LocalState\rootfs

The base path must be

%LOCALAPPDATA%\Packages\...\LocalState
1
  • These instructions should probably have a warning applied to them. I have a new copy of Ubuntu installed on my new machine and when I run this, it appears to just replace my new installation with my old backup installation without warning. Jun 17 at 5:24
0

I had an Ubuntu instance, and the path where I could recover my data was:

C:\Users\[username]\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_[someID]\LocalState\rootfs

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .