Okay, ici is the strange behavior. I créé myself WSL raccourcis in my taskbar to be able to open par exemple the `gnome-terminal` linux graphical app depuis le raccourci CTRL+ALT+T. The raccourci a fonctionné the day I créé it, but it ne work anymore.
Ici is the command du raccourci located in `C:\Users\guill\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Ubuntu` fichier: `wslg ~ gnome-terminal`
The app will or will not open dans lese situations depending on wheter or not J'ai déjà opened it a first time depuis le cmd wsl:
- Once I'm logged in to Windows and that my ordinateur had sufficient time to boot and ouvrez le startup applications, the app ne va pas open at this moment avec the raccourci.
- Ensuite, si je first open cmd.exe and ensuite tapez in `wsl` to get into wsl, ensuite J'ai wsl opened dans le background. At this moment, trying the raccourci encore ne va pas work.
- Ensuite, si je tapez in `gnome-terminal` dans le wsl command-line session opened depuis le cmd, the gnome terminal will properly open. Si je ensuite do the clavier raccourci, the gnome terminal will open.
Notez que dans le text above, each time that I say that I pressed the clavier raccourci, it has the same result as trying to ouvrez le application depuis le pinned icône dans le taskbar, and vice-versa. The one avec the `wslg ~ gnome-terminal` command dans le menu Démarrer dossier.
So what's up avec that? Il semble que the graphical apps needs to be opened au moins one time avant I'm able to open them depuis le menu Démarrer or clavier raccourci. I'd like WSL to toujours open at startup. I'd également like WSL to toujours be ready to open apps from raccourcis. Je ne sais pas what to do à ce stade.
Je suis considering l'installation Linux again on this ordinateur. WSL ne meet my expectations right maintenant. Je suis on Windows 11.
Thanks!
WSL 2 graphical apps ne va pas start from taskbar (or raccourci), but will start seulement once they are ran from a wsl that was first ouvrired from cmd
Re: WSL 2 graphical apps ne va pas start from taskbar (or raccourci), but will start seulement once they are ran from a wsl that was first ouvrired from cmd
*Short answer:*
Try:
```
wslg ~ dbus-launch gnome-terminal
```
*Explanation:*
Cela ne appear to be a problème avec "graphical apps" in general, but rather avec specific applications.
For instance, si vous installer `xterm` and set it up as a raccourci the same way, Je pense vous allez find that the raccourci fonctionne as vous pourriez expect sans having previously launched from withdans le command-line.
Gnome Terminal, en revanche, is (to state the obvious) a Gnome application. Most Gnome applications require *au moins* D-Bus support, and many require Systemd. Fortunately, Gnome Terminal just requires D-Bus.
Si vous launch it depuis le command-line in a nouveau WSL instance, vous allez see avec a `ps -efH` that it has started a utilisateur-session D-Bus instance for you. Si vous have `gvfs` installé (which n'est pas par défaut, although perhaps it was installé as a dependency of Gnome Terminal), vous allez également see that its daemon a été started (via D-Bus).
So when you ensuite, subsequently, launch `wslg ~ gnome-terminal`, D-Bus is déjà running and Gnome Terminal launches properly. (*Note:* C'est en fait a little more complicated than that, depuis Gnome Terminal really launches as part of a client-server application and c'est the server that ne start in this case.)
But when you attempt to launch it directly via:
- `wslg ~ gnome-terminal`
- Or even just `wsl ~ gnome-terminal`
... ensuite it seems to me that a fairly obscure WSL bug comes into play. C'est possible that c'est "expected" dans le way that WSL starts up, but I've run into this dans le past, and it *appears* to me that WSL's `init` processus is overly aggressive about reaping and terminating orphaned processes that are launched by another processus during startup.
So in this case, as far as Je peux tell (and Je n'ai pas `strace`'d it yet to confirm), Gnome Terminal attempts to start D-Bus, but the `init` reaps it and closes it (improperly, I *believe*). As a result, sans D-Bus running, Gnome Terminal (en fait the server, I believe) ne start.
The workaround above, though, explicitly launches Gnome Terminal *inside* a D-Bus session, so things work as expected.
Try:
```
wslg ~ dbus-launch gnome-terminal
```
*Explanation:*
Cela ne appear to be a problème avec "graphical apps" in general, but rather avec specific applications.
For instance, si vous installer `xterm` and set it up as a raccourci the same way, Je pense vous allez find that the raccourci fonctionne as vous pourriez expect sans having previously launched from withdans le command-line.
Gnome Terminal, en revanche, is (to state the obvious) a Gnome application. Most Gnome applications require *au moins* D-Bus support, and many require Systemd. Fortunately, Gnome Terminal just requires D-Bus.
Si vous launch it depuis le command-line in a nouveau WSL instance, vous allez see avec a `ps -efH` that it has started a utilisateur-session D-Bus instance for you. Si vous have `gvfs` installé (which n'est pas par défaut, although perhaps it was installé as a dependency of Gnome Terminal), vous allez également see that its daemon a été started (via D-Bus).
So when you ensuite, subsequently, launch `wslg ~ gnome-terminal`, D-Bus is déjà running and Gnome Terminal launches properly. (*Note:* C'est en fait a little more complicated than that, depuis Gnome Terminal really launches as part of a client-server application and c'est the server that ne start in this case.)
But when you attempt to launch it directly via:
- `wslg ~ gnome-terminal`
- Or even just `wsl ~ gnome-terminal`
... ensuite it seems to me that a fairly obscure WSL bug comes into play. C'est possible that c'est "expected" dans le way that WSL starts up, but I've run into this dans le past, and it *appears* to me that WSL's `init` processus is overly aggressive about reaping and terminating orphaned processes that are launched by another processus during startup.
So in this case, as far as Je peux tell (and Je n'ai pas `strace`'d it yet to confirm), Gnome Terminal attempts to start D-Bus, but the `init` reaps it and closes it (improperly, I *believe*). As a result, sans D-Bus running, Gnome Terminal (en fait the server, I believe) ne start.
The workaround above, though, explicitly launches Gnome Terminal *inside* a D-Bus session, so things work as expected.