39

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
kshashank
  • 1,199

2 Answers2

70

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

Mac G
  • 1
kshashank
  • 1,199
6

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.