Errorcode:Wsl/Service/CreateInstance/MountVhd/HCS/ERROR_FILE_NOT_FOUND

Encountering this error after installing Ubuntu on WSL (Windows Subsystem for Linux)?
Failed to attach disk‘C:\Users\amar\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04LTS_79rhkp1fndgsc\LocalState\ext4.vhdx’ to WSL2: The system cannotfind the file specified.

Launching ubuntu

Error code:
Wsl/Service/CreateInstance/MountVhd/HCS/ERROR_FILE_NOT_FOUND

Solution: You can solve this by Unregister Linux Distributions.

How to Unregister a Linux Distribution in WSL:

  1. Open Windows PowerShell as Administrator.
  2. List Installed Linux Distributions:
  • Run the following command:
    wsl -l
  1. Unregister the Distribution:
  • Run the command below, replacing Ubuntu with your specific distribution name:
    wsl --unregister Ubuntu
    WSL_ubuntu_3
  • You should see a message: The operation completed successfully.

This should help you manage your WSL distributions.

Open the Ubuntu that you installed using WSL

Ubuntu
Ubuntu

This is how you solve the issue. Enjoy your coding!

Leave a Comment