WSL: 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?

  • 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

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 13
  • Comments: 30 (1 by maintainers)

Most upvoted comments

Solved by rolling back to 2.1.4.0

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.

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

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.0 was released November 10th, 2024 (5 days ago from this post)
  • I skipped downgrading to 2.3.25.0 as it is tagged as a pre-release
  • So I chose 2.3.24.0 as it was released September 27th, 2024 (3 weeks ago from this post)

Steps to fix:

  1. Find your current version (which isn’t working)
  2. Download the most recent working version msi installer file
  3. Run the msi
  4. 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

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.

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.

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

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 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!

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

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.

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.