When you reinstall Ubuntu on WSL (Windows Subsystem for Linux), you might encounter an error message preventing the system from booting.
eg: Failed to attach disk 'C:\Users\ahaya\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The specified file could not be found.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Failed to attach disk 'C:\Users\ahaya\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The specified file could not be found.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Failed to attach disk 'C:\Users\ahaya\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The specified file could not be found.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Press any key to continue...
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Failed to attach disk 'C:\Users\ahaya\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The specified file could not be found.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Failed to attach disk 'C:\Users\ahaya\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The specified file could not be found.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Press any key to continue...
1. Launch Windows PowerShell (No Need Administrator)
2. Run "wsl -l" in PowerShell to get the registered distribution
eg: PS C:\Users\Name> wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
3. Unregister Ubuntu.
Run wsl --unregister Ubuntu in PowerShell to unregister Ubuntu.
eg: PS C:\Users\User> wsl --unregister Ubuntu
Unregistering.
The operation completed successfully.
Unregistering.
The operation completed successfully.
4. Launch Ubuntu and perform the initialization process.
The initialization process begins when you launch Ubuntu after it has been unregistered. After that, you can create an Ubuntu account as follows.
eg: Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username:
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username:
Source: https://www.en.techgaku.com/fix-ubuntu-boot-error-on-wsl-after-reinstall/
No comments:
Post a Comment