Черный экран windows server 2016


date26.04.2021

user

В этой статье мы рассмотрим, что делать, если при RDP подключении к удаленному хосту вместо рабочего стола вы видите черный экран. Эта проблема стала довольно часто встречаться в последних билдах Windows 10 и Windows Server 2019, и я решил оставить тут информацию из внутренней базы знания нашего HelpDesk о типовых способах решения.

Итак, вы пытаетесь подключиться к удаленному компьютеру стандартным RDP клиентом Windows (mstsc.exe) и после ввода имени и пароля вместо рабочего стола вы видите черный экран (BLM).

черный экран вместо рабочего стола в RDP сессии

Причин, из-за которых вместо RDP сессии отображается черный экран довольно много. Как-то диагностировать или классифицировать их довольно сложно.

  1. В RDP сессии нажмите сочетание клавиш
    CTRL+ALT+END
    (в том числе позволяет сменить пароль в RDP сеансе), а затем нажмите кнопку Отмена. Иногда это позволяет вернуться к рабочему столу RDP сессии. Если это не помогло, запустите из этого экрана диспетчер задач Task Manager и запустите процесс File Explorer (File -> Run new task ->
    explorer.exe
    -> Ok); ctrl alt end в RDP сессии
  2. Проверьте, что в настройках RDP клиента (
    mstsc.exe
    ) отключено кэширование (отключите опцию Persistent bitmap caching на вкладке Experience) и используется разрешение экрана, которое поддерживается удаленным хостом (на вкладке Display выставите меньшее разрешение экрана, или попробуйте режим Full Screen); отключить кэширование для rdp
  3. Убедитесь, что на вашем и на удаленном компьютере установлены последние версии видеодрайверов. Попробуйте воспользоваться автоматическим обновлением драйверов (если этот режим у вас не отключен), или скачайте и установите драйвер вручную). обновить видео драйверы в windows В некоторых случаях для Windows 10 нужно принудительно выставить режим использования XDDM видео драйвера вместо WDDM. Для этого нужно открыть редактор групповых политик gpedit.msc и в разделе Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Remote Session Environment установить значение параметра Use WDDM graphics display driver for Remote Desktop Connections = Disabled (либо тоже самое через реестр:
    reg add “HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services” /v “fEnableWddmDriver” /t REG_DWORD /d 0 /f
    . Обновите групповые политики на RDP сервере; Use WDDM graphics display driver for Remote Desktop Connections
  4. В Windows Server 2016 с настроенными таймаутами для RDS сессий пару раз сталкивался с жалобами пользователей, что после подключения в отключенную (disconnected) сессию, она не активировалась корректно и они видели черный экран. Здесь поможет только завершение RDP сеанса пользователем самостоятельно (CTRL+ALT+End -> Sign out), либо принудительное завершение сессии администратором (по аналогии со статьей Не удается завершить требуемую операцию при входе по RDP). Либо настройте более агрессивные настройки отключения disconnected сессий;
  5. Отключите использование протокола UDP 3389 для передачи RDP трафика в дополнение к стандартному RDP порту TCP 3389 (доступно, начиная с Windows Server 2012 R2/Windows 8.1) через параметр Turn off UDP on client на клиенте (Computer Configuration -> Policies -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Connection Client) или через реестр:
    reg add “HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client” /v “fClientDisableUDP” /t REG_DWORD /d 1 /f
    . Для отключения UDP протокола для RDP трафика на стороне сервера, настройте параметр GPO …Remote Desktop Session Host -> Connections -> Select RDP transport protocols = Use only TCP. отключить использование UDP для RDP сессий

Из более экзотических рекомендаций от Microsoft, которые помогают далеко не всегда, но могут исправить именно источник проблемы:

  1. Убедитесь, то RDP сервер, клиент и все сетевое оборудование между ними настроены на одинаковый размер MTU;
  2. Отключите сжатие передаваемых данных в сеансе RDP через редактор локальной GPO – Configure compression for RemoteFX data (Настройка сжатия данных RemoteFX) = Do not use an RDP compression algorithm (Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host). отключить сжатие для rdp трафика
  3. Если проблема с черным экраном в RDP встречается на Windows Server 2019 и Windows 10 1809+. Откройте Event Viewer и проверьте журнал событий Application and Service Logs –> Microsoft –> Windows –> RemoteDesktopService-RdpCoreTS. Проверьте, есть ли там ошибки вида ‘
    Failed GetConnectionProperty’ in CUMRDPConnection::QueryProperty at 2884 err=[0x80004001]
    ‘, ‘
    Connection doesn’t support logon error redirector’ in CUMRDPConnection::GetLogonErrorRedirector at 4199 err=[0x80004001]
    . Если такие ошибки встречаются, нужно отключить использование протокола URCP (Universal Rate Control Protocol), который используется для передачи некоторых данных между RDP клиентом и сервером поверх UDP (MS-RDPEUDP2):
    reg add “HKLM\SOFTWARE\Microsoft\Terminal Server Client” /v “UseURCP” /t REG_DWORD /d 0 /f

    или так
    New-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Terminal Server Client' -Name UseURCP -PropertyType DWord -Value 0




Доброго времени суток. 
Есть сервер Windows Server 2016 с поднятой ролью терминального сервера.
Периодически(Примерно 1 раз в неделю), при подключении к серверу по RDP отображается чёрный экран. Можно попытаться вызвать taskmanager и выполнить команду explorer.exe, но ни какого результата команда не даёт. Спасает перезагрузка сервера,
но в рабочее время это достаточно критично.

Проблеме предшествует событие 7011: 

Превышение времени ожидания (90000 мс) при ожидании ответа транзакции от службы «Audiosrv».

Превышение времени ожидания (90000 мс) при ожидании ответа транзакции от службы «AudioEndpointBuilder».

Превышение времени ожидания (90000 мс) при ожидании ответа транзакции от службы «UmRdpService».

Превышение времени ожидания (90000 мс) при ожидании ответа транзакции от службы «ScDeviceEnum».

Превышение времени ожидания (90000 мс) при ожидании ответа транзакции от службы «hidserv».

Превышение времени ожидания (90000 мс) при ожидании ответа транзакции от службы «NcbService».

Превышение времени ожидания (90000 мс) при ожидании ответа транзакции от службы «Netman».

И после этого начитают происходить проблемы с подключением. Появляются ошибки 7022 «Служба «Шлюз удалённых рабочих столов» зависла при запуске. «Сервер посредника подключений к удаленному рабочему столу не доступен,
или не запущены нужные службы. Как я заметил, сначала всегда отваливается Audiosrv, а дальше всё остальное.

  • Изменено

    12 июля 2017 г. 7:08

  • Изменен тип
    Vector BCOModerator
    15 января 2018 г. 21:47
    нет активности

Давайте рассмотрим, что делать, если во время RDP подключении к удаленному хосту вы видите не рабочий стол, а черный экран. Проблема особенно часто встречается в ранних версиях Windows 10 и Windows Server 2019. Забегая наперед скажем, что проблема решается. 

Причины возникновения проблемы

Почему вместо RDP сессии появляется черный экран?

Причины возникновения проблемы

Диагностировать или присвоить их к категории, то есть классифицировать, достаточно проблематично. Но мы постараемся это сделать:

Во время сессии RDP нажмите CTRL+ALT+END, после чего Отмена. Часто так можно вернуться к рабочему столу RDP сессии. Если не помогает, запускаем диспетчер задач Task Manager и процесс File Explorer (File -> Run new task -> explorer.exe -> Ok);

Настройки RDP клиента

Проверьте, что в настройках RDP клиента (mstsc.exe) отключено кэширование (выключаем Persistent bitmap caching на вкладке Experience) и используется разрешение экрана.

Разрешение экрана

Оно поддерживается удаленным хостом. Проверьте, что на вашем ПК стоит последняя версия видеодрайвера. Вы можете установить драйвера ручным способом или установить их автоматическое обновление. 

Настройки

Решение проблемы

Для Windows 10 нужно вставить использование XDDM вместо WDDM. Откроем редактор групповых политик gpedit.msc и в разделе Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Remote Session Environment ставим значение параметра Use WDDM graphics display driver for Remote Desktop Connections = Disabled. Обновляем групповые политики на RDP сервере.

Групповая политика

В Windows Server 2016 с выставленными таймаутами для RDS сессий иногда приходят жалобы пользователей, что после подключения в отключенную (disconnected) сессию, она не активировалась корректно и они видели черный экран. Здесь поможет только завершение RDP сеанса пользователем самостоятельно (CTRL+ALT+End -> Sign out), либо принудительное завершение сессии администратором (по аналогии со статьей Не удается завершить требуемую операцию при входе по RDP). Либо настройте более агрессивные настройки отключения disconnected сессий;

Отключаем использование протокола UDP 3389 для передачи RDP трафика в дополнение к стандартному RDP порту TCP 3389 через параметр Turn off UDP on client на клиенте (Computer Configuration -> Policies -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Connection Client) или через реестр: reg add “HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client” /v “fClientDisableUDP” /t REG_DWORD /d 1 /f . Для отключения UDP протокола для RDP трафика на стороне сервера, настройте параметр GPO …Remote Desktop Session Host -> Connections -> Select RDP transport protocols = Use only TCP.Локальная политика

Другие способы

Из более экзотических рекомендаций от Microsoft, которые помогают далеко не всегда, но могут исправить именно источник проблемы:

Проверяем RDP сервер, клиент и все сетевое оборудование между ними. Они должны быть настроены на одинаковый MTU.

Выключаем опцию сжатия данных, которые перелаются, в сеансе RDP через редактор локальной GPO – Configure compression for RemoteFX data (Настройка сжатия данных RemoteFX) = Do not use an RDP compression algorithm (Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host).

Если проблема с черным экраном в RDP встречается на Windows Server 2019 и Windows 10 1809+. Откройте Event Viewer и проверьте журнал событий Application and Service Logs –> Microsoft –> Windows –> RemoteDesktopService-RdpCoreTS.

Проверьте, есть ли там ошибки вида ‘ Failed GetConnectionProperty’ in CUMRDPConnection::QueryProperty at 2884 err=[0x80004001] ‘, ‘ Connection doesn’t support logon error redirector’ in CUMRDPConnection::GetLogonerrorRedirector at 4199 err=[0x80004001].

Если есть, отключаем использование протокола URCP (Universal Rate Control Protocol), который используется для передачи некоторых данных между RDP клиентом и сервером поверх UDP (MS-RDPEUDP2): reg add “HKLM\SOFTWARE\Microsoft\Terminal Server Client” /v “UseURCP” /t REG_DWORD /d 0 /f или так New-ItemProperty ‘HKLM:\SOFTWARE\Microsoft\Terminal Server Client’ -Name UseURCP -PropertyType DWord -Value 0

Проверяем RDP сервер

Теперь вы знаете, как можно решить эту проблему. 

A customer informed us that some users were getting a black screen after logon and others could not open the start menu after they got past the black screen. The customer restarted the RDS host but the issue was not resolved.

When checking the event logs I noticed system events with ID 10001 like the one below

This led me to think there was an issue with Appx and came across some material that suggested repairing Cortana. Trying to run the suggested PowerShell command failed and upon reviewing the AppPackage Log as suggested by the failure error I noticed that the package did not install because of insufficient resources. The system had only 6GB out of 128GB ram used and CPU (8 Cores) were at 2%

Searching further, I found this technet forum post in which the cause and solution are discussed.

Basically, every time a user logs into the RDS server, a new set of firewall rules is created and are not removed when the users log off, but new ones are re-created when they login again. This appears to happen most when using User Profile Disks (UPD). You may notice at this time that when trying to open WWindows Defender Firewall with Advanced Security to view the rules, the window would take a very long time to appear and end up in a “Not Responding” state.

This was resolved in Windows Server 2016 and 2019 by installing a Windows update, link for 2016 and 2019, and manually applying a registry key.

The updates were already installed so we proceeded to add the registry key as per below using Regedit.

Add “DeleteUserAppContainersOnLogoff” (DWORD) in “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy” and set it to 1. 

We logged off and logged back in and the Start menu was working again. All the other users also reported that this resolved the issue.

At this stage it is suggested that the previously created firewall rules are also deleted. These are the registry keys were the rules are stored.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules (Server 2016 and 2019)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\\RestrictedServices\AppIso\FirewallRules (Server 2019 only)

Instead of deleting the whole set of entries, we decided on taking another path and use the PowerShell script provided by user Paul Boerefijn CCS which removes the firewall rules and keeps a set of unique rules. The process was going to take over 15hrs to remove 12,000 inbound rules and we don’t know how long it was going to take to remove the outbound rules. So instead we used a different script found on stackoverflow which rather than using the “Remove-NetFirewallRule” PowerShell command it removed the rules directly from within the registry with the “Remove-ItemProperty” command which sped up the process and all 30,000 rules were deleted in 1.5Hrs. The script used is available below with some minor additions

NOTE Make sure that you change the Rule2 deletion line to match the correct registry path depending on which windows server version you are running it on. These are indicated in the script

#Script thanks to user js2010
#source https://stackoverflow.com/a/40915201
#added registry paths notes
$profiles = get-wmiobject -class win32_userprofile

Write-Host "Getting Firewall Rules"

# deleting rules with no owner would be disastrous
$Rules = Get-NetFirewallRule -All | 
  Where-Object {$profiles.sid -notcontains $_.owner -and $_.owner }

Write-Host "Getting Firewall Rules from ConfigurableServiceStore Store"

$rules2 = Get-NetFirewallRule -All -PolicyStore ConfigurableServiceStore | 
  Where-Object { $profiles.sid -notcontains $_.owner -and $_.owner }

$total = $rules.count + $rules2.count
Write-Host "Deleting" $total "Firewall Rules:" -ForegroundColor Green

$result = measure-command {

  # tracking
  $start = Get-Date; $i = 0.0 ; 
  
  foreach($rule in $rules){

    # action
    remove-itemproperty -path "HKLM:\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules" -name $rule.name

    # progress
    $i = $i + 1.0
    $prct = $i / $total * 100.0
    $elapsed = (Get-Date) - $start; 
    $totaltime = ($elapsed.TotalSeconds) / ($prct / 100.0)
    $remain = $totaltime - $elapsed.TotalSeconds
    $eta = (Get-Date).AddSeconds($remain)

    # display
    $prctnice = [math]::round($prct,2) 
    $elapsednice = $([string]::Format("{0:d2}:{1:d2}:{2:d2}", $elapsed.hours, $elapsed.minutes, $elapsed.seconds))
    $speed = $i/$elapsed.totalminutes
    $speednice = [math]::round($speed,2) 
    Write-Progress -Activity "Deleting rules ETA $eta elapsed $elapsednice loops/min $speednice" -Status "$prctnice" -PercentComplete $prct -secondsremaining $remain
  }


  # tracking
  # $start = Get-Date; $i = 0 ; $total = $rules2.Count

  foreach($rule2 in $rules2) {

    # action
#change path according to the Windows Server version used:
#Windows Server 2019 Path = "HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\RestrictedServices\AppIso\FirewallRules"
#Windows Server 2016 Path = "HKLM:\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\RestrictedServices\Configurable\System"
    
    remove-itemproperty -path "HKLM:\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\RestrictedServices\Configurable\System" -name $rule2.name

    # progress
    $i = $i + 1.0
    $prct = $i / $total * 100.0
    $elapse = (Get-Date) - $start; 
    $totaltime = ($elapsed.TotalSeconds) / ($prct / 100.0)
    $remain = $totaltime - $elapsed.TotalSeconds
    $eta = (Get-Date).AddSeconds($remain)

    # display
    $prctnice = [math]::round($prct,2) 
    $elapsednice = $([string]::Format("{0:d2}:{1:d2}:{2:d2}", $elapsed.hours, $elapsed.minutes, $elapsed.seconds))
    $speed = $i/$elapsed.totalminutes
    $speednice = [math]::round($speed,2) 
    Write-Progress -Activity "Deleting rules2 ETA $eta elapsed $elapsednice loops/min $speednice" -Status "$prctnice" -PercentComplete $prct -secondsremaining $remain
  }
}

$end = get-date
write-host end $end 
write-host eta $eta

write-host $result.minutes min $result.seconds sec

Once the script completes, the rules are removed and you will notice that the Windows Defender Firewall with Advanced Security window would open normally.

Script Output

Both scripts catered to avoid deleting the rules which had no owner set in the properties. Deleting these rules could case problems.

The purpose of this blog post is to try and consolidate all the information we found to resolve the issue. A big thanks goes to all the contributors in the different forums.

Hope you find it useful.

By Brian Farrugia

I am the author of Phy2Vir.com. More info can be found on the about page.

  • Remove From My Forums
  • Question

  • Is anyone aware of a fix to this issue?

    See the post from Sasha (Microsoft): here

    Here is a post to the MS KB acknowledging and providing a resolution for 2012 R2:
    here 

    To resolve the issue when it happens, i need to kill the TermService service (it won’t stop normally as it is in a deadlock state). I can then start the service again and it’s business as usual until it happens again.

    I can’t see any info about this in RDS 2016… Anyone else? MS?

    Thanks,

    Stephen

Answers

  • Hi Stephen,

    In my experience this issue should be resolved as of the
    January 10, 2017 (KB3213986) update to Server 2016.  If you have installed all the latest updates on the server and are still seeing this issue please reply back.

    Thanks.

    -TP

    • Marked as answer by

      Sunday, March 19, 2017 10:39 PM

  • Черно белые обои для windows 10
  • Черный экран rdp windows server 2019
  • Чем смотреть vob файлы в windows 10
  • Через hdmi не идет звук на телевизор windows 10
  • Черная тема проводника windows 10