can run wsl command anymore `Failed to attach disk 'C:UsersaibAppDataLocalDockerwsldistroext

Empting space of my computer, I can anymore run wsl, how can I deal with this problem?

in command line I tried to run wsl to use linux command line but I got this error:

Failed to attach disk 'C:\Users\aib\AppData\Local\Docker\wsl\distro\ext4.vhdx' to WSL2: The system cannot find the path specified. Error code: Wsl/Service/CreateInstance/MountVhd/HCS/ERROR_PATH_NOT_FOUND 

1 Answer

I had the same problem, to solve this run wsl -l and check if you have ubuntu installed, and check if you installed wsl is set as a default subsystem.

$ wsl -l > Windows Subsystem for Linux Distributions: > docker-desktop (Default) > docker-desktop-data 

that means you have to install ubuntu with wsl --install and than set as default distro this new distribution with wsl -s Ubuntu

For me those steps solved the problem but this error, can happen also for other reason one of the reason could be for example when you move or delate the docker folder and you want to access again on this subsystem but the wsl can't find the binding anymore. -> [ref]

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobnBtZG2Gc4COnJinZaKqu27D0qVknKedoq6vsIyapbKln6eybrLAoqOenF2pvG6t062YnKBdmba0t4ycZK6rlafAbq3Im2SaqKCZrrWtjKWmnJmcYrE%3D