WSL icon indicating copy to clipboard operation
WSL copied to clipboard

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

Open simonlaszcz opened this issue 2 years ago • 96 comments

Windows Version

10.0.22621.3007

WSL Version

2.0.14.0

Are you using WSL 1 or WSL 2?

  • [X] 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

simonlaszcz avatar Jan 24 '24 10:01 simonlaszcz

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.

github-actions[bot] avatar Jan 24 '24 10:01 github-actions[bot]

Same here after installed v2.1.1.0

alexbogias avatar Jan 25 '24 10:01 alexbogias

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>

soudai avatar Jan 26 '24 05:01 soudai

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.

simonlaszcz avatar Jan 27 '24 20:01 simonlaszcz

mee too

ZKBL avatar Jan 30 '24 05:01 ZKBL

I reinstalled also and worked...

alexbogias avatar Jan 30 '24 15:01 alexbogias

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 avatar Jan 30 '24 22:01 OneBlue

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.

simonlaszcz avatar Jan 31 '24 09:01 simonlaszcz

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

CoreySchnedl avatar Feb 02 '24 13:02 CoreySchnedl

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

jeromefischer avatar Feb 13 '24 12:02 jeromefischer

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

rtsui-mk avatar Feb 16 '24 11:02 rtsui-mk

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

xijujie avatar Mar 03 '24 15:03 xijujie

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!

DMBerlin avatar Mar 12 '24 17:03 DMBerlin

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 :-(

jtognazzi avatar Mar 18 '24 07:03 jtognazzi

@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

OneBlue avatar Mar 18 '24 18:03 OneBlue

@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

jtognazzi avatar Mar 19 '24 08:03 jtognazzi

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

FrameMuse avatar Apr 10 '24 14:04 FrameMuse

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

PascalRoessnerDSA avatar Apr 15 '24 06:04 PascalRoessnerDSA

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.

WangFengtu1996 avatar Jun 14 '24 01:06 WangFengtu1996

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 avatar Jun 15 '24 11:06 stephenLucien