wslg icon indicating copy to clipboard operation
wslg copied to clipboard

Linux GUI apps not showing up in Start Menu

Open cerebrate opened this issue 4 years ago • 37 comments

(Submitting this separately from #4 because I don't believe it to be the same issue as #4.)

Environment

Windows build number: 21365
Your Distribution version: Debian 11 (bullseye/sid) / Ubuntu 20.04
Your WSLg version: 1.0.17.1

Steps to reproduce

Unknown (should be automatic, I believe?).

I have been using GUI apps on the former distribution for some time before WSLg was released; the latter distribution was a fresh install. In neither case have the Linux GUI apps showed up in the Start menu, and I can confirm that in both cases definition files exist for them under /usr/share/applications.

WSL logs:

Expected behavior

Icons representing the Linux GUI apps should show up in a distro-specific folder, per this repo's README.

Actual behavior

No such icons appear.

cerebrate avatar Apr 22 '21 18:04 cerebrate

@cerebrate , thanks for reporting, from the provided log, it's failing to add watch to /usr/local/share/applications with permission denied (while /usr/share/applications was succeeded), can you check the permission on /usr/local/share/applications ? thanks!

[11:33:44.808] app_list_monitor_thread: inotify_add_watch(/usr/share/applications) [11:33:45.029] app_list_monitor_thread: inotify_add_watch(/usr/local/share/applications) [11:33:45.029] app_list_monitor_thread: inotify_add_watch failed: Permission denied

hideyukn88 avatar Apr 22 '21 18:04 hideyukn88

Aha! Yes, that seems to have been the issue. Permissions on /usr/local/share/applications had no "other" permissions, only user and group. Adding "o+rx" made the shortcuts appear.

cerebrate avatar Apr 22 '21 19:04 cerebrate

@cerebrate , I'm curious how common those folders don't have "other" permission ? Is this something you have done for some reason ? or the distro you installed is pre-configured in that way ? (but at least it looks Ubuntu 20.04 doesn't come with that).

hideyukn88 avatar Apr 22 '21 23:04 hideyukn88

Looking at my test Ubuntu 20.04 distribution, it doesn't appear to come with a /usr/local/share/applications folder at all; same goes for my Alpine.

I don't think it's anything I've done intentionally, at least with regard to that folder in particular. Not being sure precisely where and when that folder was created, I suppose it's possible that it might be related to my running with umask 007 (set in my .zprofile), a habit originally from shared Unix systems that I've kept up for years, maybe?

cerebrate avatar Apr 23 '21 05:04 cerebrate

I'm having the same issue. From my weston.log file, I can see that it can't find /usr/local/share/applications. But I have confirmed that this folder exists, and there are several .desktop folders inside it. The folder also has rx permission for others.

abhishekchak52 avatar Oct 18 '21 22:10 abhishekchak52

@abhishekchak52, by looking at your weston.log, those .desktop are for either terminal application or has "NoDisplay" property, thus no program links are created, have you tried like "Firefox"? thanks!

hideyukn88 avatar Oct 18 '21 22:10 hideyukn88

@hideyukn88 Thanks for responding so quickly.

Those are not the apps I'm having trouble with. I have emacs installed which has .desktop files in /usr/local/share/applications, but in weston.log, these are the lines I see

[16:23:18.069] app_list_monitor_thread: /usr/local/share/applications doesn't exist, skipping.
[16:23:18.321] app list folder[1]: /usr/local/share/applications

I don't understand the second line. Has it found the folder but can't read it? Permissions shouldn't be an issue here.

I decided to try copying my emacs.desktop from /usr/local/share/applications to /usr/share/applications but it didn't create an entry. At the bottom of weston.log, I find the following lines:

[18:24:11.941] app_list_monitor_thread: file created/updated (emacs.desktop)
[18:24:11.960] desktop file: /usr/share/applications/emacs.desktop
[18:24:11.960]     Name[en_US]:Emacs (Ubuntu)
[18:24:11.960]     Exec:emacs 
[18:24:11.960]     TryExec:(null)
[18:24:11.960]     WorkingDir:(null)
[18:24:11.960]     Icon name:emacs
[18:24:11.960]     Icon file:(null)
[18:24:11.960] app list entry updated: Key:emacs, Name:Emacs (Ubuntu)
[18:24:11.960] app_list_monitor_thread: file created/updated (emacs.desktop)
[18:24:11.960] desktop file: /usr/share/applications/emacs.desktop
[18:24:11.960]     Name[en_US]:Emacs (Ubuntu)
[18:24:11.960]     Exec:emacs 
[18:24:11.960]     TryExec:(null)
[18:24:11.960]     WorkingDir:(null)
[18:24:11.960]     Icon name:emacs
[18:24:11.960]     Icon file:(null)
[18:24:11.960] app list entry updated: Key:emacs, Name:Emacs (Ubuntu)
[18:24:11.960] free_app_entry(): Emacs (Ubuntu): /usr/share/applications/emacs.desktop
[18:57:39.778] app_list_monitor_thread: file created/updated (firefox.desktop)
[18:57:39.778] desktop file: /usr/share/applications/firefox.desktop
[18:57:39.778]     Name[en_US]:Firefox Web Browser (Ubuntu)
[18:57:39.778]     Exec:firefox 
[18:57:39.778]     TryExec:(null)
[18:57:39.778]     WorkingDir:(null)
[18:57:39.778]     Icon name:firefox
[18:57:39.778]     Icon file:(null)
[18:57:39.778] app list entry updated: Key:firefox, Name:Firefox Web Browser (Ubuntu)

This is after I installed firefox as you suggested, but nothing popped up for that either.

abhishekchak52 avatar Oct 18 '21 23:10 abhishekchak52

@abhishekchak52, I'm not seeing that issue. Would you please update to the latest WSLg? It looks yours is too old version. Thanks!

Your WSLg version: 1.0.17.1

image

hideyukn88 avatar Oct 19 '21 00:10 hideyukn88

@hideyukn88 Yeah, I think something else might be the issue. wsl.exe --version gives me

WSL version: 0.47.1.0
Kernel version: 5.10.60.1
WSLg version: 1.0.29
Windows version: 10.0.22000.282

There might be an issue elsewhere because now weston.log says it added an entry, but I still can't see it in Start.

Thank you for your help

abhishekchak52 avatar Oct 19 '21 01:10 abhishekchak52

@abhishekchak52, it looks you have lifted version of WSL from Store, right? The problem seems below which indicates Emacs is removed from tracking list. Btw, do you see Firefox in the Menu?

[18:24:11.960] app list entry updated: Key:emacs, Name:Emacs (Ubuntu) [18:24:11.960] free_app_entry(): Emacs (Ubuntu): /usr/share/applications/emacs.desktop

hideyukn88 avatar Oct 19 '21 01:10 hideyukn88

@hideyukn88 No I can't see firefox either. Is there any way I can remove WSL completely and then reinstall everything?

abhishekchak52 avatar Oct 19 '21 03:10 abhishekchak52

@abhishekchak52, please do below.

0: At cmd.exe, "wsl --shutdown". 1: Settings App -> Apps & Features -> Uninstall "Windows Subsystem for Linux WSLg Preview". 2: At same Apps & Features -> Uninstall "Windows Subsystem for Linux". 2: Start Menu -> Find "Windows Subsystem for Linux Preview" -> Right click -> Uninstall.

Then reinstall WSL from Store app. Please let me know how it goes. If problem persist, please share weston.log again, thanks!

hideyukn88 avatar Oct 19 '21 16:10 hideyukn88

@hideyukn88 I went a bit further and did what you asked + turning off/on the optional feature for WSL, and now it seems to work. Thank you so much for helping me out!

abhishekchak52 avatar Oct 19 '21 16:10 abhishekchak52

I'm having the exact same problem, but the solution above doesn't works.

WSL logs:

I'm using Windows 11 (OS Build 22000.318) and Windows Subsystem for Linux from Microsoft Store.

scythx avatar Nov 20 '21 05:11 scythx

I did this and it worked for me:

  1. Turn the windows feature on or off -> Disable "Windows Subsystem for Linux"
  2. Restart your computer
  3. Apps and features -> Uninstall "Linux Subsystem for Linux Update"
  4. Apps and features -> Uninstall "Linux Subsystem for Linux WSLg Preview"
  5. Apps and features -> Uninstall "Linux Subsystem for Linux Preview"
  6. Restart your computer
  7. Turn the windows feature on or off -> Enable "Windows Subsystem for Linux"
  8. Restart your computer
  9. Go to Settings -> Windows update -> Check for updates (It will automatically install "Linux Subsystem for Linux Update" and "Linux Subsystem for Linux WSLg Preview".)
  10. Restart your computer
  11. Now, if you open Ubuntu distro or other distros terminal the GUI apps will be showed up in the start menu.

Caution: I recommend not installing the "Linux Subsystem for Linux Preview" app from the windows store. It will load some extra preview options which lead you to some bugs. All the necessary options will be installed via check for updates.

ErfanRasti avatar Sep 04 '22 08:09 ErfanRasti

I did this and it worked for me:

  1. Turn the windows feature on or off -> Disable "Windows Subsystem for Linux"
  2. Restart your computer
  3. Apps and features -> Uninstall "Linux Subsystem for Linux Update"
  4. Apps and features -> Uninstall "Linux Subsystem for Linux WSLg Preview"
  5. Apps and features -> Uninstall "Linux Subsystem for Linux Preview"
  6. Restart your computer
  7. Turn the windows feature on or off -> Enable "Windows Subsystem for Linux"
  8. Restart your computer
  9. Go to Settings -> Windows update -> Check for updates (It will automatically install "Linux Subsystem for Linux Update" and "Linux Subsystem for Linux WSLg Preview".)
  10. Restart your computer
  11. Now, if you open Ubuntu distro or other distros terminal the GUI apps will be showed up in the start menu.

Caution: I recommend not installing the "Linux Subsystem for Linux Preview" app from the windows store. It will load some extra preview options which lead you to some bugs. All the necessary options will be installed via check for updates.

I had the same issue where weston.log showed that GUI apps were recognized correctly, but they were not reflected in the start menu. Uninstalling the WSL Preview from the Store and using WSL from the Windows feature + Windows Update instead fixed it, so I suppose there might be a bug with the newest WSL version from the Store.

adrianghc avatar Sep 07 '22 11:09 adrianghc

Same issue here, I found that the shortcuts are successfully created under /usr/share/application, and running them in wsl opens the gui app correctly. However, those shortcuts don't show up in the start menu folder. I managed to create a shortcut manually by these steps:

  1. Navigate to /usr/share/application and check whether a .desktop file is created, if so, remember its name. Say, the file name is app_name.desktop.
  2. Execute the filename of the .desktop file anywhere in wsl to see whether a gui app opens correctly (try to execute app_name in wsl).
  3. In Windows, navigate to $HOME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Ubuntu-22.04 and right-click to create a shortcut file.
  4. In the Type the location of the item box, input the following commands: C:\Windows\System32\wslg.exe ~ -d Ubuntu-22.04 app_name.
  5. Click next and give the shortcut a name you like. You could also change its icon later, the shortcut should showup in the start menu now.

Hope this manual solution helps :-).

hukz18 avatar Sep 17 '22 15:09 hukz18

For me, the problem is fixed after an update to windows 11 22622.601, new wsl apps show up automaticaly.

hukz18 avatar Sep 23 '22 17:09 hukz18

No luck for me, followed every step to the dot.. Just seems apps cannot show up on my system.

WSLg is part of the WSL Preview installed via store... no other way to get it!

EDIT: Can only add apps manually. wslg is just ignore everything. Log says its working, but its not.

Looks like there could be a issue in my logs. weston.log

EDIT: After looking at the github kernel wsl packages it seems many issues have been fixed in later kernel version which is only available with Insider. My issues may be related to kernel 5.10 wsl where wslg has several big bugs present. Will be trying to update to insider now, if it will let me.

My windows version is 22000.978 which is the very latest available to me. No idea how to get this new version everyone is running other then insider, which doesn't work on my PC.

Final UPDATE (I hope): So it turns out I had some policy and telemetry services disabled or mis-configured. Now I'm downloading 10.0.22622.601 insider preview update. Hopefully this resolves all these WSL issues.
I really don't know why MS can't push out micro-updates to fix problems in WSLg instead of putting it all bundled in a MASSIVE mega update! it works for Linux!

jarrard avatar Sep 27 '22 06:09 jarrard

I got the same problem. I have managed to create the shortcuts manually. Create the shortcut here: C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Ubuntu(distro name) VLC.lnk C:\Windows\System32\wsl.exe ~ -d Ubuntu /usr/bin/vlc

It is working like a charm :-)

VenelinU avatar Oct 05 '22 18:10 VenelinU

I'm having the same issue on Windows 22h2 fully updated. Interestingly, I had it working when I did an upgrade install of 22h2 without the most recent updates, but I was having other issues, so I did a clean install of Windows 22h2 and now I am having this issue. I tried using all three methods of installing that I'm aware of, uninstalling it completely in between but nothing helps. I tried setting the permissions for the /usr/share/application folder but that didn't help either. I can get Icons in the start menu by creating shortcuts manually, but the Icons are wrong and some of the apps open a terminal window as well as the app. I don't really know where to find the log files. Any help would be appreciated.

TAJ68PR avatar Oct 09 '22 23:10 TAJ68PR

I was having issues too, until I turned on systemd (e.g. allows snaps to work)

If you're using Ubuntu, it does somewhat rely on snaps to install apps.

For me, FireFox wasn't getting an app shortcut created, but upon turning on systemd, and installing FireFox again, that app shortcut was showing up.

Maybe this is the issue for others?

Andrew-J-Larson avatar Dec 01 '22 22:12 Andrew-J-Larson

In my case, the distro I was using didn't have /usr/local/share/applications, it was using /usr/share/applications/. So I just created a symlink and after a windows reboot, everything works as it should

ln -s /usr/share/applications/ /usr/local/share/

Paranoid-Dev avatar Feb 16 '23 05:02 Paranoid-Dev

In my case, the distro I was using didn't have /usr/local/share/applications, it was using /usr/share/applications/. So I just created a symlink and after a windows reboot, everything works as it should

ln -s /usr/share/applications/ /usr/local/share/

@Paranoid-Dev, I think that folder should be monitored, please let us know if it still doesn't work, thanks!

https://github.com/microsoft/weston-mirror/blob/7fd9ba2f35b6171ddaedc5990432d6de10695008/rdprail-shell/app-list.c#L857

hideyukn88 avatar Feb 16 '23 17:02 hideyukn88

I'm having the same issue here i followed the instruction and it work it show all gui application but when i click the application it won't load/open

ctosagme avatar Feb 27 '23 10:02 ctosagme

@ctosagme, do you mean none of application showed up in Start Menu start up? We are aware of certain applications, such as sublime text, doesn't startup, but most of application should work, would you please give us a few examples of applications doesn't start up? thanks!

hideyukn88 avatar Feb 27 '23 17:02 hideyukn88

here's some example some of them open but not the others like firefox, Root Terminal Emulator https://www.reddit.com/user/ctos123game/comments/11dvngi/linux_application_wont_open/?utm_source=share&utm_medium=web2x&context=3

ctosagme avatar Feb 28 '23 03:02 ctosagme

@Paranoid-Dev, I think that folder should be monitored, please let us know if it still doesn't work, thanks!

microsoft/weston-mirror@7fd9ba2/rdprail-shell/app-list.c#L857

It looks like some editors are using ~/.local/share/applications/ (or at least Jetbrains).

$ ll ~/.local/share/applications/
total 20K
-rwxr--r-- 1 vince vince 407 Nov 22 21:03 jetbrains-fleet-6ec15a84-983d-477a-b83c-bd87d0796ae5.desktop
-rwxr--r-- 1 vince vince 363 Nov 22 21:02 jetbrains-fleet.desktop
-rwxr--r-- 1 vince vince 434 Nov 22 21:09 jetbrains-idea-ce-8f3949b8-85b3-4398-ac33-02f6178eff3f.desktop
-rwxr--r-- 1 vince vince 441 Nov 22 21:01 jetbrains-toolbox.desktop

Can it also be monitored or should we ask them to create them at another place ?

MrLuje avatar Nov 22 '23 20:11 MrLuje

I have that problem on Windows 11 - even though .desktop files are being created under /usr/share/applications (and Start Menu shortcuts even appear after the app is installed) - shortcuts get removed after some time while .desktop files are still in their location.

On WSL start I can see that some (two) apps are properly added to shortcuts. In my case these are firefox and audacity. In the weston.log I can see e.g.:

[20:31:19.373] desktop file: /usr/share/applications/audacity.desktop
[20:31:19.373]     Name[en_US]:Audacity (Debian)
[20:31:19.373]     Exec:env GDK_BACKEND=x11 audacity
[20:31:19.373]     TryExec:(null)
[20:31:19.373]     WorkingDir:(null)
[20:31:19.373]     Icon name:audacity
[20:31:19.373]     Icon SVG :1
[20:31:19.373]     Icon file:/usr/share/icons/hicolor/scalable/apps/audacity.svg
[20:31:19.373]     Icon image:0x7f76a8036250
[20:31:19.373] app list entry updated: Key:audacity, Name:Audacity (Debian)

However for a lot of others I have these errors:

[20:31:19.374] attach_app_list_namespace failed Invalid argument
[20:31:19.374] desktop file: /usr/share/applications/pavucontrol.desktop is failed to be loaded: No such file or directory
[20:31:19.374] app list entry failed to update: Key:pavucontrol
[20:31:19.374] free_app_entry(): (null): /usr/share/applications/pavucontrol.desktop
[20:31:19.374] attach_app_list_namespace failed Invalid argument
[20:31:19.374] desktop file: /usr/share/applications/sqlitebrowser.desktop is failed to be loaded: No such file or directory
[20:31:19.374] app list entry failed to update: Key:sqlitebrowser
[20:31:19.374] free_app_entry(): (null): /usr/share/applications/sqlitebrowser.desktop
[20:31:19.374] attach_app_list_namespace failed Invalid argument

WSL version: 2.0.14.0 Kernel version: 5.15.133.1-1 WSLg version: 1.0.59 MSRDC version: 1.2.4677 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.3007

trueuto avatar Jan 24 '24 19:01 trueuto

I had Linux GUI apps listed in my start menu, then today I installed 4 new Linux GUI apps, and only one showed up in start menu. Rebooted and then the 4 new ones were in start menu, but some of the originals were missing. Ran 'wsl --update' and it got the newest version (2.0.14) and I rebooted. After reboot, no Linux GUI apps are in the start menu.

TheNavyBear avatar Jan 29 '24 18:01 TheNavyBear