WSL2 stopped working with error The system cannot find the path specified
Asked Answered
V

9

24

WSL2 stopped working suddenly. If I do a new installation of linux distros. Then it throws the following error, when I click launch button for the linux distro from play store:

Installing, this may take a few minutes... 
WslRegisterDistribution failed with error: 0x80070003
Error: 0x80070003 The system cannot find the path specified.

the wsl --help command works properly. All other wsl command hangs or throws error as shown below like wsl -l command throws this error The system cannot find the path specified.

Vexillum answered 20/11, 2020 at 1:28 Comment(0)
K
38

I had the same thing happening to me after I moved the directory of my distro.

You have to unregister the distro from WSL;

wslconfig /u Ubuntu-20.04

and then just execute the installed exe and install the whole distro to WSL again.

Katzman answered 26/5, 2021 at 11:50 Comment(3)
How do i do this without losing the old disto's data?Hubsher
@EatonEmmerich you need to move the wsl files back to the location where it still works, Then use this answer from another question to move your wsl to a new directory.Katzman
I tried that and got the same error message "The system cannot find the path specified." both wsl and wslconfig exists on c:\windows\system32Alarick
L
17

Here are the steps to fix this issue:

  1. Run with cmd administrator
  2. wsl --shutdown
  3. wslconfig /unregister Ubuntu
  4. wsl --install --distribution Ubuntu

Note: If you forgot the exact distro name, run 'wsl --list' from cmd line.

Lashandralashar answered 15/3, 2023 at 7:16 Comment(1)
Same error occurs when calling wsl of any variationCerellia
S
10

Was struggling with this issue for a long time and was able to fix it somehow. 2 Years too late but if anybody else has a similar issue now, then Try to recreate the following steps:

1)Search for Installed Apps

2)Search for Linux

3)Find Windows Subsystem for Linux and go to Advanced Options

Advanced Options WSL Screenshot

4)Click on Repair

Repair/Reset Screenshot

5)Check if WSL is working normally

6)If it doesn't work then Click on Reset

I had actually not seen the repair option and had clicked on Reset. Even though it said that it will delete data, my ubuntu data was preserved fine. Not sure how, so please proceed with caution for the final step. Hope this helps.

Spokesman answered 2/3, 2023 at 4:25 Comment(2)
I had mannually removed a distro from F:\Users\myuser\AppData\Local\Packages: using the RESET option on the "Windows Subsystem for Linux" App worked without loosin any data of the other VMsAntispasmodic
thanks, you saved my time, i faced the issue a lot of time, and I tried all ways that I saw on the internet, but now it works with the following stepsKelila
V
4

I had to reinstall the windows to fix the issue. Something got corrupted in the OS. However, before reinstalling the OS as I had lot of work stored in the WSL2, I took the backup of the entire WSL2 image, the big .vhdx file. This file is the Virtual Hard Disk of WSL2 Linux. The files inside cannot be directly explored from Windows at the moment. If one has not moved the file anywhere else, it is stored here: %LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState\ext4.vhdx

Before reinstalling the OS, after taking the backup, I wanted to test if this backup runs fine on new install of WSL2. For that, I tested it on another machine, by installing the same Ubuntu WSL2 distro and replacing the .vhdx file created with the backup file. It ran fine. So, it felt safe to do entire OS reinstall and then reinstalling WSL2 Ubuntu and finally replacing the .vhdx file with the old backup .vhdx file. So, I did loose some time. But, my data and all the applications/programs on WSL2 were intact.

Vexillum answered 15/12, 2020 at 12:24 Comment(2)
Did you ever determine the root cause of this? I am now experiencing the same issue, uninstalled the distro the kernel update, wsl feature and vm platform feature, then started over and still get the same error. I even removed docker and hyper-v before doing so...Fictive
Just wanted to say that this answer saved me. My WSL was hopelessly broken after a random windows update and the only solution was to completely wipe it from the system and reinstall everything from scratch. Backing up the .vhdx file and copying it back to the original location (after installing my linux distro) allowed me to preserve my filesystem and all my work on it.Lampley
S
0

I know this is old but I had the same problem after deleting a driver associated with Hyper V and fixed it by uninstalling the virtual machine platform and Windows Hypervisor along with WSL, rebooted, reinstalled all 3 and then I could install Ubuntu again

Secundas answered 5/5, 2022 at 17:38 Comment(2)
Ehats was the driver ?Syllabism
I don't remember off-hand but it was probably the Hyper-V network driver from device manager.Secundas
M
0

This is my first answer on stack overflow and English is not my first language.

So, I will answer this question in images. My solution would not delete the date in any existing installed Linux distribution, at least for me.

Hope you can solve this problem successfully.

enter image description here

enter image description here

enter image description here

Mcnalley answered 8/2, 2023 at 17:5 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Williamson
H
0

I had similar issues after fixing this: https://superuser.com/questions/1714397/wsl-2-0-the-file-cannot-be-accessed-by-the-system/1840195#1840195

Next I followed the steps rtsan1 posted above: https://mcmap.net/q/543754/-wsl2-stopped-working-with-error-the-system-cannot-find-the-path-specified

I was able to then setup Ubuntu and use it in WSL.

Hotchpotch answered 24/4 at 12:23 Comment(0)
T
-1

I've tried every command possible. I've executed all commands starting with "wsl." But the error persists. If neither 'wsl --install' nor 'wsl --update' is working and the error continues, there's only one solution: to format. The issue may be resolved by manually deleting files related to WSL among system 32 files, but you might accidentally delete system files in the process. Therefore, formatting is the most basic solution sorry...

Tampere answered 17/3 at 17:24 Comment(0)
G
-4

"Enable" Virtualization from your bios settings. Settings may differ from bios to bios (search for your machine options)

Galanti answered 27/7, 2022 at 17:49 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Williamson

© 2022 - 2024 — McMap. All rights reserved.