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

An unremovable Linux icon shows up on the desktop upon install #11347

Open
1 of 2 tasks
adrianghc opened this issue Mar 22, 2024 · 31 comments
Open
1 of 2 tasks

An unremovable Linux icon shows up on the desktop upon install #11347

adrianghc opened this issue Mar 22, 2024 · 31 comments

Comments

@adrianghc
Copy link

adrianghc commented Mar 22, 2024

This issue is a duplicate of #11325, which was closed prematurely. Please read on.

Windows Version

Microsoft Windows [Version 10.0.22631.3296]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.146.1-2

Distro Version

No response

Other Software

No response

Repro Steps

Install WSL on a new machine through wsl --install, through the Microsoft Store or through the MSIX fron GitHub.

Expected Behavior

A Linux icon should be added to the File Explorer sidebar and nowhere else (not the desktop).

Actual Behavior

Upon install, a Linux icon appears on the desktop that cannot be removed other than through registry changes (see here). The icon is equivalent to the one on the File Explorer sidebar and takes you to \\wsl$. (The icon in the sidebar is still created.)

This icon is created before the Ubuntu app package is installed --- it is NOT related to the Ubuntu app package as claimed in #11325. It also created if one only installs WSL through the MSIX and no distribution, or if one selects a different distribution.

image

This is new and unexpected behavior, as previously, an icon would only be added to the sidebar, not the desktop. It also only happens on new installs. On another machine where WSL has been installed and continually updated (through the Microsoft Store and GitHub) since July 2022, no desktop icon appears even after updating to the latest WSL version.

Diagnostic Logs

No response

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

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. Thank you!

Open similar issues:

Closed similar issues:

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

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 22, 2024

Thank you @adrianghc. We've made some installation fixes in 2.2.1, can you try upgrading and see if the icon is still there ?

If so, can you share a screenshot of it's property page ?

@adrianghc
Copy link
Author

Unfortunately, 2.2.1 doesn't fix this. Also unfortunately, you cannot open the icon's property menu, as that results in this error:

image

"The properties of this element are not available."

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 22, 2024

Thank you @adrianghc. Does the icon go away if you run wsl.exe --uninstall ?

@adrianghc
Copy link
Author

Yes, it does.

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 22, 2024

Ok good. Can you capture a full installing trace by downloading the msi and running:

(as administrator)

msiexec /i <path-to-msi> /L*VX C:\wsllogs.txt

And then check if that re-created the shortcut and if so, share the trace ?

@adrianghc
Copy link
Author

This does indeed create the shortcut. I have attached the log file.

wsllogs.txt

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 23, 2024

Thank you @adrianghc. I have a theory:

Does opening regedit.exe and deleting HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6} gets you rid of the shortcut ?

@adrianghc
Copy link
Author

This is exactly correct. 👍

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 23, 2024

Ok that's the icon I was thinking from. Can you share the content of HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6} ? That's probably where something is messed up.

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 23, 2024

Oh, I have another theory: Is your system main drive installed on C:\ ? Does C:\Windows\System32\windows.storage.dll exist ?

@adrianghc
Copy link
Author

This is the content of HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}]
@="Linux"
"SortOrderIndex"=dword:00000077
"System.IsPinnedToNameSpaceTree"=dword:00000001

[HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}\DefaultIcon]
@="C:\\Windows\\System32\\wsl.exe,-1"

[HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}\InProcServer32]
@="C:\\Windows\\System32\\windows.storage.dll"

[HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}\Instance]
"CLSID"="{4FE04BFD-85B9-49DD-B914-F4C9556B9DA6}"

[HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}\Instance\InitPropertyBag]
"DisplayType"=dword:00000002
"EnumObjectsTelemetryValue"="WSL"
"Provider"="Plan 9 Network Provider"
"ResName"="\\\\wsl.localhost"

[HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}\ShellFolder]
"Attributes"=dword:a080004d
"FolderValueFlags"=dword:00000028

Is your system main drive installed on C:\ ? Does C:\Windows\System32\windows.storage.dll exist ?

Yes and yes.

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 23, 2024

Hmm this all looks correct.

What's the content of HKEY_CLASSES_ROOT\CLSID\{4FE04BFD-85B9-49DD-B914-F4C9556B9DA6}\ShellFolder ?

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 23, 2024

Also another question: Is the "Windows subsystem for Linux" optional component enabled ?

@adrianghc
Copy link
Author

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{4FE04BFD-85B9-49DD-B914-F4C9556B9DA6}\ShellFolder]
"FolderValueFlags"=dword:00080000

