Skip to content

WSLg msrdc.exe ("Remote Desktop") window pops up every 60 seconds — steals focus with continuous connect/disconnect cycle #41418

Closed

Description

@vstralcn

Windows Version

10.0.26100.4061 (Windows 11 24H2)

WSL Version

2.6.2.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

6.6.87.2-1

Distro Version

Ubuntu 22.04

Other Software

WSL version: 2.6.2.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.71
MSRDC version: 1.2.6353.0
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.4061 (Windows 11 24H2)

Repro Steps

  1. Windows 11 24H2 (build 26100.4061), WSL 2.6.2.0, MSRDC 1.2.6353, WSLg 1.0.71.
  2. Two WSL distributions registered:
    • Ubuntu-22.04 (BasePath: C:\wsl2)
    • docker-desktop (BasePath: D:\ProgramData\Docker\data\main)
  3. .wslconfig (at %USERPROFILE%\.wslconfig):

[wsl2]
autoProxy = true
networkingMode = mirrored

  1. Docker Desktop service (com.docker.service) is stopped; no Docker GUI or engine is intentionally running.
  2. The WSL VM (vmmemWSL + vmcompute) boots at user logon — wslservice.exe starts automatically.
  3. Without opening any WSL terminal, running any WSL GUI app, or launching any remote desktop:
    • Observe foreground window focus every minute, or monitor with a focus-logging tool.
    • Every cycle a window titled "远程桌面" (Remote Desktop) flashes momentarily and steals focus.

Note: the cycle exists independently of any user-initiated WSL activity. It was observed to have been running continuously since at least ~09:20 local time (spanning 8+ hours), confirmed via RDPClient event log and MSRDC auto-trace .etl file timestamps.

Expected Behavior

WSLg's RDP client (C:\Program Files\WSL\msrdc.exe) should either:

  • Maintain a stable, persistent session to the WSLg server without dropping every 25 seconds and reconnecting every 60 seconds; OR
  • Not show a visible foreground window titled "远程桌面" when reconnecting in RemoteApp/headless mode (remoteapplicationmode:i:1 in wslg.rdp); OR
  • If the WSLg session genuinely cannot be maintained (e.g., due to a driver incompatibility or a crashing system distro), the WSL service should stop retrying indefinitely with a focus-stealing window and instead log the error / implement backoff / surface a diagnostic notification.

In short: no visible "Remote Desktop" window should pop up and steal focus unless the user explicitly launched Remote Desktop or a WSL GUI application.

Actual Behavior

Every 60 seconds, precisely:

Second What happens
:41 wslservice.exe spawns wslhost.exe (two instances, one per distro).
:46 One wslhost.exe spawns msrdc.exe (C:\Program Files\WSL\msrdc.exe, FileDescription: "远程桌面", ProductName: Microsoft® Remote Desktop, version 1.2.6353.0).
:46 msrdc.exe connects to the local WSLg server over Hyper-V socket (hvsocketenabled:i:1, remoteapplicationmode:i:1 per wslg.rdp). RDPClient event log IDs: 1024 (attempt), 1025 (connected), 1401 (graphics protocol), 1028 (SSL not supported), 1029 (SHA256 user).
:46 A window titled "远程桌面" appears in the foreground and steals keyboard/shell focus. It stays visible for ~0.1–7 seconds, then disappears.
:11 (+25 s) RDP session disconnects with reason 2308. Event ID 1033: "Component name: slint, :: SL::OnDisconnected, error code: 0x904". Event ID 1026: "RDP ClientActiveX has disconnected (Reason = 2308)". Event ID 1105: "Multi-transport connection disconnected".
:11 msrdc.exe and wslhost.exe exit.
next :41 Cycle repeats.

Process parent chain (verified across 4 consecutive cycles via NtQueryInformationProcess → InheritedFromUniqueProcessId):

wslservice.exe (PID 6440, SYSTEM, running continuously since boot) └── wslhost.exe (spawned at :41 each cycle, e.g. 17:27:41.853) └── msrdc.exe (spawned at :46, e.g. 17:27:46.371)

Connect/disconnect log pattern (last 16 pairs from Microsoft-Windows-TerminalServices-RDPClient/Operational):

08-22 17:31:46 Id=1024 (connect)
08-22 17:31:11 Id=1026 (disconnect)
08-22 17:30:46 Id=1024
08-22 17:30:11 Id=1026
08-22 17:29:46 Id=1024
08-22 17:29:11 Id=1026
08-22 17:28:46 Id=1024
08-22 17:28:12 Id=1026
08-22 17:27:46 Id=1024
08-22 17:27:11 Id=1026
08-22 17:26:46 Id=1024
08-22 17:26:11 Id=1026
08-22 17:25:46 Id=1024
08-22 17:25:11 Id=1026
08-22 17:24:46 Id=1024
08-22 17:24:11 Id=1026

What was explicitly ruled out:

  • ❌ Store "Microsoft Remote Desktop" AppX package — not installed.
  • ❌ Scheduled tasks referencing msrdc/RemoteDesktop — none.
  • ❌ Startup registry entries / Startup folders — none.
  • ❌ WMI persistent event consumers — none.
  • ❌ Docker Desktop running — service stopped, no Docker processes.
  • ❌ External RDP inbound — TermService is Stopped.
  • ❌ Third-party remote-control apps (ToDesk, AnyDesk, etc.) — none present.

Diagnostic Logs

1. wsl --version

WSL version: 2.6.2.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.71
MSRDC version: 1.2.6353.0
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.4061

2. .wslconfig

[wsl2]
autoProxy = true
networkingMode = mirrored

3. C:\Program Files\WSL\wslg.rdp

audiocapturemode:i:2
authentication level:i:0
disableconnectionsharing:i:1
enablecredsspsupport:i:0
hvsocketenabled:i:1
remoteapplicationmode:i:1
remoteapplicationprogram:s:dummy-entry

4. C:\Program Files\WSL\msrdc.exe file version

FileDescription: 远程桌面
ProductName: Microsoft® Remote Desktop
FileVersion: 1.2.6353.0
ProductVersion: 1.2.6353.0
CompanyName: Microsoft Corporation

5. RDPClient Operational log

Event log: Microsoft-Windows-TerminalServices-RDPClient/Operational

Relevant event IDs observed every cycle:

  • 1024 — RDP ClientActiveX is attempting to connect to server (GUID: AF33E7FB-A4B3-4751-B6D2-9D5BBEE4F306)
  • 1025 — RDP ClientActiveX has connected to server
  • 1028 — Server supports SSL = not supported
  • 1029 — Base64(SHA256(UserName)) = -
  • 1401 — Server is using 0x80004 version of RDP graphics protocol (client mode: 0, AVC available: 0)
  • 1403 — Client is using software memory for frame buffer
  • 1105 — Multi-transport connection disconnected
  • 1033 — Component name: slint, :: SL::OnDisconnected, error code: 0x904
  • 1026 — RDP ClientActiveX has disconnected (Reason = 2308)

6. MSRDC auto-trace ETL files

Location: %LOCALAPPDATA%\Temp\DiagOutputDir\RdClientAutoTrace\

Files accumulate every cycle (naming pattern):

RdClientAutoTrace-WppAutoTrace-20260822-092046-122.etl
RdClientAutoTrace-WppAutoTrace-20260822-092146-144.etl
RdClientAutoTrace-WppAutoTrace-20260822-092246-378.etl
...
MSRDCEventProcessor_0.etl
MSRDCEventProcessor_1.etl
MSRDCEventProcessor_2.etl

Available on request.

7. Registered WSL distributions (HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss)

  • Ubuntu-22.04 (BasePath: C:\wsl2, Flags: 15, Version: 2)
  • docker-desktop (BasePath: \?\D:\ProgramData\Docker\data\main, Flags: 15, Version: 2)

8. Process parent chain (captured live per cycle)

msrdc(6976) PARENT PID = 30404 (wslhost, started 17:27:41.853)
anc PID=30404 Name=wslhost GP=6440 (wslservice)
msrdc(12748) PARENT PID = 29324 (wslhost, started 17:28:41.605)
anc PID=29324 Name=wslhost GP=6440
msrdc(27816) PARENT PID = 20024 (wslhost, started 17:29:41.619)
anc PID=20024 Name=wslhost GP=6440
msrdc(29240) PARENT PID = 30156 (wslhost, started 17:30:41.628)
anc PID=30156 Name=wslhost GP=6440

Activity

  1. github-actions commented on Aug 22, 2026

    @github-actions
    Contributor

    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-wsl-logs.ps1 -LogProfile networking instead, 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 wsl-gh-logs@microsoft.com 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'.

  2. vstralcn commented on Aug 22, 2026

    @vstralcn
    Author
  3. github-actions commented on Aug 22, 2026

    @github-actions
    Contributor
    Diagnostic information
    .wslconfig found
    Appx package is not installed
    
  4. chemwolf6922 commented on Aug 24, 2026

    @chemwolf6922
    Contributor

    Hi vstral (@vstralcn) .
    The issue has two parts.

    1. Something is accessing the wsl p9 share every minute. Which causes the wsl VM to start up and later idle shutdown every minute.
    2. wslg on the VM startup is showing a window when it's not supposed to.

    To help diagnose the first part. Please consider follow these steps to track down who is doing that:

    1. Install process monitor from https://learn.microsoft.com/en-us/sysinternals/downloads/procmon.
    2. Open procmon. Add a filter Path contains wsl.localhost
    3. Start the capture and see what process is accessing the share every minute.
  5. vstralcn commented on Aug 24, 2026

    @vstralcn
    Author

    What the problem was

    The window titled "远程桌面" (Remote Desktop) that popped up every 60 seconds was not the Remote Desktop application — it was WSLg's RDP client (C:\Program Files\WSL\msrdc.exe, MSRDC 1.2.6353), the component WSL uses to render Linux GUI apps onto the Windows desktop.

    Call chain (captured live per cycle)

    wslservice.exe (WSL service)
    └── wslhost.exe (spawned at :41 every minute)
    └── msrdc.exe (spawned at :46) → connects to local WSLg over Hyper-V socket
    → session drops after ~25 s (disconnect reason 2308, SL::OnDisconnected error 0x904)
    → WSL service retries every 60 s, indefinitely
    Each retry created a foreground window titled "远程桌面" that stole focus from the active application. The cycle ran continuously for 8+ hours with zero user interaction, starting well before any user activity.

    No scheduled task, startup entry, or third-party process was involved. The Store "Microsoft Remote Desktop" package was not even installed.

    The fix

    Disabling WSLg entirely in .wslconfig:
    [wsl2]
    autoProxy = true
    networkingMode = mirrored
    guiApplications = false
    then wsl --shutdown. This completely stopped the issue — msrdc.exe is no longer spawned, the window no longer appears, and focus stealing is gone. WSL command-line usage and Docker's WSL backend remain unaffected; only GUI rendering (WSLg) is disabled, which the user does not need.

    Suggestion

    When the WSLg session cannot be maintained, the WSL service should not retry indefinitely with a visible focus-stealing window — suppress the window in RemoteApp/headless mode and/or use exponential backoff.
    Please investigate why the WSLg session disconnects ~25 s after a successful connect (reason 2308 / error 0x904) on Windows 11 24H2 (26100.4061) with WSL 2.6.2.0 / MSRDC 1.2.6353.

    Thank you!

  6. chemwolf6922 commented on Aug 24, 2026

    @chemwolf6922
    Contributor

    Hi vstral (@vstralcn) .
    Disable wslg is likely only hiding the second part of the issue. There is still something periodically waking up wsl by accessing the \wsl.localhost shares. This will periodically bring up the wsl VM which will impact your PC's performance. Thus, I still suggest try capture which process is doing that with process monitor.

  7. microsoft-github-policy-service commented on Aug 31, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions