Skip to content

WSL broken after system crash #251

Description

@jamesjuett

After an abrupt system crash, WSL on my machine completely failed to start. After quite a bit of searching and trying various things, I found a fix. I'm not sure whether it's worth adding something to the troubleshooting section in our tutorial, since it's not clear this is a common issue, but I'm going to at least record it here for posterity. (If someone can offer a second opinion then we can decide whether to add something or just close this issue.)

I first noticed this error popup from Docker Desktop (which itself is mostly unrelated, but it was trying to launch WSL2 and it's the first thing I noticed):

running wslexec: The system cannot find the file specified. Wsl/Service/RegisterDistro/CreateVm/HCS/ERROR_FILE_NOT_FOUND: c:\windows\system32\wsl.exe --import-in-place docker-desktop \appdata\local\docker\wsl\main\ext4.vhdx: exit status 0xffffffff (stderr: , stdout: The system cannot find the file specified. Error code: Wsl/Service/RegisterDistro/CreateVm/HCS/ERROR_FILE_NOT_FOUND , wslErrorCode: Wsl/Service/RegisterDistro/CreateVm/HCS/ERROR_FILE_NOT_FOUND)

I believe the underlying problem is the one mentioned in this Github issue:
microsoft/WSL#40488

The fix that worked for me was to download the most recent installer from here:
https://github.com/microsoft/WSL/releases/

I used the installer version that matched my local installation:

C:\Windows\System32>wsl --version
WSL version: 2.7.8.0
...

Download the installer, right click, select "Show more options" from the context menu, then click "repair".

This fixed the issues. CAUTION: "repair" preserves data, but other options like "uninstall" or "reset" may destroy data.

A few things I tried that did not work:

  • Various attempts to repair/reinstall Docker Desktop (it turned out WSL itself was the problem)
  • Rename the ext4.vhdx file and then restart Docker Desktop (it dutifully created a fresh version of this file, but ran into the same error)
  • wsl --update (the updater was convinced it had the latest version of the files - if there was a way to force a "fresh" update or to rollback, then re-update, that may have fixed it)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions