It is not possible to connect to the container by RDP, the following error is shown:
Local session manager service failed the logon. The requested session access is denied.
The following event can be found in the Event Viewer of the container:
The TS Licensing grace period has expired and the service has not registered with a license server with installed licenses. A TS Licensing server is required for continuous operation. A terminal server can operate without a license server for 120 days after initial start up.
"Remote Desktop Licensing Server" role was installed into the container and no valid Licensing Server was specified. As a result, the grace period has expired and it is not possible to connect by RDP any more.
If a valid Licensing Server is available, it is possible to set it through the container registry. See the instructions in this article: Set preferred Terminal Server license servers, section "Using the registry".
If you do not plan to use a Licensing Server for the container, then you should uninstall the Remote Desktop Services roles from the container:
vzctl delrole <CTID> Remote-Desktop-Services vzctl restart <CTID>
If, for some reason, the roles cannot be uninstalled, using the above command, it is possible to reset the grace period through the registry.
Stop and mount the container:
vzctl stop <CTID> && vzctl mount <CTID>
Download psexec tool from Microsoft Sysinternals.
Open command prompt and get the ID of the current terminal session:
c:\> qwinsta C:\Users\ameshcheryakov>qwinsta | findstr Active >console administrator 10 Active
Open registry editor under SYSTEM account with
psexec, indicating the session number obtained with the previous command:
psexec -s -i 10 regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriodand delete the key.
Change the value
HKEY_LOCAL_MACHINE\vz18850\MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core\LicensingModeto 1
Start the container.
vzctl start <CTID>