wslg icon indicating copy to clipboard operation
wslg copied to clipboard

msrdc continously restarting

Open Kilill opened this issue 3 years ago • 66 comments

Windows build number:

10.0.19045.2311

Your Distribution version:

20.04

Your WSL versions:

WSL version: 1.0.0.0 Kernel version: 5.15.74.2 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19045.2311

Steps to reproduce:

  1. Upgraded windows to latest release
  2. wsl --update
  3. wsl

WSL logs:

stderr.log versions.txt weston.log wlog.log pulseaudio.log

WSL dumps:

No response

Expected behavior:

wsl should start and graphical linux progams should run

Actual behavior:

wsl start and shows command prompt and works as expected for a linux distro in text/terminal mode. but windows system is lagging, and almost all windows constantly repaiting. And ofc no graphicl linux progs works.

checking stderr.log i see this:

[10:51:31.376] <5>WSLGd: Run:104: pid 15 exited with status 9, /mnt/c/Users/kill/AppData/Local/Microsoft/WindowsApps/MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe/msrdc.exe /v:82ACAEE4-02E2-4CE9-9812-B0592ABC85B8 /hvsocketserviceid:15489104-FACB-11E6-BD58-64006A7986D3 /silent /wslg /plugin:WSLDVC_PACKAGE /wslgsharedmemorypath:WSL\82ACAEE4-02E2-4CE9-9812-B0592ABC85B8\wslg C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.0.0_x64__8wekyb3d8bbwe\wslg.rdp 
Error: debug scope named 'rdp-audio' is already registered.
Error: debug scope named 'rdp-audio-in' is already registered.

Kilill avatar Nov 23 '22 12:11 Kilill

Exactly the same issue since latest update around 10 days ago (wsl + wslg if I remember correctly).

Ton of errors in the Event Viewer, active window lost the focus every 10/15 sec and no more GPU detected inside distribution (Debian 11 and Ubuntu 22) - impossible to use and work with the PC.

Screenshot 2022-11-29 105458 Screenshot 2022-11-29 105440

After trying to downgrade/reinstall wsl/wslg/video drivers/distribution, the only way to get something working a bit is to disable GUI application support using the parameter guiApplications=false in .wslconfig.

We really need a quick fix, my whole team is unable to work in proper condition as we need GPU support inside our containers.

olivier-med avatar Nov 29 '22 10:11 olivier-med

@Kilill, @olivier-med, thanks for reporting the issue. Would you please create below file under your Windows's user profile folder and see if it's fixed? it's .wslgconfig, not .wslconfig.

c:\Users\[Your Windows Username]\.wslgconfig

[system-distro-env]
WSLG_USE_MSTSC=true

Thanks!

hideyukn88 avatar Dec 02 '22 19:12 hideyukn88

Doing that (and ofc removing the guiApplication=false line from wslconfig only results in the Remote Desktop Connection Usage page beeing popped on the screen with usage instructions, pressing the OK button will imidiatly pop it again. WSL does start and gives the normal text prompt. And ofc trying to start any graphical X program just hangs and must be terminated with ctrl-C. Only way to remove the usage page is to shutdown wsl first (`wsl --shutdown')

To me it seems that MSTC is given an incorrect parameter ?

Kilill avatar Dec 03 '22 11:12 Kilill

Hello, did that this morning and same behaviors (without guiApp). As soon as a distribution is started following the wsl --shutdown, ton of errors in the EventViewer and the active window lost focus every few seconds.

olivier-med avatar Dec 05 '22 10:12 olivier-med

@Kilill, @olivier-med, thanks so much for trying out, at this point I need the msrdc/mstsc data from Windows side, please report problem using Feedback Hub and please...

1: put link to this Github page at description.

2: select below category.

image

3: record the problem by selecting "recreate my problem" and "start recording", you can restart WSL at this point.

image

Thank you very much for helping us.

hideyukn88 avatar Dec 05 '22 17:12 hideyukn88

Would love to, but there are no options as indicated for "atach" anything, much less a "recreate my problem" in the "Feedback Hub" app

Kilill avatar Dec 05 '22 19:12 Kilill

@Kilill, once you start recording, it will automatically collect the data we need for diagnosis, and it will attach the data to the report once you finish recording, thanks!

hideyukn88 avatar Dec 05 '22 19:12 hideyukn88

What in trying to say is that the Feedback ap does not have a recreate my problem button at all, so it is not possible to create a recording, attaching screenshots from the "Feedback Hub" session, nowhere do i get the options indicated above to "Start Recording" and ofc "Submit" justs submits the and returns fb1 fb2 fb3 fb4 fb5

Kilill avatar Dec 05 '22 20:12 Kilill

It's because you have optional diagnostic data disabled Screenshot_20221205-141349.jpg

Masamune3210 avatar Dec 05 '22 20:12 Masamune3210

Well. That's to bad, to enable that it seems the hole "telemetry phone home to MS" has to be enabled, which is not going to happen.

Kilill avatar Dec 06 '22 15:12 Kilill

Sorry won't be possible for me also, these rules are enforced by our company's policies.

olivier-med avatar Dec 06 '22 15:12 olivier-med

@Kilill, @olivier-med, I understand that, so I come up with alternative way to collect the error log we need.

1: add .wslgconfig as described at https://github.com/microsoft/wslg/issues/901#issuecomment-1335757205. 2: save this mstsc.txt to local disk, and rename to mstsc.wprp. 3: start command prompt (cmd.exe) with admin privilege. 4: at same folder where mstsc.wprp is saved, run wpr -start mstsc.wprp!MSTSC.Verbose -filemode. 5: run wsl --shutdown to ensure WSL is terminated. 6: then restart WSL, and make sure msrdc.exe is contiguously restarting. 7: from same command prompt as step 4, run wpr -stop mstsc.etl. 8: then mstsc.etl should be created at same folder, and please share this file with us.

Thanks!

hideyukn88 avatar Dec 08 '22 01:12 hideyukn88

Hello, Thanks for the procedure, and here is the etl file (after about 1 minute and a lot of crash in the event viewer). mstsc.etl.zip

olivier-med avatar Dec 08 '22 07:12 olivier-med

@olivier-med, thanks for sharing log, up to this point, I have assumed you and @Kilill could be seeing same issue, thus I used the weston.log from him as reference, but now I can't be sure, do you see which message, below a) or b) or none of them at your /mnt/wslg/weston.log? The numbers portion can be different but please look for bold text.

a) [10:51:44.860] unable to checkDescriptor for 0x55f753fd49a0

or

b) [17:04:49.490] CreateWndow(): rdp_peer is not initalized

@Kilill, would you please help us to share the log, it would be very appreciated.

Thanks!

hideyukn88 avatar Dec 08 '22 18:12 hideyukn88

Tried that but as before having WSLG_USE_MSTSC=true in .wslgconfig pops the a usage page dialog for mstsc. Leads me to believe that there's an incorrect parameter/option in the call .

WSL does start in text only mode though

Not sure if it helps you any but ran the same procedure with removed WSLG_USE_MSTSC=true both files are in the zip, mstsc_1.etl is with WSLG_USE_MSTSC=true mstsc_2.etl is without mstsc.zip

Kilill avatar Dec 09 '22 15:12 Kilill

with WSLG_USE_MSTSC=true i get the CreateWndow(): rdp_peer is not initalized in weston.log which i guess is understandable since mstsc pops its usage page.

if it helps: i asume that the command string used is the one from stderr.log: /mnt/c/Windows/System32/mstsc.exe /v:77F0E562-DACC-434C-BC3E-D7EF37B02B1B /hvsocketserviceid:729EC02A-FACB-11E6-BD58-64006A7986D3 /silent /wslg /plugin:WSLDVC_PACKAGE /wslgsharedmemorypath:WSL\77F0E562-DACC-434C-BC3E-D7EF37B02B1B\wslg C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.0.0_x64__8wekyb3d8bbwe\wslg.rdp

running that from the wsl command line ofc pops the usage dialog. i fiddled around with that for a bit removing options and it seems my mstsc doesnt like any option stating with wslg ie /wslg and /wslgsharedmemorypath stops it from poping the usage page but instead complains about the rdp file missing...

btw seems a new version of wsl is available il update and see if it helps any

(5 min laters) nope no change

Kilill avatar Dec 09 '22 15:12 Kilill

@hideyukn88 - "CreateWndow(): rdp_peer is not initalized" is the message I have.

If it can help, here are logs from /mnt/wslg/ folder stderr.log weston.log wlog.log pulseaudio.log

olivier-med avatar Dec 09 '22 16:12 olivier-med

@Kilill, ah I see, you are on Windows 10, not 11, and you are right that mstsc.exe included in Windows 10 doesn't support those parameters and can't be used .wslgconfig, so please remove it. Instead, would you please add below registry key before running wpr.exe at above 4).

3.5: run reg add "HKCU\Software\Microsoft\Terminal Server Client\Default" /v EnableMSRDCAutoTracing /t REG_DWORD /d 1 /f on admin privileged cmd.exe.

and you can remove this registry key after step 7.

7.5: run reg delete "HKCU\Software\Microsoft\Terminal Server Client\Default" /v EnableMSRDCAutoTracing /f

then share the mstsc.etl with us. Very appreciated for your help!

hideyukn88 avatar Dec 09 '22 18:12 hideyukn88

Here you go:

mstsc.zip

Kilill avatar Dec 09 '22 18:12 Kilill

@olivier-med, thanks for sharing the log, and it shows it indeed your case and @Kilill's case is different.

In your case, the RDP connection to WSLg is not established at all, while @Kilill's case shows RDP connection is established but disconnected soon after.

Is your computer managed by your corporation by group policy? if so, would you please share output from reg QUERY "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /S on Windows's command prompt? Or do you install 3rd party software for RDP/Terminal Services? such as www.terminalworks.com? Or any 3rd party networking monitoring/firewall software? thanks!

hideyukn88 avatar Dec 09 '22 18:12 hideyukn88

Hello,

here is the command result:

D:\
λ reg QUERY "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /S

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
    DisablePasswordSaving    REG_DWORD    0x1
    fDisableCcm    REG_DWORD    0x1
    fDisableCpm    REG_DWORD    0x1
    fForceClientLptDef    REG_DWORD    0x0
    fSingleSessionPerUser    REG_DWORD    0x1
    fDisableCam    REG_DWORD    0x1
    fDisableAudioCapture    REG_DWORD    0x1
    fEnableSmartCard    REG_DWORD    0x0
    fDisableLPT    REG_DWORD    0x1
    fDisablePNPRedir    REG_DWORD    0x1

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}

I discussed a bit with IT, and as far as I know, there was no modifications in group policies, nor changes in software (anti virus or fw) for a long time.

olivier-med avatar Dec 12 '22 07:12 olivier-med

Same boat as OP. We use Citrix and yeah unless you disable WSLg the msrdc bit just crashes every couple seconds until all WSL processes are shutdown. Nothing jumping out in TS policy, but there are hooks in play that can cause issues I am sure.

And same boat on the MSTSC flag as it just does the usage help popup so no help there.

byjrack avatar Dec 13 '22 13:12 byjrack

@byjrack, do you have a chance to try out without Citrix is installed? Does WSLg work fine? When msrdc.exe is running for WSLg connection, it indeed disables all 3rd party plugins to avoid any possible conflicts (as previously there is issues observed with 3rd party plugins, such as TSPrint). Would you please check which message is logged in weston.log at https://github.com/microsoft/wslg/issues/901#issuecomment-1343151633? thanks!

hideyukn88 avatar Dec 13 '22 17:12 hideyukn88

Can't pull Citrix since that is what is brokering the desktop session and I need to figure out how to make WSL and Citrix coexist. For now it's disable WSLg, but that's a bit complicated to do from the center and ideally I would like to make WSL work out of box even if folks don't use WSLg as a feature.

weston

[12:29:55.587] app list entry updated: Key:ubuntu-desktop-installer_ubuntu-desktop-installer, Name:Install RELEASE (Ubuntu)
[12:29:55.783] CreateWndow(): rdp_peer is not initalized
[12:29:56.063] Spawned Xwayland server, pid 27
[12:29:56.563] xfixes version: 5.0
[12:29:56.596] created wm, root 912
[12:29:57.589] retry_find_icon_file: icon (ubiquity) retry count (1)
[12:29:57.589] find_icon_file: icon (ubiquity) search retry:(2) global:(1)
[12:29:59.591] retry_find_icon_file: icon (ubiquity) retry count (2)
[12:29:59.592] find_icon_file: icon (ubiquity) search retry:(3) global:(1)

stderr is basically this forever

[12:29:57.561] <5>WSLGd: Run:104: pid 17 exited with status 126, /mnt/c/Users/User/AppData/Local/Microsoft/WindowsApps/MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe/msrdc.exe /v:11D7C9D0-E168-422E-BD23-BE31C8C10C95 /hvsocketserviceid:41AD4E99-FACB-11E6-BD58-64006A7986D3 /silent /wslg /plugin:WSLDVC_PACKAGE /wslgsharedmemorypath:WSL\11D7C9D0-E168-422E-BD23-BE31C8C10C95\wslg C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.0.0_x64__8wekyb3d8bbwe\wslg.rdp 

byjrack avatar Dec 13 '22 17:12 byjrack

@hideyukn88 we also have on our desktop having the issues Citrix installed and it cannot be uninstalled as without it we are unable to do remote work :) But we don't have updates on Citrix since few months.

olivier-med avatar Dec 14 '22 08:12 olivier-med

@byjrack @olivier-med, what exact Citrix software do you have in your local computer? thanks!

hideyukn88 avatar Dec 14 '22 16:12 hideyukn88

image

olivier-med avatar Dec 14 '22 16:12 olivier-med

My case is Citrix Desktop VDA version 7.32.0.6

The policy tends to try to control sideways access via RDP because it can cause conflicts.

byjrack avatar Dec 14 '22 16:12 byjrack

@byjrack @olivier-med, thanks, we will internally reach out to Citrix to figure out further, thanks!

hideyukn88 avatar Dec 14 '22 16:12 hideyukn88

@Kilill, would you please share the RdClientAutoTrace file under %TEMP%\DiagOutputDir? Please see timestamps and pick one or two files close to when WSL is launched, thanks!

hideyukn88 avatar Dec 15 '22 23:12 hideyukn88