33

I have uninstalled wsl on my windows 11 and trying to re-install using wsl --install. After restart i am getting following error

    Failed to attach disk 'C:\Users\<User>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The system cannot find the file specified.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND

2 Answers 2

63

From the WSL Github issue on the topic and the resulting discussion thread:

  1. List the distributions installed, by running following in PowerShell.

    wsl -l
    
  2. Unregister the distribution. Replace the "Ubuntu" below with your distribution name found in Step #1:

    WARNING: THIS COMMAND WILL COMPLETELY UNINSTALL YOUR WSL DISTRO.

    wsl --unregister Ubuntu
    
  3. Launch the Ubuntu (or other distribution) which was installed using Microsoft Store

5
  • 1
    Right on the money @kshashank! Much appreciated ^^
    – brasoares
    Commented Mar 6, 2023 at 23:06
  • 3
    Just a heads up: this command will completely uninstall your WSL distro... I learned this the hard way.
    – Tropilio
    Commented Apr 12, 2023 at 10:34
  • It's a terrible solution and no warning given about it uninstalling your distro. Thankfully I was not stupid enough to do it.
    – Andrew S
    Commented Jan 18 at 5:27
  • @AndrewS Were you able to fix it without losing the distro. I agree this solution is terrible
    – warmwhisky
    Commented Jan 20 at 8:22
  • @warmwhisky, I gave up and installed wsl on my new Windows 11 machine leaving my older Windows 10 broken.
    – Andrew S
    Commented Jan 21 at 3:25
2

There are a couple issues on Github regarding this problem: This one, that one, and this other.

The solution is to download the installer and downgrade manually to another version: 2.1.4.0 fixed it for me. You don't have to completely remove your WSL distro.

You can find the releases here.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Mar 14 at 17:01

You must log in to answer this question.

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