The optional component is not installed on this machine, but it is on my other machine where the icon does not appear (the machine I mention in the last paragraph of the original post). You might be onto something there...

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 25, 2024

Thank you @adrianghc. This all looks correct.

Unfortunately I still can't reproduce the issue with the optional component enabled or disabled. Does enabling the optional component and then rebooting make the icon disappear ?

@adrianghc
Copy link
Author

Yes, that is indeed exactly what happens (though it also disappears from the File Explorer sidebar then).

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 26, 2024

Hmm I guess that does makes sense since that would overwrite the registry keys. If you uninstall and then reinstall WSL with the optional component enabled, does the icon come back ?

@adrianghc
Copy link
Author

It does not come back in this case. And that would explain the difference between my two machines.

@syberphunk
Copy link

This happened to me out of the blue, having uninstalled WSL, the Linux icon re-appeared, and clicking upon it had Windows 11 complain at me that 'WSL components were missing'. I had to either recreate the registry entry, or uninstall WSL with wsl.exe --uninstall - I chose the latter.

@akaSugarfly
Copy link

This happened to me out of the blue, having uninstalled WSL, the Linux icon re-appeared, and clicking upon it had Windows 11 complain at me that 'WSL components were missing'. I had to either recreate the registry entry, or uninstall WSL with wsl.exe --uninstall - I chose the latter.

Woa thanks, that helped in my case.
In the past I tested WSL but uninstalled it.
The icon re-appeared after I fiddled arround with networkdrives.

@YoLolo69
Copy link

Ok, it just happened for me. I found WSL was installed by MS Store few minutes before this scary little Penguin appeared on my desktop. I ran all Anti Virus & Malware tools I could think about.
Thanks I landed here, and used the mentioned "wsl.exe --uninstall" through Admin Powershell command to get ride of it.
Weird this cannot be uninstalled through the MS Store or Windows installed App or Components...

@danilo73r
Copy link

I have the same problem!!!

@danilo73r
Copy link

danilo73r commented Jun 14, 2024

This is strange, i had to install docker desktop, the installation seems to activate WSL in the "Windows features on/off".

So i removed the registry dword (the workaround), it is not needed when you activate wsl in win features.

@Crystal-RainSlide
Copy link

Crystal-RainSlide commented Jun 16, 2024

I got the "Linux" Explorer sidebar entry and the desktop icon after uninstalling WSL on different machines some months ago.

Both the fixes works for me:

1:

Run wsl.exe --uninstall again.

If you just uninstalled WSL, you might want to restart Windows before doing so to make sure nothing will interfere.

It will remove the whole HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}, instead of the pin-point fix below, which keeps that entry intact.

2:

Remove the Explorer sidebar entry:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}]
"System.IsPinnedToNameSpaceTree"=dword:00000000

Remove the the desktop icon:

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}]

The icons won't re-appear for me and I didn't test it, since I got the settings sync disabled.
If you only got 1 machine synced, then it should be fixed after you deal with it and sync the settings.

@aceaslee
Copy link

aceaslee commented Jun 17, 2024

Hey you guys. I found the simple way to fix this.

  1. click the search box on windows and search "wsl"
  2. right-click on that wsl icon, then click "Open file location"
  3. In that folder which contains startmenu, you can find 'wsl' icon which is a shortcut to the wsl.exe in System32 folder.
  4. delete the shortcut in that folder and then the desktop icon, 'linux' will also be automatically removed.

Simply, find the shortcut in the start menu folder in your windows,
then delete the appropriate shortcut (wsl) to disappear the icon (linux) in your desktop.

@kaizenlpi
Copy link

kaizenlpi commented Jun 17, 2024 via email

@tianjyan
Copy link

Hey you guys. I found the simple way to fix this.

  1. click the search box on windows and search "wsl"
  2. right-click on that wsl icon, then click "Open file location"
  3. In that folder which contains startmenu, you can find 'wsl' icon which is a shortcut to the wsl.exe in System32 folder.
  4. delete the shortcut in that folder and then the desktop icon, 'linux' will also be automatically removed.

Simply, find the shortcut in the start menu folder in your windows, then delete the appropriate shortcut (wsl) to disappear the icon (linux) in your desktop.

Not work for me.

@Crashim03
Copy link

Was this ever solved? I got the same issue

@torum
Copy link

torum commented Oct 4, 2024

same thing just happened to me.

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