WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Upgrade problem: WSL 2.7.8 - The virtual hard disk cannot be found after the update.

Open LaKanDoR opened this issue 5 months ago • 17 comments

Windows Version

Microsoft Windows [Version 10.0.29599.1000]

WSL Version

2.7.8.0

Are you using WSL 1 or WSL 2?

  • [x] WSL 2
  • [ ] WSL 1

Kernel Version

Kernelversion: 6.18.33.1-1

Distro Version

No response

Other Software

Docker Desktop 4.7.7

Repro Steps

After the update, I can no longer access the Linux environment via the command line using the wsl.exe command.

PS C:\Users\WINDASI> wsl wsl: Unbekannter Schlüssel „wsl2.autoMemoryReclaim“ in C:\Users\WINDASI\.wslconfig:7 wsl: Doppelter Konfigurationsschlüssel 'wsl2.nestedVirtualization' in C:\Users\WINDASI\.wslconfig:33 (widersprüchlicher Schlüssel: 'wsl2.nestedVirtualization' in C:\Users\WINDASI\.wslconfig:10) Das System kann die angegebene Datei nicht finden. Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND PS C:\Users\WINDASI> wsl wsl: Unbekannter Schlüssel „wsl2.autoMemoryReclaim“ in C:\Users\WINDASI\.wslconfig:7 Das System kann die angegebene Datei nicht finden. Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND PS C:\Users\WINDASI> wsl Das System kann die angegebene Datei nicht finden. Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND PS C:\Users\WINDASI> wsl Das System kann die angegebene Datei nicht finden. Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND

Expected Behavior

Simply launch the terminal using the "wsl.exe" command.

Actual Behavior

PS C:\Users\WINDASI> wsl wsl: Unbekannter Schlüssel „wsl2.autoMemoryReclaim“ in C:\Users\WINDASI\.wslconfig:7 wsl: Doppelter Konfigurationsschlüssel 'wsl2.nestedVirtualization' in C:\Users\WINDASI\.wslconfig:33 (widersprüchlicher Schlüssel: 'wsl2.nestedVirtualization' in C:\Users\WINDASI\.wslconfig:10) Das System kann die angegebene Datei nicht finden. Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND PS C:\Users\WINDASI> wsl wsl: Unbekannter Schlüssel „wsl2.autoMemoryReclaim“ in C:\Users\WINDASI\.wslconfig:7 Das System kann die angegebene Datei nicht finden. Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND PS C:\Users\WINDASI> wsl Das System kann die angegebene Datei nicht finden. Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND PS C:\Users\WINDASI> wsl Das System kann die angegebene Datei nicht finden. Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND

Diagnostic Logs

WslLogs-2026-06-10_15-44-46.tar.gz

LaKanDoR avatar Jun 10 '26 13:06 LaKanDoR

Diagnostic information
Appx package is not installed
Detected user visible error: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND
Found evidence of disk failing to attach. Error: 0xC0000034, Path: C:\Program Files\WSL\tools\modules.vhd

github-actions[bot] avatar Jun 10 '26 13:06 github-actions[bot]

Furthermore, the "D Ubuntu" installation is not located in the standard storage location on the hard drive, but rather on a different hard drive.

D:\WSL\Ubuntu

PS C:\Users\WINDASI> wsl -l -v --all
  NAME              STATE           VERSION
* D_Ubuntu          Stopped         2
  docker-desktop    Stopped         2
PS C:\Users\WINDASI> wsl
Das System kann die angegebene Datei nicht finden.
Fehlercode: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND
PS C:\Users\WINDASI> dir D:\WSL\Ubuntu


    Verzeichnis: D:\WSL\Ubuntu


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        10.06.2026     15:19  1153049821184 ext4.vhdx
-a----        13.04.2026     07:57          37207 shortcut.ico

LaKanDoR avatar Jun 10 '26 14:06 LaKanDoR

Could you please try rebooting your machine that should resolve the issue. For some context, the MSI installer likely failed to replace the system VHD during the upgrade your distributions are safe.

benhillis avatar Jun 10 '26 14:06 benhillis

Could you please try rebooting your machine that should resolve the issue. For some context, the MSI installer likely failed to replace the system VHD during the upgrade your distributions are safe.

I’ve already done that twice now.

I also have the WSL debug window (.wslconfig) in my configuration, and I find it strange that the window opens twice after I restart the computer that’s new.

Docker crashes, too well, the window just stays frozen.

The update was installed using winget upgrade --all.

I'm reinstalling it over the existing installation.

The WSL2 debug window kept popping up during the update could it be a Docker issue? I wondered if the fact that VS Code was still open and kept reconnecting might have triggered the "glitch."

LaKanDoR avatar Jun 10 '26 15:06 LaKanDoR

Same problem here. Everything was working fine last night, this morning after doing the windows update on restart WSL is giving me:

The system cannot find the file specified. Error code: Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND

wsl --version gives this:

WSL version: 2.7.8.0 Kernel version: 6.18.33.1-1 WSLg version: 1.0.73.2 MSRDC version: 1.2.6676 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.26200.8655

jim-huynh avatar Jun 10 '26 15:06 jim-huynh

@LaKanDoR I went and downloaded the version 2.7.8.0 from the releases page at https://github.com/microsoft/WSL/releases (wsl.2.7.8.0.x64.msi for my computer) and right click on the file and select "repair" and it resolved my issues.

jim-huynh avatar Jun 10 '26 15:06 jim-huynh

@LaKanDoR I went and downloaded the version 2.7.8.0 from the releases page at https://github.com/microsoft/WSL/releases (wsl.2.7.8.0.x64.msi for my computer) and right click on the file and select "repair" and it resolved my issues.

Many thanks. 🔥❤️‍🔥 That really is the solution; the WSL debug window launches for me now, and everything seems to be running normally again.

I had gone to Windows 11 System Components Win + R -> ms-settings:systemcomponents -> "WSL" and clicked "Repair," but that didn't change anything. It would be great if that "Repair" option actually triggered the installer's repair process ;-)

LaKanDoR avatar Jun 10 '26 16:06 LaKanDoR

Could you please try rebooting your machine that should resolve the issue. For some context, the MSI installer likely failed to replace the system VHD during the upgrade your distributions are safe.

I’ve already done that twice now.

I also have the WSL debug window (.wslconfig) in my configuration, and I find it strange that the window opens twice after I restart the computer that’s new.

Docker crashes, too well, the window just stays frozen.

The update was installed using winget upgrade --all.

I'm reinstalling it over the existing installation.

The WSL2 debug window kept popping up during the update could it be a Docker issue? I wondered if the fact that VS Code was still open and kept reconnecting might have triggered the "glitch."

Ok thanks for that data point, that helps. Something in the update is eating the VHD, I will investigate.

benhillis avatar Jun 10 '26 23:06 benhillis

Hi @benhillis @LaKanDoR , it sounds like this same issue: https://github.com/microsoft/WSL/issues/40488. Should be resolved in https://github.com/microsoft/WSL/pull/40625. However, the fix only works if one is updating from a fixed version.

@LaKanDoR , If you are interested, please check if docker desktop is constantly restarting its engine during the update when this happens. (Will require a repro by installing another version.) And if the installer asks for a reboot, before the reboot, check for this registry value to see what it's rebooting for:

Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager' -Name PendingFileRenameOperations -ErrorAction SilentlyContinue | Select-Object -ExpandProperty PendingFileRenameOperations

chemwolf6922 avatar Jun 11 '26 02:06 chemwolf6922

Hi @benhillis @LaKanDoR , it sounds like this same issue: #40488. Should be resolved in #40625. However, the fix only works if one is updating from a fixed version.

@LaKanDoR , If you are interested, please check if docker desktop is constantly restarting its engine during the update when this happens. (Will require a repro by installing another version.) And if the installer asks for a reboot, before the reboot, check for this registry value to see what it's rebooting for:

Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager' -Name PendingFileRenameOperations -ErrorAction SilentlyContinue | Select-Object -ExpandProperty PendingFileRenameOperations

@chemwolf6922 I ran the PowerShell command and received the following output. No entries for Docker Desktop or even WSL.

That’s a really interesting feature—I’m a software developer myself; what is it used for? Presumably for software updates, right? Which Windows API do you have to use to access that Windows session manager?

PS C:\Users\WINDASI> Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager' -Name PendingFileRenameOperations -ErrorAction SilentlyContinue | Select-Object -ExpandProperty PendingFileRenameOperations
*1\??\C:\Program Files\Firefox Nightly\tobedeleted\repb2e6f889-0382-49a1-8412-b9ea568b17bb

*1\??\C:\Program Files\Firefox Nightly\tobedeleted\repb2e6f889-0382-49a1-8412-b9ea568b17bb

*1\??\C:\Program Files\Firefox Nightly\tobedeleted

*1\??\C:\Program Files (x86)\Mozilla Maintenance Service\maintenanceservice_tmp.exe

Regarding the other reported error [#40488], all I can say is that I had Visual Studio Code open during the update, and it kept trying to reconnect throughout the installation process (because I was connected via WSL). I recall the WSL debug window opening two or even three times (it wasn't behaving as a singleton/single instance) during and after the installation; there was essentially a chaotic cycle of restarts (I certainly wouldn't have noticed that without the WSL debug window) following the setup, until eventually, nothing worked at all.

LaKanDoR avatar Jun 11 '26 03:06 LaKanDoR

@LaKanDoR I went and downloaded the version 2.7.8.0 from the releases page at https://github.com/microsoft/WSL/releases (wsl.2.7.8.0.x64.msi for my computer) and right click on the file and select "repair" and it resolved my issues.

Thank you. It almost worked with your instructions.

From my side, I had to disable WSL Services from services.msc, then reboot Windows (because the MSI program failed to stop the service), then repair with MSI file, then start again the service.

fabien4455 avatar Jun 11 '26 07:06 fabien4455

I horribly failed at this for the past 2 hours. I downloaded the latest msi and tried uninstalling, installing, repairing to no avail.

winget uninstall --id Microsoft.WSL
winget install --id Microsoft.WSL

The system.vhd was still gone. What helped was rather stupid. After I installed WSL again using wsl.2.7.8.0.x64.msi, rebooted and then launched it again using the repair option, I realized it was looking for a file named wsl.msi, which I didn't have ... yet. So I renamed it:

Rename-Item "C:\Users\Administrator\Downloads\wsl.2.7.8.0.x64.msi" "wsl.msi"
msiexec /fa "C:\Users\Administrator\Downlaods\wsl.msi" /l*v "$env:TEMP\wsl.log"

And finally the System.vhd was present again. Docker Desktop and Ubuntu came online again.

marcoheinrich-sii avatar Jun 11 '26 08:06 marcoheinrich-sii

@LaKanDoR I went and downloaded the version 2.7.8.0 from the releases page at https://github.com/microsoft/WSL/releases (wsl.2.7.8.0.x64.msi for my computer) and right click on the file and select "repair" and it resolved my issues.

Same issue, I had a Windows update yesterday and this morning WSL wouldn't start. Following these instructions fixed my issue. Thanks.

esbarland avatar Jun 11 '26 08:06 esbarland

Hit the same issue. WSL worked fine until it auto-updated to 2.7.8 on the evening of 11 June, then every wsl invocation failed with Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND (Docker Desktop's distro registration failed the same way).

Windows version: 10.0.26200.8655 WSL version: 2.7.8.0, kernel 6.18.33.1-1 Docker Desktop installed

Hypervisor and HCS were healthy (HypervisorPresent: True, vmcompute running); HCS Operational log showed Create compute system, result 0xC0370103 on every attempt. sfc and dism /restorehealth clean. Renaming .wslconfig away made no difference. Rolling back to 2.7.3 via the MSI from the releases page fixed it immediately.

polpluckanes avatar Jun 12 '26 12:06 polpluckanes

Hit the same issue. WSL worked fine until it auto-updated to 2.7.8 on the evening of 11 June, then every wsl invocation failed with Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND (Docker Desktop's distro registration failed the same way).

Windows version: 10.0.26200.8655 WSL version: 2.7.8.0, kernel 6.18.33.1-1 Docker Desktop installed

Hypervisor and HCS were healthy (HypervisorPresent: True, vmcompute running); HCS Operational log showed Create compute system, result 0xC0370103 on every attempt. sfc and dism /restorehealth clean. Renaming .wslconfig away made no difference. Rolling back to 2.7.3 via the MSI from the releases page fixed it immediately.

After Installing the newest version: Download the 2.7.8 *.msi installer from GitHub here. Right-click the setup file, select "Show more options..." (at the very bottom), and you will see a "Repair" entry in the context menu for WSL; run the repair, and everything should work as usual afterwards.

LaKanDoR avatar Jun 12 '26 12:06 LaKanDoR

After Installing the newest version: Download the 2.7.8 *.msi installer from GitHub here. Right-click the setup file, select "Show more options..." (at the very bottom), and you will see a "Repair" entry in the context menu for WSL; run the repair, and everything should work as usual afterwards.

Your recommendation worked perfectly. Thanks.

Elycox avatar Jun 15 '26 18:06 Elycox

This is a duplicate of #40488, where the 2.7.8 MSI upgrade failed to replace the system VHD (C:\Program Files\WSL\tools\system.vhd/modules.vhd), resulting in Wsl/Service/CreateInstance/CreateVm/HCS/ERROR_FILE_NOT_FOUND. The fix is in #40625.

Workaround for anyone hitting this on an already-broken install: download the matching 2.7.8 .msi from the releases page, right-click the installer, and run Repair (your distributions are not affected). Closing as a duplicate of #40488.

benhillis avatar Jun 22 '26 14:06 benhillis