Skip to content

Cursor and windows blinking when WSL is running #9752

Closed

Description

Windows Version

Microsoft Windows [Version 10.0.19045.2604]

WSL Version

1.1.3.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1-microsoft-standard-WSL2

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

Start WSL V2

Expected Behavior

Wsl started, mouse cursor normal

Actual Behavior

When I start WSL V2 (not V1), the mouse cursor starts blinking between Loading/Normal states. Some other windows also blink but not all. See the example in the video where task manager and context menu blink:

2023-03-07.15-24-22.mp4

It used to work, I do not know what what the change that caused that behaviour.
I tried to completely reinstall WSL (the Linux distribs but also WSL itself), but still have the issue.

I understand that this si quite difficult to reproduce.

Diagnostic Logs

WslLogs-2023-03-08_09-14-06.zip

Activity

  1. sebbelese commented on Mar 8, 2023

    @sebbelese
    Author

    I tried to remove several apps including Nvidia drivers, rancher-desktop, even Office, also tried to clean all possible config files, but the problem still occurred.

    My fix for now is to use wsl kernel 5.10.16 which works well.

  2. hideyukn88 commented on Mar 9, 2023

    @hideyukn88
    Contributor

    @pmartincic, if you are seeing same issue, would you please share log files from /mnt/wslg, and check if there is any core dump is generated at /mnt/wslg/dumps, thanks!

  3. microsoft-github-policy-service commented on Mar 9, 2023

    @microsoft-github-policy-service
    Contributor

    Hello! Could you please provide logs and process dumps to help us better diagnose your issue?

    To collect WSL logs and dumps, 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 -Dump
    

    The scipt will output the path of the log file once done.

    Once completed please upload the output files to this Github issue.

    Click here for more info on logging

    Thank you!

  4. sebbelese commented on Mar 9, 2023

    @sebbelese
    Author

    Hello! Could you please provide logs and process dumps to help us better diagnose your issue?

    To collect WSL logs and dumps, 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 -Dump
    

    The scipt will output the path of the log file once done.

    Once completed please upload the output files to this Github issue.

    Click here for more info on logging

    Thank you!

    Not sure if they are uploaded at the right place, but these logs are available in my initial comments (I added these afterwards, which may be why the bot signaled it as missing).

  5. hideyukn88 commented on Mar 9, 2023

    @hideyukn88
    Contributor

    Sébastien Blaise (@sebbelese), I wonder if this is caused by WSLg, thus I would like to get logs from /mnt/wslg, thanks!

  6. sebbelese commented on Mar 20, 2023

    @sebbelese
    Author

    Sébastien Blaise (@sebbelese), I wonder if this is caused by WSLg, thus I would like to get logs from /mnt/wslg, thanks!

    Sorry for late reply, I was unavailable with no time to break my current setup.

    Attached are the .log files located in /mnt/wslg. Is there any other file you need?
    stderr.log
    weston.log
    wlog.log
    pulseaudio.log

  7. hideyukn88 commented on Mar 21, 2023

    @hideyukn88
    Contributor

    Sébastien Blaise (@sebbelese), thanks for providing logs, and yes, this is indeed caused by WSLg. WSLg launches msrdc.exe in background, and it is failing, thus it's repeatedly launched, and that ends up as cursor blinking. There is couple of known issues.

    1: group policy prevents msrdc.exe from establishing connection with WSLg. If you can share output from reg QUERY "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /S, it can be identified.

    2: Citrix software is installed, then you will need to apply workaround described either https://support.citrix.com/article/CTX107825/how-to-disable-citrix-api-hooks-on-a-perapplication-basis, or https://support.citrix.com/article/CTX463527/ms-quick-assist-crashes-when-used-in-citrix-session.

    3: Something else, then please share a few ETL files at %LOCALAPPDATA%\Temp\DiagOutputDir\RdClientAutoTrace.

    Finally as workaround, if you are not using Linux GUI application, you can disable it by .wslconfig, please refer https://learn.microsoft.com/en-us/windows/wsl/wsl-config, thanks!

  8. sebbelese commented on Mar 21, 2023

    @sebbelese
    Author

    Thanks for your time and answer. Citrix is not installed. Group policy is plausible, since it is a company-owned computer.
    Output of _reg QUERY "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /S :

    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
        fAllowToGetHelp    REG_DWORD    0x1
        fAllowFullControl    REG_DWORD    0x1
        MaxTicketExpiry    REG_DWORD    0x1
        MaxTicketExpiryUnits    REG_DWORD    0x1
        fUseMailto    REG_DWORD    0x1
        fAllowUnsolicited    REG_DWORD    0x1
        fAllowUnsolicitedFullControl    REG_DWORD    0x1
        fDenyTSConnections    REG_DWORD    0x0
    
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client
        fEnableUsbBlockDeviceBySetupClass    REG_DWORD    0x1
        fEnableUsbNoAckIsochWriteToDevice    REG_DWORD    0x50
        fEnableUsbSelectDeviceByInterface    REG_DWORD    0x1
    
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client\UsbBlockDeviceBySetupClasses
        1000    REG_SZ    {3376f4ce-ff8d-40a2-a80f-bb4359d1415c}
    
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client\UsbSelectDeviceByInterfaces
        1000    REG_SZ    {6bdd1fc6-810f-11d0-bec7-08002be2092f}
    
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\RAUnsolicit
        FNL-Delegation - Remote 
    ```assistance    REG_SZ    FNL-Delegation - Remote assistance
    
  9. hideyukn88 commented on Mar 21, 2023

    @hideyukn88
    Contributor

    Sébastien Blaise (@sebbelese), thanks for info, but it looks none of those policies interfere with WSLg, would you please share a few ETL files from %LOCALAPPDATA%\Temp\DiagOutputDir\RdClientAutoTrace, thanks!

  10. sebbelese commented on Mar 22, 2023

    @sebbelese
    Author

    Here are some
    RdClientAutoTrace.zip

  11. hideyukn88 commented on Mar 22, 2023

    @hideyukn88
    Contributor

    Sébastien Blaise (@sebbelese), thanks for sharing the log, just to sanity check, would you please shutdown WSL by wsl --shutdown, and restart, then do you still see below message at /mnt/wslg/weston.log? thanks!

    WARNING
    WARNING
    WARNING: multiple monitor is not supported in non HiDef RAIL mode
    WARNING
    WARNING
    
  12. hideyukn88 commented on Mar 22, 2023

    @hideyukn88
    Contributor

    Sébastien Blaise (@sebbelese), also please share output from reg QUERY "HKCU\Software\Microsoft\Terminal Server Client" and reg QUERY "HKLM\Software\Microsoft\Terminal Server Client", my current suspicion is that your corporate policy disables some remote desktop features, thanks!

  13. sebbelese commented on Mar 23, 2023

    @sebbelese
    Author

    Hi Hideyuki Nagase (@hideyukn88) ,

    Thanks for continuing to investigate.

    Yes, I see the warning:

    [12:27:04.798] disp_monitor_sanity_check_layout:---INPUT---
    [12:27:04.798]  rdpMonitor[0]: x:0, y:0, width:2560, height:1440, is_primary:1
    [12:27:04.798]  rdpMonitor[0]: physicalWidth:0, physicalHeight:0, orientation:0
    [12:27:04.798]  rdpMonitor[0]: desktopScaleFactor:0, deviceScaleFactor:0
    [12:27:04.798]  rdpMonitor[0]: scale:1, client scale :1.00
    [12:27:04.798] HiDef-RAIL is required for RAIL.
    [12:27:04.798] unable to checkDescriptor for 0x55d9c9f577e0
    [12:27:05.154] xf_peer_adjust_monitor_layout:
    [12:27:05.154]   DesktopWidth:2560, DesktopHeight:1440
    [12:27:05.154]   UseMultimon:0
    [12:27:05.154]   ForceMultimon:0
    [12:27:05.154]   MonitorCount:3
    [12:27:05.154]   HasMonitorAttributes:1
    [12:27:05.154]   HiDefRemoteApp:0
    [12:27:05.154]
    WARNING
    WARNING
    WARNING: multiple monitor is not supported in non HiDef RAIL mode
    WARNING
    WARNING
    [12:27:05.154] disp_monitor_sanity_check_layout:---INPUT---
    [12:27:05.154]  rdpMonitor[0]: x:0, y:0, width:2560, height:1440, is_primary:1
    [12:27:05.154]  rdpMonitor[0]: physicalWidth:0, physicalHeight:0, orientation:0
    [12:27:05.154]  rdpMonitor[0]: desktopScaleFactor:0, deviceScaleFactor:0
    [12:27:05.154]  rdpMonitor[0]: scale:1, client scale :1.00
    [12:27:05.154] HiDef-RAIL is required for RAIL.
    [12:27:05.154] unable to checkDescriptor for 0x55d9c9f577e0
    

    Output of reg QUERY "HKCU\Software\Microsoft\Terminal Server Client"

    HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
        EnableAdvancedRemoteFXRemoteAppSupport    REG_DWORD    0x0
    
    HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default
    HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\hwtest
    HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\LocalDevices
    HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers
    

    Output of reg QUERY "HKLM\Software\Microsoft\Terminal Server Client"

    HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client\Default
    HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client\IME Mapping Table
    HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client\TrustedGateways
    
  14. hideyukn88 commented on Mar 23, 2023

    @hideyukn88
    Contributor

    Sébastien Blaise (@sebbelese), below registry key setting is disabling the feature WSL/WSLg depneds on, if this key is removed or set the value to 1, then msrdc.exe will properly start up and no more cursor blinking. I guess this is set by your corporate policy? thanks!

    HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
    EnableAdvancedRemoteFXRemoteAppSupport REG_DWORD 0x0

  15. sebbelese commented on Mar 23, 2023

    @sebbelese
    Author

    Changing this setting to 1 fixes the issue, and allows to run Linux GUI apps. I will check with my company IT why it was disabled.

    Maybe some clear warning or error should be useful in this case. I am not sure if I should close the issue, I leave it into your hands.

    Thanks for taking the time to look into this problem!

  16. metix commented on Apr 14, 2023

    @metix

    I just wanted to share that I also experienced the same problem, but in my case it was caused by Citrix.

    I followed the workaround provided by Hideyuki Nagase (@hideyukn88) in this article (https://support.citrix.com/article/CTX107825/how-to-disable-citrix-api-hooks-on-a-perapplication-basis), and I excluded msrdc.exe.

    Since then, the blinking has stopped. Thanks guys!

  17. tobiaswaggoner commented on Jul 14, 2023

    @tobiaswaggoner

    I just wanted to share that I also experienced the same problem, but in my case it was caused by Citrix.

    I followed the workaround provided by Hideyuki Nagase (@hideyukn88) in this article (https://support.citrix.com/article/CTX107825/how-to-disable-citrix-api-hooks-on-a-perapplication-basis), and I excluded msrdc.exe.

    Since then, the blinking has stopped. Thanks guys!

    Ah, finally, thank you. -- to add a bit of convenience here the .reg file for the two switches:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\CtxHook]
    "ExcludedImageNames"="msrdc.exe"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Citrix\CtxHook]
    "ExcludedImageNames"="msrdc.exe"
    
  18. jku-sr commented on Jul 28, 2023

    @jku-sr

    same problem, this reg key seemed to have resolved it. For me it happens every time I open up my WSL terminal in a citrix environment on win 10 22h2

  19. alex-muci commented on Aug 25, 2023

    @alex-muci

    Same. Citrix was the issue for me. Setting the two ExcludedImageNames keys as per above solved the flickering.
    Thx!

  20. jle35 commented on May 7, 2024

    @jle35

    Same problem, but I have no Citrix nor EnableAdvancedRemoteFXRemoteAppSupport.

    I have these logs in /mnt/wslg/weston.log which correspond to the blinks:

    ...
    [16:06:57.945] Client: ClientGetAppidReq: WindowId:0x8c is not found.
    [16:07:04.425] Client: ClientGetAppidReq: WindowId:0x8e is not found.
    [16:07:07.739] Client: ClientGetAppidReq: WindowId:0x8f is not found.
    [16:07:11.056] Client: ClientGetAppidReq: WindowId:0x90 is not found.
    ...
    
  21. microsoft-github-policy-service commented on May 8, 2025

    @microsoft-github-policy-service
    Contributor

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

    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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions