Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 2 tasks
onmywaytoheaven opened this issue Mar 12, 2024 · 15 comments
Assignees

Comments

@onmywaytoheaven
Copy link

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

Copy link

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.

@onmywaytoheaven
Copy link
Author

Solved by rolling back to 2.1.4.0

@JenniferHem
Copy link

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.

@onmywaytoheaven
Copy link
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.

@benhillis
Copy link
Member

benhillis commented Mar 12, 2024

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.

@OneBlue - can you take a look?

@VladimirKaznacheiev
Copy link

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

@JenniferHem
Copy link

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

@aclerc-blachere
Copy link

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 !

@Romakip
Copy link

Romakip commented Mar 16, 2024

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?

@joelhellman
Copy link

joelhellman commented Mar 19, 2024

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.

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 19, 2024

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

@joelhellman
Copy link

@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

@ostecke
Copy link

ostecke commented May 29, 2024

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.

@mx-bernhard
Copy link

mx-bernhard commented Jun 4, 2024

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).

@curbengh
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests