wslg
wslg copied to clipboard
ln error when starting wslg-session.service on Fedora 43
Windows Version
Microsoft Windows [Version 10.0.26200.6899]
WSL Version
2.6.1.0
Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
Kernel Version
No response
Distro Version
FedoraLinux-43
Other Software
No response
Repro Steps
On FedoraLinux-43 Emacs wont open in GUI mode Emacs opens in GUI mode fine on FedoraLinux-42
There really isnt much more to it, this is the issue or bug
Expected Behavior
Emacs to open in GUI mode
Actual Behavior
Emacs opens in Terminal mode, when ran from the command line as just emacs and the command "C:\Program Files\WSL\wslg.exe" -d FedoraLinux-43 --cd "~" -- emacs-desktop does nothing, it doesnt even raise an error
Diagnostic Logs
No response
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 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, following the instructions in Collect WSL logs for networking issues
Once completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
Diagnostic information
Issue was edited and new log file was found: https://github.com/user-attachments/files/23436100/WslLogs-2025-11-09_00-16-52.zip
.wslconfig found
Detected appx version: 2.6.1.0
On fresh install of Fedora 43, could not reproduce:
on a fresh install i still have the same issue and emacs-desktop is not found
note i ran sudo dnf update , before running sudo dnf install emacs
also on fedora 43 those are the emacs command i have
on fedora 42 i have different ones
@shishini
Have you tried sudo dnf install emacs-desktop -y? The desktop app is not included in the base emacs install.
thank you :) Yes, installing emacs-desktop fixes it note that on fedora 42, i didnt need to install emacs desktop separately
on a side note, not sure if related but i sometime get this error with fedora43
wsl: Failed to start the systemd user session for 'shishini'. See journalctl for more details.
and the output of journalctl _SYSTEMD_UNIT=user@$(id -u shishini).service
is (well the part in think is relevant) and i added ** ** around the error lines
-- Boot d2a46356865f4fa183c3c916443b2fd4 --
Nov 10 15:15:14 PW0DL2NA (systemd)[212]: pam_unix(systemd-user:session): session opened for user shishini(uid=1000) by shishini(uid=0)
Nov 10 15:15:14 PW0DL2NA (sd-exec-strv)[217]: '/run/systemd/user-generators/wsl-user-generator' is marked world-writable, which is a security risk as it is executed with privileges. Please remove world writab>
Nov 10 15:15:14 PW0DL2NA systemd[212]: Queued start job for default target default.target.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Created slice app.slice - User Application Slice.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Started systemd-tmpfiles-clean.timer - Daily Cleanup of User's Temporary Directories.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Reached target paths.target - Paths.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Reached target timers.target - Timers.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Starting dbus.socket - D-Bus User Message Bus Socket...
Nov 10 15:15:14 PW0DL2NA systemd[212]: Listening on systemd-ask-password.socket - Query the User Interactively for a Password.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Starting systemd-tmpfiles-setup.service - Create User Files and Directories...
Nov 10 15:15:14 PW0DL2NA systemd[212]: Starting wslg-session.service - WSLg user service...
Nov 10 15:15:14 PW0DL2NA systemd[212]: Listening on dbus.socket - D-Bus User Message Bus Socket.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Reached target sockets.target - Sockets.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Finished systemd-tmpfiles-setup.service - Create User Files and Directories.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Reached target basic.target - Basic System.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Reached target default.target - Main User Target.
Nov 10 15:15:14 PW0DL2NA sh[230]: ln: '/mnt/wslg/runtime-dir/pulse/native' and '/run/user/1000/pulse/native' are the same file
Nov 10 15:15:14 PW0DL2NA systemd[212]: wslg-session.service: Main process exited, code=exited, status=1/FAILURE
**
Nov 10 15:15:14 PW0DL2NA systemd[212]: wslg-session.service: Failed with result 'exit-code'.
Nov 10 15:15:14 PW0DL2NA systemd[212]: Failed to start wslg-session.service - WSLg user service.
**
Nov 10 15:15:14 PW0DL2NA systemd[212]: Startup finished in 159ms.
Nov 10 15:20:24 PW0DL2NA systemd[212]: Created slice background.slice - User Background Tasks Slice.
Nov 10 15:20:24 PW0DL2NA systemd[212]: Starting systemd-tmpfiles-clean.service - Cleanup of User's Temporary Files and Directories...
Nov 10 15:20:24 PW0DL2NA systemd[212]: Finished systemd-tmpfiles-clean.service - Cleanup of User's Temporary Files and Directories.
tl;dr wslg-session.service throws an error when creating pulse soft links in Fedora 34, but it doesn't appear to affect the ability to run GUI apps or play audio.
I can see that too @shishini when running journalctl --user -u wslg-session.service --no-pager -n 500.
sudo systemctl --user status wslg-session.service shows:
This does not seem to cause an issue launching GUI applications though.
It possibly appears to be related to this soft link failing: sh[453]: ln: '/mnt/wslg/runtime-dir/pulse/native' and '/run/user/0/pulse/native' are the same file.
Let's take a look at wslg-session.service:
systemctl --user show -p FragmentPath wslg-session.service reports: FragmentPath=/run/user/1000/systemd/generator/wslg-session.service
When we cat that out: cat /run/user/1000/systemd/generator/wslg-session.service we see:
hayden@WDK2023:/run/systemd/system$ cat /run/user/1000/systemd/generator/wslg-session.service
# Note: This file is generated by WSL to configure wslg.
[Unit]
Description=WSLg user service
DefaultDependencies=no
[Service]
Type=oneshot
Environment=WSLG_RUNTIME_DIR=/mnt/wslg/runtime-dir
ExecStart=/bin/sh -c 'mkdir -p -m 00755 "$XDG_RUNTIME_DIR/pulse"'
ExecStart=/bin/sh -c 'ln -sf "$WSLG_RUNTIME_DIR/wayland-0" "$XDG_RUNTIME_DIR/wayland-0"'
ExecStart=/bin/sh -c 'ln -sf "$WSLG_RUNTIME_DIR/wayland-0.lock" "$XDG_RUNTIME_DIR/wayland-0.lock"'
ExecStart=/bin/sh -c 'ln -sf "$WSLG_RUNTIME_DIR/pulse/native" "$XDG_RUNTIME_DIR/pulse/native"'
ExecStart=/bin/sh -c 'ln -sf "$WSLG_RUNTIME_DIR/pulse/pid" "$XDG_RUNTIME_DIR/pulse/pid"'
Running each of those link commands after 'boot' manually doesn't seem to generate an error:
hayden@WDK2023:/run/systemd/system$ ln -sf "$WSLG_RUNTIME_DIR/wayland-0" "$XDG_RUNTIME_DIR/wayland-0"
hayden@WDK2023:/run/systemd/system$ ln -sf "$WSLG_RUNTIME_DIR/wayland-0.lock" "$XDG_RUNTIME_DIR/wayland-0.lock"
hayden@WDK2023:/run/systemd/system$ ln -sf "$WSLG_RUNTIME_DIR/pulse/native" "$XDG_RUNTIME_DIR/pulse/native"
hayden@WDK2023:/run/systemd/system$ ln -sf "$WSLG_RUNTIME_DIR/pulse/pid" "$XDG_RUNTIME_DIR/pulse/pid"
Installing paplay and some test sounds in alsa-utils with sudo dnf install paplay alsa-utils and then running paplay /usr/share/sounds/alsa/Front_Center.wav, I get audio, despite the failure of WSLg user service to start.
I would mark this as a low priority, but worthy of investigation, potentially a change in Pulse on Fedora 43, and should be moved to microsoft/WSLg. cc @OneBlue
@shishini Thank you for reporting this. Since we solved your earlier issue with emacs, would you mind updating the title of this issue to "ln error when starting wslg-session.service on Fedora 34". I would appreciate it. I have also asked the admins that it be moved to the WSLg repo.
going back a bit to the original emacs issues now after installing emacs-pgtk which seemed to add the missing emacs-desktop command i get this error when i open gui emacs
@shishini Can I ask why you are using -pgtk instead of -gtk+x11?
sudo dnf-install emacs-desktop , picked emacs-pgtk to install , i didnt really pick pgtk explicitly
which kinda takes us back to the first issue, i dont know why on my machine sudo dnf-install emacs didnt install
the emacs-desktop command or the emacs gtk version