Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2: The system cannot find the file specified.
Windows Version
Microsoft Windows [Version 10.0.22631.3155]
WSL Version
2.1.5.0
Are you using WSL 1 or WSL 2?
- [X] 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
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:
- Failed to attach disk 'LocalState\ext4.vhdx' to WSL2: The system cannot find the file specified. (#10032), similarity score: 0.80
Closed similar issues:
- WSL2. Can no longer find 'C:\Program Files\WSL\system.vhd' (#11069), similarity score: 0.89
- WSL missing system.vhd (#11162), similarity score: 0.81
- WSL2 is failing to attach the wsl virtual disk and giving error code 4294967295 (#10390), similarity score: 0.79
- VHD mount issue with "WSL (2156) ERROR: UtilMount" (#11183), similarity score: 0.75
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Solved by rolling back to 2.1.4.0
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.
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.
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 https://github.com/microsoft/WSL/issues/11069.
@OneBlue - can you take a look?
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
Thanks a lot @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
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 !
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?
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.
Thank you @joelhellman. Out of curiosity, do you have a .wslconfig ? If so can you share its contents ?
@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
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.
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).
Faced similar issue after upgrading from 2.2.1 to 2.2.4.msi. It looks like it's picking up some default vhd path. I checked wsl.exe --list which still shows my default distro as (Default). I then tried wsl.exe --distribution mydistro which didn't work.
I then installed 2.2.3, did a wsl.exe --shutdown and somehow it worked.
Downgraded per https://github.com/microsoft/WSL/issues/11288#issuecomment-1992080697 above, and I was able regain access to my work-sensitive data in my WSL instance. Immediately backed up the sensitive data and will create encrypted backups of it (off system and off site).
@onmywaytoheaven Is there any way to force Windows to reinstall the WSL package to restore (reinstall) the C:\Program Files\WSL\system.vhd file?
Thank you. I ran into that problem today. Your solution is very helpful. Have a great day!
@onmywaytoheaven Is there any way to force Windows to reinstall the WSL package to restore (reinstall) the
C:\Program Files\WSL\system.vhdfile?Thank you. I ran into that problem today. Your solution is very helpful. Have a great day!
I had the same issue due to windows updating yesterday. Downgrading to the previous working version works for me as others have suggested, it seems to install the system.vhd file appropriately.
- For me, I had to downgrade from
2.3.26.0->2.3.24.0 2.3.26.0was released November 10th, 2024 (5 days ago from this post)- I skipped downgrading to
2.3.25.0as it is tagged as apre-release - So I chose
2.3.24.0as it was released September 27th, 2024 (3 weeks ago from this post)
Steps to fix:
- Find your current version (which isn't working)
- Download the most recent working version msi installer file
- Run the msi
- Check your WSL2 distro is working again
1. Find your current version (which isn't working)
- Here I can see my broken version is
2.3.26.0
wsl --version
WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4460
2. Download the most recent working version msi installer file
- Download from https://github.com/microsoft/WSL/releases
- Check the dates of the release and choose one that was released prior to your version being broken
- Note: Do not download any versions marked
pre-release
3. Run the msi
- Run the msi file (double click to execute)
4. Check your WSL2 distro is working again
- Open the terminal
- Note: My updated working version is now
2.3.24.0
wsl --version
WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4460
@onmywaytoheaven Is there any way to force Windows to reinstall the WSL package to restore (reinstall) the
C:\Program Files\WSL\system.vhdfile? Thank you. I ran into that problem today. Your solution is very helpful. Have a great day!I had the same issue due to windows updating yesterday. Downgrading to the previous working version works for me as others have suggested, it seems to install the
system.vhdfile appropriately.
- For me, I had to downgrade from
2.3.26.0->2.3.24.02.3.26.0was released November 10th, 2024 (5 days ago from this post)- I skipped downgrading to
2.3.25.0as it is tagged as apre-release- So I chose
2.3.24.0as it was released September 27th, 2024 (3 weeks ago from this post)Steps to fix:
- Find your current version (which isn't working)
- Download the most recent working version msi installer file
- Run the msi
- Check your WSL2 distro is working again
1. Find your current version (which isn't working)
- Here I can see my broken version is
2.3.26.0wsl --version WSL version: 2.3.26.0 Kernel version: 5.15.167.4-1 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.22631.4460
2. Download the most recent working version msi installer file
- Download from https://github.com/microsoft/WSL/releases
- Check the dates of the release and choose one that was released prior to your version being broken
- Note: Do not download any versions marked
pre-release3. Run the msi
- Run the msi file (double click to execute)
4. Check your WSL2 distro is working again
- Open the terminal
- Note: My updated working version is now
2.3.24.0wsl --version WSL version: 2.3.24.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.22631.4460
The problem I encountered is exactly the same as what you described. Thank you so much for the tutorial on fixing it. It's really great!
Same problem here right now.
Updated with wsl --update and restarted following the doc: installing systemd.
Had this problem.
PS C:\Users\bbc> wsl Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2: The system cannot find the file specified. Error code: Wsl/Service/CreateInstance/CreateVm/MountVhd/HCS/ERROR_FILE_NOT_FOUND after update
Had to downgrade to 2.1.4. Just installing that worked.
Same problem just happened to me. The trigger seemed to be a restart to install windows updates (sadly my org has set these to be automatic, so they sometimes happen without sufficient warning) while WSL was running. I'm not sure if WSL itself was updated by this but it was definitely broken afterwards.
The WSL version after the reboot (in the broken state) was 2.4.12.0, and reinstalling 2.4.11.0 seemed to recover the disk. I suspect it's not any particular upgrade/downgrade that fixes it, just forcing a reinstall (and running the same-version MSI does not reinstall).
So the real bug is that there are conditions that apparently corrupt/delete that disk. I'd be considerably more livid if this could also occur to the actual distribution disk, but at least in this case it appeared to be safe.
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.
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.12was not working, and installing the previous one,2.4.11fixed the problem.
The same thing happened to me this morning. Swapping to 2.4.11 fixed it here as well.
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.12was not working, and installing the previous one,2.4.11fixed the problem.The same thing happened to me this morning. Swapping to
2.4.11fixed 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.
I encountered a similar issue with version 2.4.13, and I was able to resolve it by downgrading to version 2.4.11.
I encountered a similar issue with version
2.4.13, and I was able to resolve it by downgrading to version2.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 !
Same issue here. Worked by downgrading from 2.4.13 to 2.4.11 AND performing a reboot of the machine.
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:
- Download wsl.2.5.7.0.x64.msi from github
- Shift + Right-click the MSI file
- Select "Repair (P)"
After the repair completes, 'C:\Program Files\WSL\system.vhd' will be available.
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:
- Download wsl.2.5.7.0.x64.msi from github
- Shift + Right-click the MSI file
- Select "Repair (P)"
After the repair completes, 'C:\Program Files\WSL\system.vhd' will be available.
This also fixed it for me.
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!