GUI is completely broken when WSL is started from Task Scheduler
Windows build number:
10.0.26100.33438
Your Distribution version:
Ubuntu26.04
Your WSL versions:
2.7.14.0
Steps to reproduce:
- Make sure WSL does not auto-timeout, because it does not reproduce from a manual boot:
.wslconfig
[wsl2]
vmIdleTimeout=-1
[general]
instanceIdleTimeout=-1- Make Task Scheduler start WSL automatically on Windows login, I use
C:\WINDOWS\System32\wsl.exe -d Ubuntu -u hans -e /usr/bin/sleep infinityor to be exact,
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<URI>\WSL AutoStart</URI>
</RegistrationInfo>
<Triggers>
<BootTrigger>
<Enabled>true</Enabled>
<Delay>PT30S</Delay>
</BootTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-4076016600-2003304834-4112563966-500</UserId>
<LogonType>S4U</LogonType>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<Duration>PT10M</Duration>
<WaitTimeout>PT1H</WaitTimeout>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
<Priority>7</Priority>
<RestartOnFailure>
<Interval>PT1M</Interval>
<Count>999</Count>
</RestartOnFailure>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\WINDOWS\System32\wsl.exe</Command>
<Arguments>-d Ubuntu -u hans -e /usr/bin/sleep infinity</Arguments>
</Exec>
</Actions>
</Task>- restart your computer, then open wsl, and try to start any gui program. They won't be able to open any GUI.
Fwiw here is what OpenAI Codex CLI says:
The failure is in WSLg: its Windows display client (
msrdc.exe) is running in session 0 while Administrator’s desktop is in session 1. Weston receives a 0×0 display and crashes inrdp-backend.soabout every 106 seconds. That leaves GUI clients unable to open the display.This closely matches a reported WSLg session 0 regression, including the same
segfault at 218signature. It is the likely cause here, though I have not tested a fresh interactive launch.From an interactive Administrator PowerShell window, run
wsl --shutdown, then start Ubuntu withwsland tryxfce4-terminalagain.wsl --shutdownwill terminate this WSL session and any running Linux processes, so run it when you’re ready for that interruption. If the newmsrdc.exestill lands in session 0, the process or service that initially launches WSL needs to start it in the interactive Windows session.
WSL logs:
No response
WSL dumps:
No response
Expected behavior:
$ xfce4-terminalActual behavior:
For example
$ xfce4-terminal
(xfce4-terminal:2823): Gtk-WARNING **: 15:37:42.850: cannot open display: :0Source: microsoft/wslg