microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.1k stars 304 forks source link

WSL GUI apps extremely slow to open when SystemD enabled since a few days #1273

Open Fede2782 opened 2 months ago

Fede2782 commented 2 months ago

Windows build number:

26100.1150

Your Distribution version:

Debian 12.6

Your WSL versions:

Versione WSL: 2.2.4.0 Versione kernel: 5.15.153.1-2 Versione WSLg: 1.0.61 Versione MSRDC: 1.2.5326 Versione Direct3D: 1.611.1-81528511 Versione DXCore: 10.0.26091.1-240325-1447.ge-release Versione di Windows: 10.0.26100.1150

Steps to reproduce:

Install Debian in an updated WSL2, enable SystemD and install any graphical app, shutdown WSL machine, start it again (meld and nautilus in this example) and launch it from Start's icon or command line. Tests made on a clean install of Windows 11 24H2 in Preview Channel.

WSL logs:

pulseaudio.log stderr.log weston.log

WSL dumps:

N/A

Expected behavior:

Should start as fast as possible as if systemD wasn't enabled. Before last updated, the launch was instant and the app launched immediately after the command was sent.

Actual behavior:

All GUI apps take about 40 to 60 seconds to launch when SystemD is enabled in /etc/wsl.conf.

chiak597 commented 2 months ago

I faced the same issue after dist-upgrading WSL distribution from Debian 11 to Debian 12. I have launched strace and the output has been pretty same like here (stuck on poll syscall for almost 30 seconds): https://bbs.archlinux.org/viewtopic.php?id=262897

For me, a working workaround seems to be just to uninstall the "xdg-desktop-portal" package as recommended in that thread.