mstsc keeps launching and steals desktop focus
Windows build number:
10.0.22621.819
Your Distribution version:
20.04
Your WSL versions:
Invalid command line option: --version Copyright (c) Microsoft Corporation. All rights reserved.
Usage: wsl.exe [Argument] [Options...] [CommandLine]
Steps to reproduce:
Haven't got stable repro steps.
WSL logs:
No response
WSL dumps:
No response
Expected behavior:
No response
Actual behavior:
wslhost.exe keeps launching and exit with below command line. And the mstsc steals desktop focus which make it very hard to even input a letter into the focused app like browser. Issue goes away once I run wsl --shutdown.
mstsc.exe /v:89C39F7F-2DF1-41A7-AA4B-6ADE1C89B0A6 /hvsocketserviceid:1661F716-FACB-11E6-BD58-64006A7986D3 /silent /wslg /plugin:WSLDVC /wslgsharedmemorypath:WSL\89C39F7F-2DF1-41A7-AA4B-6ADE1C89B0A6\wslg C:\ProgramData\Microsoft\WSL\wslg.rdp
Having the same issue - seeing other issues on here as well.
Did you ever figure anything out?
"wsl --shutdown" makes it stop for me - but that puts Docker Desktop into a bad state on my machine, so it's not an idea workaround...
Based on some other reports, I'm wondering if I'm encountering it due to running VSCode from within WSL - as it seems there's a relation between launching WSL GUI apps and this issue occurring for some. This somewhat makes sense to me, as I've used WSL for years but only recently began experiencing this problem - and I only recently switched to working "inside of WSL" with regards to launching VSCode.
Very serious problem.. can this get some attention?
Also just discovered this.
I came across the same issue.
This had been affecting me for several years and still isn't fixed in latest WSL. Much more detail here: https://youtrack.jetbrains.com/issue/IDEA-282196/Constant-loss-of-editor-focus-when-using-Windows-11-and-WSL
Is this being worked on? Every time I remove guiApplications=false from my .wslconfig, my focus keeps being stolen. Very annoying.
This might be unrelated, but I had a similar issue with mstsc --- I think I isolated this for myself to explorer's side tree "Linux" folder --- when this opens, it launches every WSL VM. ... the more you have the more it times it loses focus as it opens each one at a time it seems.. Hoping this helps someone else out there. Ensuring the tree is closed makes it not try to start all the VMs.
Still happening. For me it just starts after a while and then keeps increasing to the point of loosing focus multiple times per second, which basically only gives me the option to restart the PC. I checked the process that started this and it was Microsoft Windows Subsystem Service Host
Came to report I'm affected by it. I found that I lose focus to mstsc.exe which is launched by wsl.
Linux always gets such problems where you spend a few days to make peanuts work