microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.26k stars 812 forks source link

WslRegisterDistribution failed with error: 0x80070490 Error: 0x80070490 Element not found #7946

Open prasaddu opened 2 years ago

prasaddu commented 2 years ago

Version

Microsoft Windows [Version 10.0.19042.1466]

WSL Version

Kernel Version

5.10.16

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

Open PowerShell Window (Admin) wsl --install -d Ubuntu

Open ubuntu with error: image

Expected Behavior

Expected behavior is Ubuntu would be installed as wsl2.

Note: installing Ubuntu as wsl1 works fine.

Actual Behavior

Actual result is the wsl2 ubuntu installation fails with the following: - WslRegisterDistribution failed with error: 0x80070490 Error: 0x80070490 Element not found

Diagnostic Logs

wslLog.txt

adholland commented 2 years ago

Note this happens with all linux distros. Also tried with Debian and same result: - WslRegisterDistribution failed with error: 0x80070490 Error: 0x80070490 Element not found

eqn-group commented 2 years ago

check #5880

adholland commented 2 years ago

check #5880

So we had checked #5880 prior to creating this issue. However that issue is really related to the KB4571756 windows update. Our OS is 20H2, with all the latest updates, so will have already had all the updates to resolve the impact of KB4571756.

So yes the error is the same, but unless @equation-group you can elaborate then I dont think #5880 is of use in this case.

gbasile17 commented 2 years ago

I am also experiencing this. Real through all of #5880 and nothing is relevant to the current state of my OS as its over a year old.

gbasile17 commented 2 years ago

Any update on this?

benhillis commented 2 years ago

I took a look at the logs and WSL is failing to create the virtual network. I will forward this along to the networking team.

Keith-Mange commented 2 years ago

Can you please do the following:

  1. starthnstrace.ps1
  2. repro
  3. stop the trace in 1
  4. collectlogs.ps1

The trace should produce a server.etl with more detail on the error.

CollectLogs will provide a lot of state.

Thanks, Keith

gbasile17 commented 2 years ago

Can you please do the following:

  1. starthnstrace.ps1
  2. repro
  3. stop the trace in 1
  4. collectlogs.ps1

The trace should produce a server.etl with more detail on the error.

CollectLogs will provide a lot of state.

Thanks, Keith

Hey Keith, attached are both files. Thank you for the help! logs.zip

prvks commented 2 years ago

same problem :( Windows 10 21H2 19044.1466 image

Keith-Mange commented 2 years ago

Can you please do the following:

  1. starthnstrace.ps1
  2. repro
  3. stop the trace in 1
  4. collectlogs.ps1

The trace should produce a server.etl with more detail on the error. CollectLogs will provide a lot of state. Thanks, Keith

Hey Keith, attached are both files. Thank you for the help! logs.zip

I don't see a server.etl in logs.zip. We need that to understand where the error is coming from. It should be c:\server.etl.

prvks commented 2 years ago

Can you please do the following:

  1. starthnstrace.ps1
  2. repro
  3. stop the trace in 1
  4. collectlogs.ps1

The trace should produce a server.etl with more detail on the error. CollectLogs will provide a lot of state. Thanks, Keith

Hey Keith, attached are both files. Thank you for the help! logs.zip

I don't see a server.etl in logs.zip. We need that to understand where the error is coming from. It should be c:\server.etl.

Attach my file server.etl server.zip

Keith-Mange commented 2 years ago

I don't see any network issues in the server.etl so I've asked @benhillis to look into it from an HCS perspective.

adholland commented 2 years ago

In the end, as we were totally blocked by this issue, we reinstalled the OS. Installed Windows 10 version 1909, build 18363.1916.

This resolved the issue and we were able to successfully install ubuntu on wsl2.

Not great and pretty drastic, but we had no other option. This issue really needs resolving.

Note: we do have others on the team running 20H2 that were able to install ubuntu on wsl2 - so it is an odd one.

stephania2405 commented 2 years ago

I'd also experienced this error. I tried to fix broken registry, change different setttings of the OS, install different distributions and none of them worked.

Solution / Work around: I got it to work by using wsl1 to install and launch the linux distribution and then switch back to wsl2

davidhay45 commented 2 years ago

Any timescale for a fix?

maxwellcc commented 2 years ago

Hi! I've been a little distressed by this problem and as I haven't found a solution, I decided to try it on my own. I'm using Windows 10 21H2 and this attempt was made on 5/21/2022. I followed these steps and was successful:

  1. I uninstalled the distros using the command > wsl --unregister <Distro>
  2. I uninstalled Docker
  3. I uninstalled Hyper-V
  4. After restarting the computer, I used the command > wsl --set-default-version 2
  5. I reinstalled the Ubuntu distro using the command > wsl --install -d Ubuntu
  6. The Windows Subsystem for Linux instance terminated successfully.
  7. I verified that the distro is running as WSL 2 with the command > wsl -l -v
hiidy commented 2 years ago

Anyone fixed this problem? im using 21h2

gavinB-orange commented 1 year ago

Any progress on this? Existing WSL 1 instance that was installed on Windows 10 is OK, but I cannot install anything new without hitting this error

eqn-group commented 1 year ago

suck my dick

------ Original Message ------ From "gavinB-orange" @.> To "microsoft/WSL" @.> Cc "eq" @.>; "Mention" @.> Date 12/03/2023 15:59:33 Subject Re: [microsoft/WSL] WslRegisterDistribution failed with error: 0x80070490 Error: 0x80070490 Element not found (Issue #7946)

Any progress on this? Existing WSL 1 instance that was installed on Windows 10 is OK, but I cannot install anything new without hitting this error

— Reply to this email directly, view it on GitHub https://github.com/microsoft/WSL/issues/7946#issuecomment-1465153072, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATM2XBHNR53YJKT3PNYVESLW3WQQ3ANCNFSM5MMSRINQ. You are receiving this because you were mentioned.Message ID: @.***>

poonasor commented 1 year ago

I'd also experienced this error. I tried to fix broken registry, change different setttings of the OS, install different distributions and none of them worked.

Solution / Work around: I got it to work by using wsl1 to install and launch the linux distribution and then switch back to wsl2

wsl --set-default-version 1 wsl.exe --install Ubuntu-22.04

this worked for me, thank you!

gsmirnov-splk commented 1 year ago

What worked for me is downloading and installing the latest pre-release version directly from GitHub: https://github.com/microsoft/WSL/releases/tag/1.2.0

gor-arnaud commented 1 year ago

Hello, I don't know if can help but I encountered this issue this morning and fixed it by deleting / recreating profile in Windows Terminal settings.

Puvipavan commented 10 months ago

Already tried turning off and on Windows Subsystem for Linux from Windows Features, but it didn't work. Then noticed that following app is automatically installed from the Microsoft App Store: https://www.microsoft.com/store/productId/9P9TQF7MRM4R?ocid=pdpshare

I had to uninstall it.

Now it works, But my WSL prompts me to install the update:

Windows Subsystem for Linux is now available in the Microsoft Store!
You can upgrade by running 'wsl.exe --update' or by visiting https://aka.ms/wslstorepage
Installing WSL from the Microsoft Store will give you the latest WSL updates, faster.
For more information please visit https://aka.ms/wslstoreinfo

Not Going to update this.

chanpreetdhanjal commented 10 months ago

Could you please follow the steps below and attach the diagnostic logs? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

Puvipavan commented 10 months ago

Executed wsl.exe --update to update the WSL. And again getting same issue. Logs:

WslLogs-2023-11-16_05-21-49.zip

image

Uninstalled above one to fix the issue.

JMD110 commented 10 months ago

What worked for me is downloading and installing the latest pre-release version directly from GitHub: https://github.com/microsoft/WSL/releases/tag/1.2.0

work for me too. thx a lot

keesj-riscure commented 10 months ago

I am having this same error after an update yesterday. Interestingly enough if I open the terminal "as administrator" this problem is not present

image

With the terminal running as administrator some kernel logs can be seen:

[    1.769398] memmap_init_zone_device initialised 2097152 pages in 10ms
[    1.777410] FS-Cache: Duplicate cookie detected
[    1.777842] FS-Cache: O-cookie c=00000004 [p=00000002 fl=222 nc=0 na=1]
[    1.778206] FS-Cache: O-cookie d=0000000088d4401e{9P.session} n=0000000022514c6d
[    1.778613] FS-Cache: O-key=[10] '34323934393337343635'
[    1.778890] FS-Cache: N-cookie c=00000005 [p=00000002 fl=2 nc=0 na=1]
[    1.779279] FS-Cache: N-cookie d=0000000088d4401e{9P.session} n=00000000fc41d0d7
[    1.779775] FS-Cache: N-key=[10] '34323934393337343635'
...

[    2.921911] pci 1ae7:00:00.0: BAR 4: assigned [mem 0x9ffe0e000-0x9ffe0efff 64bit]
[    3.220238] Failed to connect to bus: No such file or directory
[    3.429751] systemd-journald[38]: Received client request to flush runtime journal
...
[   55.831522] lxcbr0: port 3(veth5fePVP) entered blocking state
[   55.831529] lxcbr0: port 3(veth5fePVP) entered forwarding state
[   55.977266] WSL (2) ERROR: WaitForBootProcess:3237: /sbin/init failed to start within 10000
[   55.977269] ms
[   63.077448] traps: gdm-session-wor[3289] trap int3 ip:7f58c40ba4f1 sp:7fff6db9be00 error:0 in libglib-2.0.so.0.7600.1[7f58c4079000+9a000]
[   63.077466] potentially unexpected fatal signal 5.
[   63.077468] CPU: 6 PID: 3289 Comm: gdm-session-wor Not tainted 5.15.133.1-microsoft-standard-WSL2 #1
[   63.077471] RIP: 0033:0x7f58c40ba4f1
[   63.077475] Code: 06 83 f8 02 0f 84 8f 00 00 00 41 83 e5 02 74 1a e8 84 5a 02 00 85 c0 0f 85 f6 01 00 00 8b 44 24 3c 85 c0 0f 85 15 08 fc ff cc <44> 89 e6 48 8d 3d e5 67 0e 00 e8 50 03 05 00 b8 40 00 00 00 41 39
[   63.077477] RSP: 002b:00007fff6db9be00 EFLAGS: 00000246
szitastamas commented 10 months ago

Already tried turning off and on Windows Subsystem for Linux from Windows Features, but it didn't work. Then noticed that following app is automatically installed from the Microsoft App Store: https://www.microsoft.com/store/productId/9P9TQF7MRM4R?ocid=pdpshare

I had to uninstall it.

Now it works, But my WSL prompts me to install the update:

Windows Subsystem for Linux is now available in the Microsoft Store!
You can upgrade by running 'wsl.exe --update' or by visiting https://aka.ms/wslstorepage
Installing WSL from the Microsoft Store will give you the latest WSL updates, faster.
For more information please visit https://aka.ms/wslstoreinfo

Not Going to update this.

It helped for me, thank you. I just uninstalled the App Windows Subsystem for Linux that I installed from the MS-Store a few months ago and everything is working now.

jlee-67 commented 10 months ago

What worked for me is downloading and installing the latest pre-release version directly from GitHub: https://github.com/microsoft/WSL/releases/tag/1.2.0

work for me too. thx a lot

This worked!

indefinitedevil commented 10 months ago

I've uninstalled WSL entirely. I've uninstalled Ubuntu. I've uninstalled Docker. I've uninstalled everything that interacts with it.

I've restarted a dozen times. I've done fresh installs. I've kept things as clean as I possibly can.

I still get this error every time Ubuntu loads. I can get into it if I load it through Powershell, or use Administrator mode but if I can't get it to load normally, my entire development setup fails. This has cost me days of productivity at this point and I'm no closer to a solution.

Older versions, newer versions, none of it seems to matter. This is a nightmare and I'm going to lose so much more time if I need to wipe Windows and start again.

keesj-riscure commented 10 months ago

I've uninstalled WSL entirely. I've uninstalled Ubuntu. I've uninstalled Docker. I've uninstalled everything that interacts with it.

I've restarted a dozen times. I've done fresh installs. I've kept things as clean as I possibly can.

I still get this error every time Ubuntu loads. I can get into it if I load it through Powershell, or use Administrator mode but if I can't get it to load normally, my entire development setup fails. This has cost me days of productivity at this point and I'm no closer to a solution.

Older versions, newer versions, none of it seems to matter. This is a nightmare and I'm going to lose so much more time if I need to wipe Windows and start again.

I am using the same workaround you mention (Running as administrator) and I am waiting for a real fix but this is not blocking me currently.

vrtata commented 10 months ago

Following solution from 10782 solved my problem.

Can you try to:

Delete: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex{A9B7A1B9-0671-405C-95F1-E0612CB4CE7E} See if that solves the issue

tonirug commented 10 months ago

Hi, it worked for me on W10.

My Ubuntu 22.04 machine starts and works fine: uname -r 5.15.133.1-microsoft-standard-WSL2

Thanks a lot Regards

Il martedì 21 novembre 2023 10:36, VRamesh @.***> ha scritto:

Following solution from 10782 solved my problem.

Can you try to:

Delete: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex{A9B7A1B9-0671-405C-95F1-E0612CB4CE7E} See if that solves the issue

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.[https://mail.proton.me/api/core/v4/images?Url=https%3A%2F%2Fgithub.com%2Fnotifications%2Fbeacon%2FAEUW5AEZSFN3UA5GFSHJX2LYFRYZ3A5CNFSM5MMSRIN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGONSBXH6I.gif&DryRun=0&UID=gk27audnjq6gyahcfo7pbj2iman6a5ui]

andrescevp commented 9 months ago

I can access using a elevated windows terminal. But my normal user have no access to this

Element not found.
Error code: Wsl/ERROR_NOT_FOUND
slyfox1186 commented 8 months ago

Hi! I've been a little distressed by this problem and as I haven't found a solution, I decided to try it on my own. I'm using Windows 10 21H2 and this attempt was made on 5/21/2022. I followed these steps and was successful:

  1. I uninstalled the distros using the command > wsl --unregister <Distro>
  2. I uninstalled Docker
  3. I uninstalled Hyper-V
  4. After restarting the computer, I used the command > wsl --set-default-version 2
  5. I reinstalled the Ubuntu distro using the command > wsl --install -d Ubuntu
  6. The Windows Subsystem for Linux instance terminated successfully.
  7. I verified that the distro is running as WSL 2 with the command > wsl -l -v

All I did was powershell: wsl --unregister Debian add or remove programs > Uninstalled Debian completely. powershell: wsl --set-default-version 1 powershell: wsl --install -d Debian powershell: wsl --set-default-version 2

and it worked.

Acecai commented 6 months ago
  1. create “C:\Users\Administrator.wslconfig” and write content in that file: [wsl2]
    localhostForwarding=true
    networkingMode=mirrored
  2. excute in PowerShell: powershell: wsl --shutdown powershell: netsh winsock reset
  3. restart PC

it worked for me

tq0208 commented 3 months ago

I'd also experienced this error. I tried to fix broken registry, change different setttings of the OS, install different distributions and none of them worked. Solution / Work around: I got it to work by using wsl1 to install and launch the linux distribution and then switch back to wsl2

wsl --set-default-version 1 wsl.exe --install Ubuntu-22.04

this worked for me, thank you!

it worked for me!! my OS : 22H2,19045.4593 wsl:2.2.4

MuhammadWaseem29 commented 2 months ago

PS C:\Windows\system32> wsl --install 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.