microsoft / WSL

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

Support for graphical-session.target if systemd=true in esl.conf #11945

Open psztoch opened 3 weeks ago

psztoch commented 3 weeks ago

Debian and other distribution use graphical-session.target to start some user services. Please, add support for this.

github-actions[bot] commented 3 weeks ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The script will output the path of the log file once done. If this is a networking issue, please use [collect-networking-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1), following the instructions [here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues) Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
zcobol commented 3 weeks ago

Didn't try Debian, but on Ubuntu it's the default target:

zcobol@toto:~$ systemctl get-default
graphical.target
zcobol@toto:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian

To change from multi-user.target run sudo systemctl set-default graphical.target

psztoch commented 3 weeks ago

I am talking about --user target. Not global/system target. System targets work good.

psztoch commented 3 weeks ago

/feature

github-actions[bot] commented 3 weeks ago
Diagnostic information ``` Found '/feature', adding tag 'feature' ```
elsaco commented 3 weeks ago

Ubuntu and Debian are using the default.target for user and global and graphical.target for all users:

elsaco@RIPPER:~$ systemctl --system get-default
graphical.target
elsaco@RIPPER:~$ systemctl --global get-default
default.target
elsaco@RIPPER:~$ systemctl --user get-default
default.target

If you want to start services for a user change the default.target. On WSL Ubuntu 22.04 dbus-user-session needs to be installed otherwise you're greeted by Failed to connect to bus: No such file or directory when running systemctl --user

man 7 systemd.special explains it all 😀

psztoch commented 3 weeks ago

man 7 systemd.special explains it all 😀

And graphical-session.target is started by in example gnome-session. If I'm not using GNOME, shouldn't I expect WSL to automatically start wslg-session, which binded to graphical-session will then run the necessary services to come to life...

I do not want to install gnome-session package with 347 packages as dependency:

0 upgraded, 347 newly installed, 0 to remove and 0 not upgraded.
Need to get 228 MB of archives.
After this operation, 823 MB of additional disk space will be used.