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

WslRegisterDistribution failed with error: 0x80070002 #12249

Open
1 of 2 tasks
wecha-ms-v2 opened this issue Nov 8, 2024 · 5 comments
Open
1 of 2 tasks

WslRegisterDistribution failed with error: 0x80070002 #12249

wecha-ms-v2 opened this issue Nov 8, 2024 · 5 comments

Comments

@wecha-ms-v2
Copy link

Windows Version

10.0.26100.2033

WSL Version

2.3.24.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.153.1-2

Distro Version

Ubuntu 24.04

Other Software

No response

Repro Steps

C:\Users\wecha>wsl --install Ubuntu

Expected Behavior

expected Ubuntu to be installed.

Actual Behavior

C:\Users\wecha>wsl --install Ubuntu
Ubuntu is already installed.
Launching Ubuntu...
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070002
Error: 0x80070002 The system cannot find the file specified.

Press any key to continue...
The operation completed successfully.

Diagnostic Logs

Could not run my existing Ubuntu distro, eventually resorted to reinstalling WSL from scratch in hopes it will resolve issue.

However still hitting same issue after uninstalling wsl and updating it.

C:\Users\wecha>wsl --update
Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed.

C:\Users\wecha>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.26100.2033

Attach are the logs when attempting to run cmd "wsl --install Ubuntu"
WslLogs-2024-11-08_14-50-11.zip

Copy link

github-actions bot commented Nov 8, 2024

View similar issues

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!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Diagnostic information
Detected appx version: 2.3.24.0

@sonwan2020
Copy link

Same failure for me.

I encounter this problem after I upgrade the OS system on 11/13.

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

I tried these steps and it still not work:

  1. delete all my distributions environment from add or remove programs
  2. turn off features from Windows features
  3. restart
  4. turn on features

Still the command "wsl --list" shows error like
Error code: Wsl/WSL_E_DEFAULT_DISTRO_NOT_FOUND

And the output of "wsl --install Ubuntu"

WslRegisterDistribution failed with error: 0x80070002
Error: 0x80070002 The system cannot find the file specified.

Press any key to continue...
The installation process for distribution 'Ubuntu' failed with exit code: 1.
Error code: Wsl/InstallDistro/WSL_E_INSTALL_PROCESS_FAILED

@sonwan2020
Copy link

In my case, it turns out to be the problem related to plugin "Microsoft Defender for Endpoint plug-in for WSL"

  1. Run wsl --set-default-version 1
  2. Install Ubuntu wsl --install -d Ubuntu, the installation succeed but failed to start the system
     WSL1 is disabled by the computer policy.
     Please run 'wsl.exe --set-version Ubuntu 2' to upgrade to WSL2.
     Error code: Wsl/Service/CreateInstance/WSL_E_WSL1_DISABLED
    
  3. Run wsl --set-version Ubuntu 2,
    Conversion in progress, this may take a few minutes.
    A fatal error was returned by plugin 'DefenderforEndpointPlug-in'
    Error code: Wsl/Service/CreateVm/Plugin/ERROR_FILE_NOT_FOUND
    
  4. Check the details about the plugin C:\Program Files\Microsoft Defender for Endpoint plug-in for WSL\tools>healthcheck.exe
[2024-11-14 05:44:08 UTC]
Plugin Version          :
WSL Version             :
Defender App Version    :
Release Ring            :
VM Start Time (UTC)     : 2024-11-06 22:45:09 UTC
LKG Telemetry (UTC)     :
WSL Distro Running      : false

Active User SID         : S-1-12-1-816008863-1211069416-1275109537-96698126
Windows GUID            :
Windows Org ID          :
Windows Device ID       :
Licensed                : Valid

WSL GUID                :
WSL Device ID           :

And there is only one file the healthcheck.exe in the tools directory.
5. via 'Add or remove programs' I failed to repair the plugin, so I uninstall the plugin.
6. wsl --set-version Ubuntu 2 succeed, and wsl --list succeed. My WSL environment works as expected

@GrahamMThomas
Copy link

Confirmed repairing Windows Defender plugin for WSL via "add or remove programs" fixed my issues. as well.

@marcelomoreno26
Copy link

Hey I had this issue recently. It happened after I did a suggested cleanup on my HP Omen, bad idea as I think it deleted some important files. My WSL stopped working and I thought that was my only issue but one day trying to use my GPU I ran 'nvidia-smi' command on terminal and I noticed my driver was gone as well. Thus, i reinstalled my CUDA driver 12.4 and out of curiosity I then tried to install WSL and it all was working like nothing had happened. Hope this helps someone having this same issue, it was driving me crazy.

C:\Windows\System32>nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running. This can also be happening if non-NVIDIA GPU is running as primary display, and NVIDIA GPU is in WDDM mode.


C:\Windows\System32>wsl.exe --install Ubuntu
Ubuntu is already installed.
Launching Ubuntu...
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070002
Error: 0x80070002 The system cannot find the file specified.

Press any key to continue...
The operation completed successfully.

C:\Windows\System32>nvidia-smi
Fri Dec  6 16:42:32 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 551.61                 Driver Version: 551.61         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                     TCC/WDDM  | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 1660 Ti   WDDM  |   00000000:01:00.0 Off |                  N/A |
| N/A   46C    P8              6W /   30W |       0MiB /   6144MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+


C:\Windows\System32>wsl --install Ubuntu
Ubuntu is already installed.
Launching Ubuntu...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: *****
New password:
Retype new password:
\passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)

Here you can see the whole thing in a single session.

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

4 participants