Windows 2019 rdp зависает

В современных версиях Windows 10/11 и Windows Server 2022/2019/2016 при подключении к серверу RDP (RDS) кроме стандартного порта TCP/3389, дополнительно используется UDP порт 3389. Когда ваш RDP клиент подключается к серверу, устанавливается несколько сессий. В управляющей TCP (HTTP) сессии передаются клавиатура и мышь, а несколько UDP сессий используются для передачи картинки.

Вы можете проверить, использует ли ваш клиент mstsc режим UDP, если щелкните по значку Connection Info в верхней полоске RDP подключения. В нашем случае протокол UDP используется:

The quality of the connection to the remote computer is excellent and UDP is enabled.

Для RDP подключений используется протокол UDP

По утверждениям Microsoft использование UDP для RDP сессий позволяет существенно повысить отзывчивость удаленного рабочего стола за счет сокращения ретрансмиссии и возможности работать на нестабильных подключениях с высокими задержками.

Зависание RDP сессий при использовании UDP

В некоторых случаях использование протокола UDP для RDP подключения может вызывать проблемы: периодическое замирание картинки, обрывы RDP сессий, пользователи видят черных экран вместо удаленного рабочего стола, сообщение о внутренней ошибке при RDP подключении и т.д. В таких случаях обычно помогает переподключение к RDP сессии. Но иногда такая проблема происходит очень часто и мешает нормальной работе.

Проблема с замиранием RDP сессий встречается:

  • При использовании RDP сессий внутри VPN туннелей ( чаще всего наблюдается при использовании сервера OpenVPN). Это вызывается фрагментированием UDP пакетов (может быть вызвано разными настройками MTU) при пересылке через VPN туннель;
  • После обновления до билда 22H2 в Windows 11/10;
  • При использовании шлюза Remote Desktop Gateway на Windows Server 2022 и порта 3391 для UDP трафика.

Причем проблема не связана с плохой производительностью RDS сервера как описано в кейсе по ссылке: на сервере достаточно свободных ресурсов, память и CPU не нагружены.

Отключить использование протокола UDP для RDP

Для решения проблемы с зависанием RDP сессий при использовании VPN туннелей вы можете попробовать отключить использование протокола UDP.

Можно отключить протокол UDP для RDP через групповые политики.

  1. Откройте консоль редактора локальной GPO (
    gpedit.msc
    );
  2. Перейдите в раздел Computer Configuration -> Administrative Templates -> Windows Components -> Remoter Desktop Services -> Remote Desktop Session Host -> Connections;
  3. Включите параметр политик Select RDP transport protocols и установите Select Transport Type = Use only TCP;
    RDP сервер - использовать только TCP порт

  4. Перезагрузите RDS/RDP сервер, чтобы применить настройки;
  5. Подключитесь к RDP серверу и нажмите на значок информации о подключении. Здесь должна появиться надпись:
    The quality of the connection to the remote computer is good.

    Для RDP подключения используется только TCP

Это означает, что для RDP подключения используется только TCP.

Этот способ позволяет отключить использование UDP на стороне сервера RDP/RDS. Если вы хотите запретить использовать UDP для RDP на стороне клиента, нужно включить параметр Turn off UDP on Client в разделе Computer Configuration -> Administrative Templates -> Windows Components -> Remoter Desktop Services -> Remote Desktop Connection Client.

Параметр политик - отключить UDP на клиенте Turn off UDP on Client

После внесения изменений, нужно обновить локальные политики командой
gpupdate /force
и перезапустить клиент mstsc.exe.

Также можно включить этот параметр через реестр (параметр GPO соответствует ключу fClientDisableUDP в реестре):

reg add "HKLM\software\policies\microsoft\windows nt\Terminal Services\Client" /v fClientDisableUDP /d 1 /t REG_DWORD

Remote Desktop Protocol (RDP) is an essential feature for managing Windows Server 2019 remotely. However, many administrators face an issue where RDP sessions freeze, making it difficult to maintain smooth operations. This guide will explore the possible causes of RDP session freezes on Windows Server 2019 and provide effective solutions.

Common Causes of RDP Session Freezing

Several factors can lead to RDP session freezes in Windows Server 2019. Here are few of the most common causes:

1. Network Instability

RDP requires a stable network connection. If the connection experiences high latency, packet loss, or network congestion, sessions may freeze or disconnect.

2. Insufficient Server Resources

A server with low CPU, RAM, or disk I/O can struggle to maintain RDP sessions, causing lags and freezes.

3. Outdated RDP Client or Server Components

Using an outdated version of the Remote Desktop client or running an unpatched Windows Server 2019 can lead to compatibility issues and freezing problems.

4. Group Policy Misconfigurations

Certain Group Policy settings can negatively impact RDP performance, leading to session delays or freezes.

5. Third-Party Software Conflicts

Antivirus programs, firewall settings, or third-party applications running on the server might interfere with RDP, causing unexpected freezing.

6. GPU and RemoteFX Issues

If your server is using GPU acceleration or RemoteFX, misconfigurations in these settings can lead to performance problems in RDP sessions.

7. High Number of Concurrent Sessions

Windows Server 2019 has limits on the number of concurrent RDP sessions it can handle. Exceeding these limits can cause session instability.

Solutions to Fix RDP Session Freezes

1. Check Network Stability

    • Run a ping test to check for packet loss: ping -t <server IP>
    • Use the tracert command to diagnose latency issues: tracert <server IP>
    • If possible, switch to a wired connection instead of Wi-Fi to improve stability.
    • Adjust RDP settings to lower bandwidth usage:
      • Disable visual effects.
      • Reduce the color depth.
      • Disable printer and drive redirection.

2. Optimize Server Performance

  • Check CPU and RAM usage in Task Manager (Ctrl + Shift + Esc).
  • Close unnecessary applications and background processes.
  • Allocate more resources to the server if it’s running on a virtual machine.
  • Upgrade server hardware if needed.

3. Update Windows Server and RDP Client

  • Ensure that Windows Server 2019 is up to date by running:
    sconfig

    Then select option 6 to install updates.

  • Update the Remote Desktop client on your local machine to the latest version.

4. Adjust Group Policy Settings

    • Open the Group Policy Editor (gpedit.msc).
    • Navigate to:
      Computer Settings > Administrative Templates > Windows Components > Remote Desktop (RDP) Services > Remote Desktop Session Host
    • Ensure the following settings are configured correctly:
      • The set time limit for disconnected sessions: Not Configured
      • Limit maximum color depth: Enabled (16-bit or lower for low bandwidth)
      • Use WDDM graphics display driver for Remote Desktop Connections: Disabled (for better compatibility)

5. Disable Conflicting Third-Party Software

  • Temporarily disable antivirus and firewall to test if they are causing the issue.
  • If disabling resolves the problem, add RDP to the exception list in your antivirus.
  • Uninstall unnecessary third-party applications that may interfere with RDP.

6. Check and Adjust GPU Settings

    • If your server uses GPU acceleration, disable it to see if performance improves:
      • Open Device Manager (devmgmt.msc).
      • Expand Display adapters and disable the GPU.
    • If using RemoteFX, ensure it’s properly configured:
      • Open Hyper-V Manager > Select your virtual machine > Settings.
      • Go to RemoteFX 3D Video Adapter and disable it if issues persist.

7. Limit Concurrent Sessions

  • Open Group Policy Editor and navigate to:
    Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Merger
  • Enable Limit number of connections and set a reasonable number (e.g., 2-10, depending on server capacity).
  • Restart the server for the modify to take effect.

8. Restart Remote Desktop Services

  • Open Command Prompt as Administrator and run:
    net stop termservice
    net start termservice
  • Alternatively, restart the server to ensure all services reload properly.

9. Use RDP Over UDP Instead of TCP

  • Open Registry Editor (regedit).
  • Navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Terminal Server Client
  • Set fClientDisableUDP to 0 (if it doesn’t exist, create it as a DWORD value).
  • Restart your computer.

10. Monitor and Analyze Event Logs

  • Open Event Viewer (eventvwr.msc).
  • Go to Windows Logs > Application and System.
  • Look for warnings or error messages related to RDP and troubleshoot accordingly.

Conclusion

RDP session freezes on Windows Server 2019 can be caused by various factors, including network issues, resource constraints, outdated software, and misconfigured policies. By following the troubleshooting steps outlined in this guide, you can resolve the issue and improve the reliability of your Remote Desktop connections. If problems persist, consider upgrading server resources or using alternative remote management tools like Microsoft Remote Desktop Gateway or third-party solutions.

Добрый день. Есть терминальный сервер на Windows Server 2019. По RDP работают несколько пользователей. В настройках подключения RDP отключил все настройки, которые могут влиять на скорость работы — отключил проброс всех устройств, сглаживание шрифтов (и все остальные «визуальные эффекты), глубину цвета установил 15 бит. Но всё равно, такое чувство, что тормозит отрисовка всех окон, картинок и так далее. Но, чем больше работаешь, тем меньше тормозит. Если работать локально, то никаких «тормозов» нет.


  • Вопрос задан

  • 5963 просмотра

На клиентах можно попробовать отключить автоподстройку RDP, для этого запускаем CMD от имени администратора и там выполняем:

netsh interface tcp set global autotuninglevel=disabled

Пригласить эксперта

а чего тут гадать, ты дай адрес и данные для входа на админку, по рдп, а мы всем Хабром посмотрим и дадим точный ответ.

Скорость интернета замерьте на сервере, особенно uplink. Как-то у меня при downlink в 200 Мбит, аплинк был 1-2 Мбит и работать было крайне дискомфортно.
Ну и ping сервера не помешал бы.

Нет понимания как происходит подключение.
— Если в локальной сети — проверьте коммутатор
— Если из внешней сети, то проверить загрузку роутера, может у него процессор чем-то загружен. Попробовать приоритеты трафика настроить.
— Еще как вариант отключить RDP по UDP на сервере, и проверить как будет работать по TCP (у меня однажды из-за этого некоторые клиенты в локальной сети отваливались каждую минуту).

Думаю, что в первую очередь смотреть, что с сетью и интернет подключением. И отключить UDP и на сервере, и на клиенте.

Войдите, чтобы написать ответ


  • Показать ещё
    Загружается…

Минуточку внимания

В этой статье рассмотрим несколько решений частых проблем с производительностью серверов RDS и опубликованных приложений RemoteApp на Windows Server 2019/2016. Эти решения помогут устранить задержки при работе пользователей, если ваша инфраструктура сталкивается с медленной работой RDS или RemoteApp. Прежде чем применять какое-либо решение, убедитесь, что оно соответствует вашей инфраструктуре.

Приобрести оригинальные ключи активации Windows Server RDS CAL можно у нас в каталоге:

Windows Server 2019 RDS User CAL — 3790 ₽

Windows Server 2016 RDS User CAL — 3690 ₽

Проблема с производительностью RDS в Windows Server 2016/2019 с User Profile Disks (UPD)

Одной из частых проблем на RDS серверах с Windows Server 2016/2019 является падение производительности при использовании профилей пользователей, хранящихся на User Profile Disks (UPD). Проблема заключается в том, что Windows Defender Firewall создает новые входящие и исходящие правила при каждом входе пользователя, и эти правила не удаляются после завершения сеанса.

Со временем количество правил может достигнуть критического значения, что вызывает замедление работы сервера RDS: длительный вход в систему, черный экран при подключении по RDP, зависание RDS-хостов, проблемы с меню «Пуск» и др.

Как проверить количество правил в Windows Defender Firewall:

Используйте следующую команду PowerShell:

(Get-NetFirewallRule).count

В нашем случае на одном из хостов оказалось 18 тысяч правил! Эти правила создаются для UWP приложений магазина Windows при каждом входе пользователя.

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

1. Установите все последние обновления безопасности для вашей версии Windows Server (рекомендуемые патчи: KB4467684 для Windows Server 2016 и KB4490481 для Windows Server 2019).

2. Создайте следующий параметр реестра на RDS-хосте для автоматического удаления правил:

Ветка реестра:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy

Параметры:
— Тип: REG_DWORD
— Имя: DeleteUserAppContainersOnLogoff
— Значение: 1

Команда PowerShell для создания параметра:

New-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy” -Type DWord -Name DeleteUserAppContainersOnLogoff -Value 1

3. Если у вас несколько RDS хостов, распространите этот параметр через GPO.
4. Вручную очистите правила брандмауэра, используя PowerShell или готовые скрипты с форумов, например, с [TechNet](https://social.microsoft.com/Forums/Azure/en-US/992e86c8-2bee-4951-9461-e3d7710288e9/windows-servr-2016-rdsh-firewall-rules-created-at-every-login?forum=winserverTS).

Для более стабильного решения можно использовать контейнеры профилей пользователей с помощью FSLogix вместо UPD.

Проблемы с мышью в RDP сессиях на Windows Server 2019/2016

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

Это может быть связано с высокой частотой опроса (Report Rate) и разрешением DPI у некоторых мышей, особенно игровых (например, у Logitech G203 частота опроса по умолчанию 1000 Гц). Высокая частота опроса создает нагрузку на RDP подключение и может вызывать тормоза.

Решение:

1. Уменьшите частоту опроса мыши до 125 Гц через утилиты настройки мыши от производителя.

2. Если это невозможно, попробуйте отключить тень курсора в настройках мыши (панель управления, main.cpl) и установите схему указателя на «None».

Медленная работа RemoteApp в Windows 10

После обновления Windows 10 на клиентах до версий 1803 и 20H2, многие столкнулись с проблемами при работе с RemoteApp приложениями на серверах RDS. Меню приложений могут долго отрисовываться, пунктам меню требуется несколько кликов для активации, а сами окна RemoteApp замедляются в 2-3 раза.

Временное решение:

Измените значение параметра Use advanced RemoteFX graphics for RemoteApp на «Disabled» в редакторе локальной GPO:

Computer Configuration -> Policies -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Remote Session Environment

В русской версии Windows:

Компоненты Windows -> Службы удаленных рабочих столов -> Узел сеансов удалённых рабочих столов -> Среда удалённых сеансов

Если опубликованы графические приложения, такие как CAD, без RemoteFX они могут работать некорректно.

Дополнительное решение — замена версии RDP клиента

Проблемы с RemoteApp наблюдались начиная с Windows 10 версии 1709, поэтому можно временно решить проблему, заменив файлы клиента RDP (mstsc.exe и mstscax.dll) на более старые версии из билдов Windows 10 1607 или 1703.

Шаги по замене файлов клиента RDP:

1. Скачайте архив с файлами RDP (mstsc-w10-1607) из Windows 10 1607.

2. Скопируйте оригинальные файлы mstsc.exe и mstscax.dll из C:\Windows\System32 в каталог C:\Backup:

md c:\backup\

copy C:\windows\system32\mstsc.exe c:\backup

copy C:\windows\system32\mstscax.dll c:\backup

3. Назначьте своей учетной записи права владельца файлов и отключите наследование прав:

takeown /F C:\windows\system32\mstsc.exe

takeown /F C:\windows\system32\mstscax.dll

icacls C:\windows\system32\mstsc.exe /inheritance:d

icacls C:\windows\system32\mstscax.dll /inheritance:d

icacls C:\windows\system32\mstsc.exe /grant root:F

icacls C:\windows\system32\mstscax.dll /grant root:F

(В этом примере имя локальной учтённой записи с правами администратора – root. Замените ее на имя вашей учетной записи)

4. Замените файлы в каталоге C:\windows\system32\ на версии из архива.

5. Восстановите оригинальные разрешения на заменённых файлах. Включите наследование NTFS разрешений и назначьте владельцем файлов NT Service\TrustedInstaller:

icacls C:\windows\system32\mstsc.exe /inheritance:e

icacls C:\windows\system32\mstscax.dll /inheritance:e

icacls C:\windows\system32\mstsc.exe /setowner "NT Service\TrustedInstaller" /T /C

icacls C:\windows\system32\mstscax.dll /setowner "NT Service\TrustedInstaller" /T /C

6. Перерегистрируйте библиотеку:

regsvr32 C:\Windows\System32\mstscax.dll

Это решение временно исправит проблему с производительностью RemoteApp на клиентах Windows 10.

Заключение

В данной статье были рассмотрены решения типичных проблем с производительностью RDS и RemoteApp в Windows Server 2019/2016. Если в вашей инфраструктуре наблюдаются задержки и замедления при использовании RDS, примените указанные рекомендации, предварительно проверив их совместимость с вашим окружением.

In Windows 10/11 and Windows Server 2022/2019/2016, when connecting to a Remote Desktop (RDS) server, UDP port 3389 is used in addition to the default RDP port TCP/3389. When your RDP client connects to the server, multiple sessions are established. The TCP (HTTP) control session is used to transmit the keyboard and mouse commands, and several UDP sessions are used to send the Remote Desktop images.

Contents:

  • RDP Connection Freezes When Using UDP Protocol
  • How to Disable the UDP Protocol over RDP

Check your MSTSC client is using UDP transport mode by clicking the Connection Info icon in the top RDP connection bar. The UDP protocol is used in our case.

The quality of the connection to the remote computer is excellent and UDP is enabled.

Remote Desktop Protocol: UDP Transport

According to Microsoft, the use of the UDP protocol can significantly improve the responsiveness of the Remote Desktop session by reducing the number of retransmissions and the ability to work over unstable, high-latency connections.

RDP Connection Freezes When Using UDP Protocol

In some cases, using the UDP protocol for an RDP connection can cause problems: periodic image freezing, random disconnection of an RDP session, users seeing a black screen instead of the Remote Desktop, etc. Reconnecting to the RDP session usually helps in these cases. Sometimes this problem occurs frequently and affects the user’s normal functioning.

The problem with RDP sessions freezing occurs:

  • If you are using RDP sessions within VPN tunnels (commonly encountered when using an OpenVPN Server). The cause of this is a fragmentation of UDP packets. This is caused by fragmentation of UDP packets as they are sent through the VPN tunnel (caused by different MTU settings);
  • After updating Windows 11/10 to 22H2/22H2 build;
  • When using the Remote Desktop Gateway on Windows Server 2022 and port 3391 for UDP traffic.

Moreover, the problem is not related to poor performance of the RDS host, as described in the case at the link: the server has enough free resources, memory and CPU are not being used at a high rate.

How to Disable the UDP Protocol over RDP

To resolve the issue of RDP sessions freezing when using VPN tunnels, you can try disabling the use of the UDP transport protocol.

You can disable UDP over RDP via Group Policy.

  1. Open the local GPO editor console (gpedit.msc);
  2. Expand Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections;
  3. Enable the policy Select RDP transport protocols and set Select Transport Type = Use only TCP;
    GPO: force RDP to use TCP only

  4. Restart the RDS/RDP server for the settings to take effect;
  5. Reconnect to the RDP server and click the Connection Information icon. The following message should appear here:
The quality of the connection to the remote computer is good.

TCP transport for Remote Desktop

This means that only TCP is used for the RDP connection.

This method allows you to disable the use of the UDP transport protocol on the RDP/RDS server side. Suppose you want to disable UDP for Remote Desktop on the client side. In that case, you need to enable the Turn off UDP on Client option under Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Connection Client.

After making changes, update the local policy settings using the gpupdate /force command and restart the mstsc.exe client.

You can also enable this option in the registry (the GPO policy mentioned above corresponds to the fClientDisableUDP registry parameter):

reg add "HKLM\software\policies\microsoft\windows nt\Terminal Services\Client" /v fClientDisableUDP /d 1 /t REG_DWORD

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows forms pascalabc net
  • Windows vista vortex 3g red
  • Удалить пользователя майкрософт в windows 10
  • Что такое цифровое аудио s pdif windows 10
  • Где хранится windows на ноутбуке