Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor and windows blinking when WSL is running #9752

Open
1 of 2 tasks
sebbelese opened this issue Mar 7, 2023 · 22 comments
Open
1 of 2 tasks

Cursor and windows blinking when WSL is running #9752

sebbelese opened this issue Mar 7, 2023 · 22 comments

Comments

@sebbelese
Copy link

sebbelese commented Mar 7, 2023

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

@sebbelese
Copy link
Author

sebbelese commented Mar 8, 2023

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.

@ghost
Copy link

ghost commented Mar 9, 2023

@hideyukn88, Do you have any advice?

@hideyukn88
Copy link
Member

@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!

@microsoft-github-policy-service
Copy link
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!

@ghost
Copy link

ghost commented Mar 9, 2023

@hideyukn88, I'm not seeing the same problem. I just wasn't sure where to start with the investigation on this bug. Figured you might have a better idea than I.

@sebbelese
Copy link
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).

@hideyukn88
Copy link
Member

@sebbelese, I wonder if this is caused by WSLg, thus I would like to get logs from /mnt/wslg, thanks!

@sebbelese
Copy link
Author

sebbelese commented Mar 20, 2023

@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

@hideyukn88
Copy link
Member

@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!

@sebbelese
Copy link
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

@hideyukn88
Copy link
Member

@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!

@sebbelese
Copy link
Author

Here are some
RdClientAutoTrace.zip

@hideyukn88
Copy link
Member

@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

@hideyukn88
Copy link
Member

@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!

@sebbelese
Copy link
Author

sebbelese commented Mar 23, 2023

Hi @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

@hideyukn88
Copy link
Member

@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

@sebbelese
Copy link
Author

sebbelese commented Mar 23, 2023

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!

@metix
Copy link

metix commented Apr 14, 2023

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 @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!

@tobiaswaggoner
Copy link

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 @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"

@jku-sr
Copy link

jku-sr commented Jul 28, 2023

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

@alex-muci
Copy link

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

@jle35
Copy link

jle35 commented May 7, 2024

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.
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants