can run wsl command anymore `Failed to attach disk 'C:\Users\aib\AppData\Local\Docker\wsl\distro\ext4.vhdx' to WSL2` [closed]
Asked Answered
N

2

5

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
Nadeau answered 25/11, 2023 at 17:37 Comment(0)
S
6

I had faced the same error when I was trying to run Ubuntu 22.04 distro on wsl. I tried several methods but none of them worked. The way I was able to solve it is, first I executed the following command:

wsl --unregister Ubuntu-22.04

then reinstalled it:

wsl --install Ubuntu-22.04

Then I was successfully able to run my Ubuntu 22.04 distro.

Skirmish answered 29/2 at 10:39 Comment(2)
When you say you are able to run the distro, is it a fresh new distro or do you mean it is the original distro with all the files in it?Lacy
it was fresh a distroSkirmish
F
2

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]

Feinstein answered 25/11, 2023 at 17:51 Comment(1)
This is not the likely cause of this error. Typically this error occurs when people have installed a distro, they have been using it for some time, and expect it to work like it did before. Installing a distro gives you a new distro, but it does not bring back an old one which likely has have been configured significantly over much time and is a lot to loose.Tabathatabb

© 2022 - 2024 — McMap. All rights reserved.