none
Black Screen on Windows Server 2016 RDS RRS feed

  • Question

  • Running Windows Server 2016 Remote Desktop Services (session-based desktops).

    Multiple session host servers, one DC, all running as VMs under Citrix XenServer 7.1. The servers are fully updated to present time as of 7 March 2019.

    Every few days a user reports that after logging in to an RDS session he does not see his desktop but sees a black screen. When this happens, I can see that some users on that same RDS server still have their session working normally, but every user logging in after this also gets this black screen.

    There are numerous references to this problem on the internet. It is apparently occuring since Server 2012 and has never been fixed.

    Some people recommend to restart the Windows Audio service. Does not help in my case, never does when it happens to me. Other recommendations were to remove Firefox browser from the RDS session host servers. I did that two months ago and it seemed to help for one week but then it came back. I have not found any other recommendation - there seems to be simply no solution, except restarting that RDS session host server, which is a major inconvenience, it throws out the other users which still work, it takes 10 minutes or more to restart that server, and it can only be done manually. Most often it has to be force-restarted on top of it, as the server is totally unresponsive, and then some users may loose their user profile. Then I have to delete that user and recreate his user profile. Major trouble.

    In the last few months I have rebuilt all RDS session host servers from scratch - total new installation, all updates, totally clean. It STILL happens. I have that system running since 2 years, and it has been a problem all the time.

    When I try to log in to the console of the offending RDSH I can sometimes not even log in . Sometimes it does let me log in but I also get a black screen as local admin user (both Server\Administrator and Domain\Administrator). In this case, I can bring  up TaskManager via Ctrl+Alt+End and run a command prompt. I can restart services this way and execute other commands, but anything relating to the UI does not show up. Screen stays black.

    Managed once to get the black screen off by restarting ShellExperienceHost service but then this logged out all users somehow and corrupted some profiles.

    The only applications installed on the RDSH servers are Chrome browser, Thunderbird email client, Libre-Office.

    From what I can find on the internet this problem occurs since the release of Windows Server 2012. This is seven years ago. I do not know if this happens to everyone, but there seems to be no common denominator from what I can find, it seems to happens on all sorts of environments, pointing to a bug within Windows Server itself.

    From what it seems it is related to the new UI system implemented with Windows 8 (and Server 2012) because I can find no reference to this occurring with Server 2008. I have not run RDS on Server 2008 myself so I have no first-hand experience.

    Is there ANYTHING I can do about this? It does NOT seem related to my setup which is really rock-bottom basic. Many users are reporting this as a dreaded issue they hope one day will be fixed by Microsoft.

    Can it be related to the virtualization software? Anything having experienced that issue on bare-bone installs of RDSH servers? Any difference with Hyper-V VMs?

    WHEN IS THIS GOING TO GET FIXED? THIS IS A PROBLEM SINCE 2012 - 7 YEARS!

    I feel forced to start researching for non-Microsoft solutions for RDS type solutions because I simply cannot tolerate non-functional software. To the users it looks like it is me as admin who is not doing his job!


    Atradius








    • Edited by Atradius Thursday, March 14, 2019 5:35 PM
    Thursday, March 14, 2019 9:50 AM

All replies

  • hi,
    1 do you have test rds environment in order to test some solution to solve your issue ?
    2 did you post your issue in Citrix forum? It seems caused by Citrix.
    https://discussions.citrix.com/topic/395017-server-2016-black-screen/

    Please Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

     

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Friday, March 15, 2019 10:03 AM
    Moderator
  • Thanks for the reply.

    I have a test environment - I would welcome any suggestion I can try.

    Regarding Citrix - we are not running any Citrix applications, no XenApp, no XenDesktop, nothing. We merely deploy all VMs on XenServer 7.1.

    The Citrix support forum thread  is interesting but the users involved find that they have this issue even when disabling all Citrix applications. They actually conclude in that thread that it is NOT Citrix-related but the problem appeared after a Windows update.

    It still could be related but you can find references to various environments where this occurs:

    https://community.spiceworks.com/topic/2198472-windows-server-2019-black-screen-esxi-6-5-vm

    https://community.spiceworks.com/topic/2018699-rds-windows-server-2016-desktop-freeze-black-screen?page=1

    I am not limited to look at solutions either way, whatever can solve it is welcome.


    Atradius



    • Edited by Atradius Friday, March 15, 2019 10:42 AM
    Friday, March 15, 2019 10:38 AM
  • hi,
    Because I have no citrix environment , so the solution only for your reference ,if you want to try to below method and please remember snapshot all your test system .

    1) Slow logon: The explorer cannot ready inside the 30s default logonui timeout windows. So logonui.exe exits after 30s timeout which leaves black screen.
     
    2) Citrix known issue: Citrix wrongly send WINDOWS_EVENT_SHELL_READY_WINLOGON event which causes logonui exits before explorer is ready.
    Resolution
    1. Set the following machine policy which will increase the default timeout for desktop switch to 10mins.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\
                  Name: DelayedDesktopSwitchTimeout
                  Type: DWORD
                  Value: 0n600                   --> 600s = 10mins
     
    2. Request Citrix private fix of the WINDOWS_EVENT_SHELL_READY_WINLOGON event issue.
    More Information

    1. Firstly, let’s confirm when explorer Signal desktop ready event by check.
    1:17:41.4459930 PM Explorer.EXE 7696 7700 Load Image C:\Windows\System32\wintrust.dll --> Draw Desktop
     
    1:18:20.9504791 PM Explorer.EXE 7696 2572 RegQueryValue HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DontLoadAuthUIInExplorer --> Signal desktop ready event
    8 Explorer.EXE CTray::_FireDesktopSwitchIfReady + 0xa5
    9 Explorer.EXE CTray::_StartSignalDesktopSwitch + 0xe
    10 Explorer.EXE CTray::_HandleStartupProgress + 0x24b
    11 Explorer.EXE CTray::v_WndProc + 0x945
    12 Explorer.EXE CImpWndProc::s_WndProc + 0xe2
    13 USER32.dll UserCallWinProcCheckWow + 0x274
    14 USER32.dll DispatchMessageWorker + 0x1ac
    15 picaUiTweakHook64.dll picaUiTweakHook64.dll + 0x386d
    16 Explorer.EXE CTray::_MessageLoop + 0x149
    17 Explorer.EXE CTray::MainThreadProc + 0x43
    18 SHCORE.dll _WrapperThreadProc + 0xed
    19 KERNEL32.DLL BaseThreadInitThunk + 0x14
    20 ntdll.dll RtlUserThreadStart + 0x21
    2. If we observe black screen before explore signal desktop ready event, it means someone else sent out the desktop ready event before desktop.
    3. Check the logonui.exe still exits after 35 seconds which causes the black screen. Logonui.exe was terminated by winlogon.exe through the following call stack which means the desktop ready event was fired.
    11         ntdll.dll RtlReportSilentProcessExit + 0x125
    12         KERNELBASE.dll TerminateProcess + 0x1e
    13         winlogon.exe     WluiiShutdownImpl + 0x15310
    14         winlogon.exe              WLGeneric_DelayedSwitchDesktop_Enter + 0x12b
    15         winlogon.exe     StateMachineRun + 0x704
    16         winlogon.exe     WinMain + 0xe7c
    17         winlogon.exe     __mainCRTStartup + 0x19f
    18         KERNEL32.DLL   BaseThreadInitThunk + 0x14
    19         ntdll.dll RtlUserThreadStart + 0x21


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Monday, March 18, 2019 3:25 PM
    Moderator
  • Thank you for the technical details and tips.

    1. I have changed the registry value to 10 minutes for DelayedDesktopSwitchTimeout as you suggest. As the issue only occurs every few days I have to wait and see if that resolves. (By the way, the value on my servers is "0" (zero) - does this make sense?)

    2. Citrix - that is REALLY interesting. On the other hand, I don't think our environment has this problem since we do not run any Citrix apps like XenDesktop or XenApp. From what I can find the issue you reference is primarily related to those, or is that not correct? I have seen reports on black-screen occuring in all sorts of hypervisor environments, even bare-metal installs.


    Atradius



    • Edited by Atradius Tuesday, March 26, 2019 6:28 PM
    Monday, March 25, 2019 1:47 PM
  • hi
    could you please add the a new registry key “DeleteUserAppContainersOnLogoff” like below then install this update patch KB4467684 for your server 2016 ?
    "Addresses an issue that slows server performance or causes the server to stop responding because of numerous Windows firewall rules. To enable the changes, add a new registry key “DeleteUserAppContainersOnLogoff” (DWORD) on “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy” using Regedit, and set it to 1."

    microsoft update catalog KB4467684
    https://www.catalog.update.microsoft.com/Search.aspx?q=KB4467684

    November 27, 2018—KB4467684 (OS Build 14393.2639)
    https://support.microsoft.com/en-us/help/4467684/windows-10-update-kb4467684

    Windows Servr 2016 RDSH - Firewall rules created at every login
    https://social.technet.microsoft.com/Forums/en-US/992e86c8-2bee-4951-9461-e3d7710288e9/windows-servr-2016-rdsh-firewall-rules-created-at-every-login?forum=winserverTS

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, April 2, 2019 2:45 AM
    Moderator
  • Hi Atradius, 

    I'm having exactly the same issues you're describing on our RDS environment.

    I've been following several threads online and tried all the suggestions made; Remove Firefox, restarting the Windows Audio Service, disabling the App Readiness service, ruled out AV by removing it completely, rebuilt the servers from scratch, and are not using any Citrix products or services either.

    Our OS's are fully patched Windows Server 2019 Version 1809 (OS Build 17763.503). The problem occurs to to all of our RDS session hosts.

    Servers without the sessionhost role do not suffer on this matter, which is interessting. I can rdp into any other server without this role installed and have no issues with the black screens.

    Then i found this thead which solved my issue!

    https://social.technet.microsoft.com/Forums/windowsserver/en-US/3fdfa58b-fe1b-4546-85d2-d43dac9bcc10/black-screen-on-all-new-connections-sessionhost-has-to-be-rebooted?forum=winserverTS

    Thursday, May 23, 2019 9:30 AM
  • Hi Atradius, 

    I'm having exactly the same issues you're describing on our RDS environment.

    I've been following several threads online and tried all the suggestions made; Remove Firefox, restarting the Windows Audio Service, disabling the App Readiness service, ruled out AV by removing it completely, rebuilt the servers from scratch, and are not using any Citrix products or services either.

    Our OS's are fully patched Windows Server 2019 Version 1809 (OS Build 17763.503). The problem occurs to to all of our RDS session hosts.

    Servers without the sessionhost role do not suffer on this matter, which is interessting. I can rdp into any other server without this role installed and have no issues with the black screens.

    Then i found this thead which solved my issue!

    https://social.technet.microsoft.com/Forums/windowsserver/en-US/3fdfa58b-fe1b-4546-85d2-d43dac9bcc10/black-screen-on-all-new-connections-sessionhost-has-to-be-rebooted?forum=winserverTS

    P.s. The issue is back.

    I thought removing the firewall rules did the trick, but we're experiencing the same issues again/still.
    The firewall rules are removed every hour by a powershell script/scheduled task.

    I'm running out of ideas here..

    Monday, May 27, 2019 7:08 AM
  • Hi,

    Are you using UPD(VHD) for users profiles ? If it's the case i have a solution


    • Edited by Anthony_8 Monday, May 27, 2019 8:58 PM
    Monday, May 27, 2019 8:57 PM
  • Hi Anthony_8,

    Yes, we are using UPD (user profile disks). 

    Which solution did you find?


    Atradius

    Tuesday, May 28, 2019 8:09 AM
  • This issue occur for me when at least 1 user have a full UPD.

    On the broker server, in the collection properties look at the max size you set for the UPD (if you don't know it), then go in the share where the UPD are stored and look if you have one at this size, if it's the case you must resize it using the powershell cmdlet from Hyper-V resize-vhd). Then reboot the RDS Session Host and it should work.

    If you need to change the max size for every new UPD, you just have to resize the VHD template in the UPD share.


    • Edited by Anthony_8 Tuesday, May 28, 2019 9:26 AM
    Tuesday, May 28, 2019 8:25 AM

  • Hi Atradius,


    I'm having exactly the same issues you're describing on our RDS environment,did you find some solution?


    Thank you.

    Thursday, October 3, 2019 6:51 PM
  • I did not have the issue since about 2 months.

    I cannot exactly pinpoint what solved it but having re-installed new session hosts multiple times, the below seems to be a workable mix:

    - Make sure Windows update is fully patched to present time, minimum July 2019 update
    - Stop and disable AppReadiness Service
    - Stop and disable Windows Search service
    - add the key DeleteUserAppContainersOnLogoff to registry as described in this post here above by Andy You (for this to work, you have to install the update KB4467684 - it might not be installed on your system)
    - add registry key DelayedDesktopSwitchTimeout as described above in this post

    And finally

    - remove Mozilla Firefox and Thunderbird, these apps seems to mess with the Audio service and can cause Windows to hang

    Hope this helps.


    Atradius

    Thursday, October 3, 2019 8:48 PM
  • Thank you for your reply, I will apply and see if it help us.

    I found some interest things looking on windows event viewer, every time when a user Log on the service AppReadiness check and install 14 items, normally this process take 15 seconds, but for some reason when the black screen as presented, 12 items are installed in 5 seconds and the next event is "Checking for service idle.(Result=false, Reason=ExternalObjects)" after this the last 2 items take almost 5 minutes to be installed.

    Items:

     

    PackageFamilyName Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy 
    PackageFamilyName windows.immersivecontrolpanel_cw5n1h2txyewy 
    PackageFamilyName Microsoft.Windows.Cortana_cw5n1h2txyewy 
    PackageFamilyName Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy 
    PackageFamilyName Microsoft.AccountsControl_cw5n1h2txyewy 
    PackageFamilyName Microsoft.BioEnrollment_cw5n1h2txyewy 
    PackageFamilyName Microsoft.LockApp_cw5n1h2txyewy 
    PackageFamilyName Microsoft.Windows.AppRep.ChxApp_cw5n1h2txyewy 
    PackageFamilyName Microsoft.Windows.AssignedAccessLockApp_cw5n1h2txyewy 
    PackageFamilyName Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy 
    PackageFamilyName Microsoft.XboxGameCallableUI_cw5n1h2txyewy 
    PackageFamilyName Windows.MiracastView_cw5n1h2txyewy 

    Last 2 items:

    PackageFamilyName Windows.PrintDialog_cw5n1h2txyewy 
    PackageFamilyName Microsoft.Windows.SecondaryTileExperience_cw5n1h2txyewy

                         



    Friday, October 4, 2019 3:35 PM
  • Hello,

    Solved in our organisation with these steps : 

    • Stop Appreadiness service if running.
    • Open Regedit
    • GoTo HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Config\
    • Find Microsoft.Windows.ShellExperienceHost_************ and rename it with .old at the end.
    • Try to logon with a user. It should works without blackscreen.

    Second solution ; Kill AppX Deployment Service (AppXSVC)

    Let me know if it solved the problem. The only problem will be for a new user, the desktop won't works correctly.

    B.R


    • Edited by Storn Tuesday, November 5, 2019 3:01 PM
    Tuesday, November 5, 2019 1:43 PM
  • Atradius,

    Thank you for your help.

    More then 1 month without Black Screen, here is what I did:

    -Stop and disable AppReadiness.

    -Add the key DeleteUserAppContainersOnLogoff

    -Applied the lasted Windows Updates.

    -Cleanup the firewall rules.(script)

    -Disabled Cortana.(GPO)

    -Cleanup UPD files.(script)

    -Cleanup old profiles.(script)

    Thank you again for your help.

    Have a great day!

    Friday, November 22, 2019 7:46 PM