Skip to content

Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2: The system cannot find the file specified. #11288

Open

Description

Windows Version

Microsoft Windows [Version 10.0.22631.3155]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

Try to run WSL

Expected Behavior

WSL runs

Actual Behavior

Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2: The system cannot find the file specified.

Diagnostic Logs

No response

Activity

  1. github-actions commented on Mar 12, 2024

    @github-actions
    Contributor

    Hi I'm an AI powered bot that finds similar issues based off the issue title.

    Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

    Open similar issues:

    Closed similar issues:

    Note: You can give me feedback by thumbs upping or thumbs downing this comment.

  2. onmywaytoheaven commented on Mar 12, 2024

    @onmywaytoheaven
    Author

    Solved by rolling back to 2.1.4.0

  3. JenniferHem commented on Mar 12, 2024

    @JenniferHem

    Solved by rolling back to 2.1.4.0

    Can you please tell me how you roll back? Same issue here and I have been struggling the full day to solve this.

  4. onmywaytoheaven commented on Mar 12, 2024

    @onmywaytoheaven
    Author

    Solved by rolling back to 2.1.4.0

    Can you please tell me how you roll back? Same issue here and I have been struggling the full day to solve this.

    You can download 2.1.4.0 here, run the installer and it will do the job for you.

  5. benhillis commented on Mar 12, 2024

    @benhillis
    Member

    There is no change in behavior between these two versions so I suspect there is some kind of latent issue with upgrade. Looks identical to #11069.

    Blue (@OneBlue) - can you take a look?

  6. VolodymyrKaznacheiev commented on Mar 12, 2024

    @VolodymyrKaznacheiev

    Solved by rolling back to 2.1.4.0

    Can you please tell me how you roll back? Same issue here and I have been struggling the full day to solve this.

    You can download 2.1.4.0 here, run the installer and it will do the job for you.

    That hepled! Almost deleted my wsl. Thanks

  7. JenniferHem commented on Mar 13, 2024

    @JenniferHem

    Thanks a lot Ben Hillis (@benhillis) as I have no admin rights I really hope our IT Support is quick. @VladimirKaznacheiev I feel you, good that I do not have Admin rights :D

  8. aclerc-blachere commented on Mar 13, 2024

    @aclerc-blachere

    Solved by rolling back to 2.1.4.0

    Can you please tell me how you roll back? Same issue here and I have been struggling the full day to solve this.

    You can download 2.1.4.0 here, run the installer and it will do the job for you.

    this is perfect.

    tried everything from rolling back windows update to local security policy and regedit.
    Thank you !

  9. Romakip commented on Mar 16, 2024

    @Romakip

    Solved by rolling back to 2.1.4.0

    Good afternoon, unfortunately the reinstallation did not help me, do you know what else I can try?

    изображение

    изображение

    Docker itself updates to the latest version of wsl, don’t know how to disable it?

  10. joelhellman commented on Mar 19, 2024

    @joelhellman

    No expert here. My docker desktop or WSL2 wouldn't start yesterday after working just hours before.
    I got the same error message. I only had some 4-5 files in C:\Program Files\WSL, and system.vhd was not there.

    As part of troubleshooting I did uninstall docker-desktop first. But I guess that was not needed.
    I did install the 2.1.4 installer linked in this post. After that, I had lots of files in C:\Program Files\WSL, including system.vhd.
    Then I re-installed docker-desktop. After that, I had WSL 2 working again.

    # output after installing 2.1.4 install file and re-installing docker-desktop 
    PS C:\ wsl --version
    WSL version: 2.1.4.0
    Kernel version: 5.15.146.1-2
    WSLg version: 1.0.60
    MSRDC version: 1.2.5105
    Windows version: 10.0.19045.4046
    

    Maybe using 2.1.5 installer would has worked just as well, I didn't test.
    Might not have needed to re-install docker-desktop.

    No idea what caused what seems like removing existing system.vhd and supporting files (if that happened). When WSL2 was not working anymore and I looked in C:\Program Files\WSL, I didn't have many files there, I just had like 4-5 files in that directory, plus some folders with log files and a few small size files.

    I didn't install anything myself lately. I do have docker-desktop, but it doesn't auto-update for me. My IT dept said no rollouts was made recently.

    So still no idea what caused this for me. I guess I'm happy it works now after this scare, and this post helped.

  11. OneBlue commented on Mar 19, 2024

    @OneBlue
    Collaborator

    Thank you Joel Hellman (@joelhellman). Out of curiosity, do you have a .wslconfig ? If so can you share its contents ?

  12. joelhellman commented on Mar 24, 2024

    @joelhellman

    Blue (@OneBlue) sure, here is my full unedited .wslconfig (it has been unchanged for about a year)

    # Settings apply across all Linux distros running on WSL 2
    [wsl2]
    # guiApplications=false
    
    # Limits VM memory
    memory=12GB
    
  13. ostecke commented on May 29, 2024

    @ostecke

    Very happy with the suggestion of installing 2.1.4 since that instantly brought my WSL back to life, many many thanks.

    Very unhappy with this critical bug in a patch version being around for more than two months without being addressed. Most people using WSL will be developers or students that rely on WSL working properly. These situations make me want to buy a Macbook.

  14. mx-bernhard commented on Jun 4, 2024

    @mx-bernhard

    Neither installing 2.1.4 nor 2.1.5 fixed the problem for me (was using the msix installer). I just copied the files from its old location C:\ProgramData\Microsoft\WSL to the new location C:\Program Files\WSL with elevated rights, and it was working again. I made sure, that this procedure did not overwrite existing files (some of them were already there).

  15. 7 remaining items

  16. kamichal commented on Mar 12, 2025

    @kamichal

    Same here. Update policy of my company suddenly restarted my PC without any warning, after that WSL stopped working.
    I don't know what version I had before, but the 2.4.12 was not working, and installing the previous one, 2.4.11 fixed the problem.

  17. bpratt-uncomn commented on Mar 13, 2025

    @bpratt-uncomn

    Same here. Update policy of my company suddenly restarted my PC without any warning, after that WSL stopped working. I don't know what version I had before, but the 2.4.12 was not working, and installing the previous one, 2.4.11 fixed the problem.

    The same thing happened to me this morning. Swapping to 2.4.11 fixed it here as well.

  18. plabbett commented on Mar 14, 2025

    @plabbett

    Same here. Update policy of my company suddenly restarted my PC without any warning, after that WSL stopped working. I don't know what version I had before, but the 2.4.12 was not working, and installing the previous one, 2.4.11 fixed the problem.

    The same thing happened to me this morning. Swapping to 2.4.11 fixed it here as well.

    Confirming that WSL was running when my computer auto-updated. Coming back up, this error occurred. Downgrading to 2.4.11 (from 2.4.12) fixed the issue.

    I was also able to upgrade from 2.4.11 back to 2.4.12 and things are also still working and no data loss.

  19. jbrathwa commented on Mar 27, 2025

    @jbrathwa

    I encountered a similar issue with version 2.4.13, and I was able to resolve it by downgrading to version 2.4.11.

  20. mathisgauthey commented on Mar 27, 2025

    @mathisgauthey

    I encountered a similar issue with version 2.4.13, and I was able to resolve it by downgrading to version 2.4.11.

    Same thing here. I will try to downgrade.

    EDIT : Downgrading to WSL 2.4.11 is a solution. It prevented me from starting my IntelliJ... Glad I found this post !

  21. dosif commented on Apr 2, 2025

    @dosif

    Same issue here. Worked by downgrading from 2.4.13 to 2.4.11 AND performing a reboot of the machine.

  22. syuuha commented on May 28, 2025

    @syuuha

    I upgraded from WSL 2.4.13 to WSL 2.5.7 in Windows 11, by "wsl --update"
    but encountered the issue: "Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2"

    Fix Method:

    1. Download wsl.2.5.7.0.x64.msi from github
    2. Shift + Right-click the MSI file
    3. Select "Repair (P)"

    After the repair completes, 'C:\Program Files\WSL\system.vhd' will be available.

  23. joey-bolts commented on May 28, 2025

    @joey-bolts

    I upgraded from WSL 2.4.13 to WSL 2.5.7 in Windows 11, by "wls --update" but encountered the issue: "Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2"

    Fix Method:

    1. Download wsl.2.5.7.0.x64.msi from github
    2. Shift + Right-click the MSI file
    3. Select "Repair (P)"

    After the repair completes, 'C:\Program Files\WSL\system.vhd' will be available.

    This also fixed it for me.

  24. kresnasatya commented on Jun 11, 2025

    @kresnasatya

    I upgraded from WSL 2.4.13 to WSL 2.5.7 in Windows 11, by "wsl --update" but encountered the issue: "Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2"

    Fix Method:

    1. Download wsl.2.5.7.0.x64.msi from github
    
    2. Shift + Right-click the MSI file
    
    3. Select "Repair (P)"
    

    After the repair completes, 'C:\Program Files\WSL\system.vhd' will be available.

    Thank you so much! It works!

  25. totoguy commented on Aug 25, 2025

    @totoguy

    I upgraded from WSL 2.4.13 to WSL 2.5.7 in Windows 11, by "wsl --update" but encountered the issue: "Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2"

    Fix Method:

    1. Download wsl.2.5.7.0.x64.msi from github
    
    2. Shift + Right-click the MSI file
    
    3. Select "Repair (P)"
    

    After the repair completes, 'C:\Program Files\WSL\system.vhd' will be available.

    Same issue after upgrading to 2.5.10.0, repair did the trick.

  26. wilder00 commented on Sep 6, 2025

    @wilder00

    Comentaré mi caso:
    Parece que al hacer
    wsl --update
    Mi distro dejó de responder, usualmente me conecto con wsl -d Ubuntu pero en este caso me salía este mensaje

    Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2: El sistema no puede encontrar el archivo especificado.

    De alguna forma llegué a alguna página de microsoft para validar que aún estaba mi archivo que en teoría es el disco duro virtual en

    C:\Users\LENOVO\AppData\Local\Packages
    

    en esa carpeta encontré mi distro CanonicalGroupLimited.Ubuntu_45sdfxhfac3 y en esa carpeta debí asegurarme que aun sigue mi distro LocalState/ext4.vhdx por si acaso me hice una copia de seguridad de toda la carpeta CanonicalGroupLimited.Ubuntu_45sdfxhfac3

    Diria que lo que me solucionó fue:

    wsl --shutdown
    wsl --uninstall
    wsl --install

    Recuerdo que tenía 2 distros, una que instalé que tenía el nombre a secas "Ubuntu" y la otra que no sé de dónde salió, creo que con la primera instalación apareció. Después de esos pasos al ejecutar wsl --list aparecía solo el distro que instalé y tenía todo mis archivos del trabajo :'v. Vi por ahí vi comentarios de hacer cosas raras :'v creí que los perdería pero ya estoy bien, ya tengo mis archivos recuperados. Esperen... acabo de levantar el docker desktop y el otro distro era docker-desktop. Entonces no perdí nada.

  27. darkdiesel commented on Sep 12, 2025

    @darkdiesel

    Wilder Trujillo (@wilder00) thanks a lot after uninstalling i removed CanonicalGroupLimited* folders from %AppData%\Local\Packages and make clean install and all worked fine.

    I don't know what was broken. I think new windows 10 updates at the morning

  28. illagrenan commented on Sep 12, 2025

    @illagrenan

    I had the same problem after upgrading to 2.6.1 (via wsl --update). The PC suddenly restarted, and after booting up, WSL wouldn’t start (system cannot find that vhd file). I downloaded the latest installer (MSI), right-clicked on it, selected Repair, and now everything seems fine.

  29. illich570 commented on Sep 13, 2025

    @illich570

    I had the same problem after upgrading to 2.6.1 (via wsl --update). The PC suddenly restarted, and after booting up, WSL wouldn’t start (system cannot find that vhd file). I downloaded the latest installer (MSI), right-clicked on it, selected Repair, and now everything seems fine.

    This is the correct solution, I already face the same error when microsoft store automatically uptated the WSL to the 2.6.1 Version.

    Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions