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

WSL2. Can no longer find 'C:\Program Files\WSL\system.vhd' #11069

Closed
1 of 2 tasks
simonlaszcz opened this issue Jan 24, 2024 · 21 comments
Closed
1 of 2 tasks

WSL2. Can no longer find 'C:\Program Files\WSL\system.vhd' #11069

simonlaszcz opened this issue Jan 24, 2024 · 21 comments

Comments

@simonlaszcz
Copy link

Windows Version

10.0.22621.3007

WSL Version

2.0.14.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

Debian

Other Software

No response

Repro Steps

Try to open console
or
try wsl --export

Expected Behavior

For it to work

Actual Behavior

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

[process exited with code 4294967295 (0xffffffff)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

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.

@alexbogias
Copy link

Same here after installed v2.1.1.0

@soudai
Copy link

soudai commented Jan 26, 2024

me too.

PS C:\Users\alfta> wsl --version
WSL バージョン: 2.0.14.0
カーネル バージョン: 5.15.133.1-1
WSLg バージョン: 1.0.59
MSRDC バージョン: 1.2.4677
Direct3D バージョン: 1.611.1-81528511
DXCore バージョン: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows バージョン: 10.0.22631.3085

PS C:\Users\alfta> wsl --update
更新プログラムを確認しています。
Linux 用 Windows サブシステムの最新バージョンは既にインストールされています。
PS C:\Users\alfta>

@simonlaszcz
Copy link
Author

I just reinstalled WSL2 in the end, after first copying the vhdx in my AppData to a safe location, just in case.
My original distro was untouched by the reinstallation and worked as expected.

@ZKBL
Copy link

ZKBL commented Jan 30, 2024

mee too

@alexbogias
Copy link

I reinstalled also and worked...

@OneBlue
Copy link
Collaborator

OneBlue commented Jan 30, 2024

This is unfortunately a known issue when upgrading from an older version. The way to solve this is to manually download and install the new version.

You can find the latest MSI there: https://github.com/microsoft/WSL/releases/tag/2.1.1

@OneBlue OneBlue closed this as completed Jan 30, 2024
@simonlaszcz
Copy link
Author

I have to say though, that it worked fine for a couple of days after the upgrade. Then the vhd suddenly 'disappeared overnight'. Nevertheless, I will give this a go if it happens again.

@CoreySchnedl
Copy link

@OneBlue Thank you! Confirmed this fixed the issue for me. Saved me a bunch of time, because every other thread seemed to recognize unmounting and re-installing which would have took a ton of time for me to re-setup my workspaces.

Same thing as @simonlaszcz, I updated wsl everything worked fine, next day I get this error.

@jeromefischer
Copy link

I was also using 2.0.14 and lost two days in a row the Ubuntu distro. Now I give a try with the latest version 2.1.1.

Error message in wsl 2.0.14:

Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2: Das System kann die angegebene Datei nicht finden.
Error code: Wsl/Service/CreateInstance/CreateVm/MountVhd/HCS/ERROR_FILE_NOT_FOUND

@github-actions github-actions bot mentioned this issue Feb 16, 2024
2 tasks
@ICHx
Copy link

ICHx commented Feb 16, 2024

this helped, thanks. But absolutely confusing as an 'known issue' this is nowhere to be seen

@xijujie
Copy link

xijujie commented Mar 3, 2024

Thanks @OneBlue! Upgrading to v2.1.3 fixed this issue.

@DMBerlin
Copy link

This is unfortunately a known issue when upgrading from an older version. The way to solve this is to manually download and install the new version.

You can find the latest MSI there: https://github.com/microsoft/WSL/releases/tag/2.1.1

You saved my file! Thank you!

@jtognazzi
Copy link

jtognazzi commented Mar 18, 2024

Same behavior here.
I update WSL2 on Friday with wsl --update.
It worked until I rebooted today, and now I have the same error.

Reinstalling wsl.2.1.5.0.x64.msi does not fix the issue !
I never got the feedback that it was successfully installed, but there was also no error...

I then went to look into the msi archive a extracted the systemd.vhd file as system.vhd.
and now it seems to work.

But this is really not a user friendly process :-(

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 18, 2024

@jtognazzi: Can you share logs of the installation of 2.1.5.0 if that doesn't solve the issue ?

You can collect them via msiexec /i /L*V C:\wsllogs.txt

@jtognazzi
Copy link

@OneBlue
Should I try to reinstall the msi package via your cmd ?
So this is what I did:
msiexec.exe /i wsl.2.1.5.0.x64.msi /L*V C:\Securiton\wsllogs.txt
and I attached the resulting logs...
wsllogs.txt

@FrameMuse
Copy link

I couldn't initiate my old vhdx disk eventually, but I handled to move all my precious data to another subsystem by mounting the disk via wsl --mount ext4.vhdx --vhd command.

https://learn.microsoft.com/en-us/windows/wsl/wsl2-mount-disk

@PascalRoessnerDSA
Copy link

Same behavior here. I update WSL2 on Friday with wsl --update. It worked until I rebooted today, and now I have the same error.

Reinstalling wsl.2.1.5.0.x64.msi does not fix the issue ! I never got the feedback that it was successfully installed, but there was also no error...

I then went to look into the msi archive a extracted the systemd.vhd file as system.vhd. and now it seems to work.

But this is really not a user friendly process :-(

Exact same issue here. The proposed solution also worked -

for extracting the system.vhd file from the msi installer I ran

msiexec /a c:\tmp\wsl.2.1.5.0.x64.msi /qb TARGETDIR=c:\tmp\wsl

The file is then at the following location

c:\tmp\wsl\system.vhd

from there just copy it to C:\Program Files\WSL\system.vhd

@WangFengtu1996
Copy link

WangFengtu1996 commented Jun 14, 2024

I also have same error.

(base) PS C:\Users\11487> wsl --version
WSL 版本: 2.2.4.0
内核版本: 5.15.153.1-2
WSLg 版本: 1.0.61
MSRDC 版本: 1.2.5326
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26091.1-240325-1447.ge-release
Windows 版本: 10.0.22631.3737

I copy from my colleague PC same file to my PC with same version, then it can launch. system.vhd is rootfs for OS.

@stephenLucien
Copy link

Same behavior here. I update WSL2 on Friday with wsl --update. It worked until I rebooted today, and now I have the same error.

Reinstalling wsl.2.1.5.0.x64.msi does not fix the issue ! I never got the feedback that it was successfully installed, but there was also no error...

I then went to look into the msi archive a extracted the systemd.vhd file as system.vhd. and now it seems to work.

But this is really not a user friendly process :-(

Perfect, it works for me! Actually, I extracted the systemd.vhd from latest msi archive and renamed it to system.vhd, and it works well. But I cannot extract this file directly to folder C://Program Files/WSL, it pops up a window indicating permission deny, so I extract it to other folder and then copy to C://Program Files/WSL.

@stephenLucien
Copy link

Same behavior here. I update WSL2 on Friday with wsl --update. It worked until I rebooted today, and now I have the same error.
Reinstalling wsl.2.1.5.0.x64.msi does not fix the issue ! I never got the feedback that it was successfully installed, but there was also no error...
I then went to look into the msi archive a extracted the systemd.vhd file as system.vhd. and now it seems to work.
But this is really not a user friendly process :-(

Perfect, it works for me! Actually, I extracted the systemd.vhd from latest msi archive and renamed it to system.vhd, and it works well. But I cannot extract this file directly to folder C://Program Files/WSL, it pops up a window indicating permission deny, so I extract it to other folder and then copy to C://Program Files/WSL.

image

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