7

There are plenty of resources online about using VNC with a linux container, but none that I can find for windows containers, so I thought I'd give it a crack.

I can get the tightVNC server to start (authentication disabled), and the listening ports of 5900 and 5800 appear in the container. However when the client viewer attempts to establish a connection, the best I get is - connection has been gracefully closed

So I enabled level 9 logging on the tightVNC server and here is the section of the log where the incoming connection starts.

[ 1808/ 1812] 2019-09-15 09:39:13:181 + Incoming rfb connection from 
192.168.1.220 to port 61860
[ 1808/ 1812] 2019-09-15 09:39:13:181 ! Set socket idle timeout, 0 ms
[ 1808/ 1812] 2019-09-15 09:39:13:181 ! Client #0 connected
[ 1808/ 1472] 2019-09-15 09:39:13:182 - Entering RFB initialization phase 1
[ 1808/ 1472] 2019-09-15 09:39:13:183   RFB initialization phase 1 completed
[ 1808/ 1472] 2019-09-15 09:39:13:183   Shared flag = 0
[ 1808/ 1472] 2019-09-15 09:39:13:183   Initial view-only state = 0
[ 1808/ 1472] 2019-09-15 09:39:13:183   Authenticated with view-only password = 0
[ 1808/ 1472] 2019-09-15 09:39:13:183 - Creating DesktopWinImpl
[ 1808/ 1472] 2019-09-15 09:39:13:184   The Aero is Off
[ 1808/ 1472] 2019-09-15 09:39:13:185   The console desktop has 0 displays
[ 1808/ 1472] 2019-09-15 09:39:13:185 - D3D driver usage is allowed, try to start it...
[ 1808/ 1508] 2019-09-15 09:39:13:186   Creating of D3D11Device
[ 1808/ 1508] 2019-09-15 09:39:13:187   Creating of (0) driverType device
[ 1808/ 1508] 2019-09-15 09:39:13:193   D3D11CreateDevice function was failed with code error = (-2005270524l)
[ 1808/ 1508] 2019-09-15 09:39:13:194 ! Catched Exception in the Win8ScreenDriverImpl::execute() function: D3D11CreateDe
vice function was failed with code error = (-2005270524l). The exception will consider as critical
[ 1808/ 1508] 2019-09-15 09:39:13:194 ! Win8ScreenDriverImpl has an invalid state. The invalid state can be a part of sc
reen propery changes. An update signal will be generated as a screen size changed signal.
[ 1808/ 1508] 2019-09-15 09:39:13:194 - update detected
[ 1808/ 1508] 2019-09-15 09:39:13:194   Destroy Win8DeskDuplicationThreads
[ 1808/ 1472] 2019-09-15 09:39:13:195 ! The Win8 duplication api can't be used: Win8ScreenDriverImpl can't be successful
ly initialized
[ 1808/ 1472] 2019-09-15 09:39:13:195 - Mirror driver usage is allowed, try to start it...
[ 1808/ 1472] 2019-09-15 09:39:13:195 - Searching for Mirage Driver ...
[ 1808/ 1472] 2019-09-15 09:39:13:197 ! The mirror driver factory has failed: Can't find Mirage Driver!
[ 1808/ 1472] 2019-09-15 09:39:13:197 - Using the standart screen driver
[ 1808/ 1472] 2019-09-15 09:39:13:201 - update detected
[ 1808/ 1472] 2019-09-15 09:39:13:201   Prepare to inject the key event: vkCode = 18, release = 1, extended = 0
[ 1808/ 1472] 2019-09-15 09:39:13:201   The modifier states before: m_controlIsPressed = 0; m_menuIsPressed = 0; m_delet
eIsPressed = 0; m_shiftIsPressed = 0; m_winIsPressed = 0;
[ 1808/ 1472] 2019-09-15 09:39:13:201   The modifier states after: m_controlIsPressed = 0; m_menuIsPressed = 0; m_delete
IsPressed = 0; m_shiftIsPressed = 0; m_winIsPressed = 0;
[ 1808/ 1776] 2019-09-15 09:39:13:201 - mouse detector thread id = 1776
[ 1808/ 1776] 2019-09-15 09:39:13:201 - update detected
[ 1808/  372] 2019-09-15 09:39:13:201 - mouse shape detector thread id = 372
[ 1808/  608] 2019-09-15 09:39:13:201 - poller thread id = 608
[ 1808/  608] 2019-09-15 09:39:13:201 - grabbing screen for polling
[ 1808/  608] 2019-09-15 09:39:13:201 - end of grabbing screen for polling
[ 1808/ 1472] 2019-09-15 09:39:13:201 ! exception during DesktopWinImpl creaion: Access is denied (error code 5)
[ 1808/ 1088] 2019-09-15 09:39:13:201 - console poller thread id = 1088
[ 1808/ 1156] 2019-09-15 09:39:13:202 - Hooks update detector thread id = 1156
[ 1808/ 1156] 2019-09-15 09:39:13:202 - Try allow to receive the 0 windows message
[ 1808/ 1156] 2019-09-15 09:39:13:202 - user32.dll successfully loaded.
[ 1808/ 1156] 2019-09-15 09:39:13:202 - The ChangeWindowMessageFilterEx() function successfully found.
[ 1808/ 1156] 2019-09-15 09:39:13:202 ! Can't allow to receive the 0 windows message by the ChangeWindowMessageFilterEx(
) function. (system error: Invalid window handle (error code 1400))
[ 1808/ 1156] 2019-09-15 09:39:13:202 - Hooks update detector has been terminated.
[ 1808/ 1164] 2019-09-15 09:39:13:205 - update detected
[ 1808/ 1472] 2019-09-15 09:39:13:208 ! Error during RFB initialization: Access is denied (error code 5)
[ 1808/ 1472] 2019-09-15 09:39:13:208 ! Connection will be closed: Access is denied (error code 5)
[ 1808/ 1472] 2019-09-15 09:39:13:208 + Connection from 192.168.1.220 has been closed for client #0
[ 1808/ 1792] 2019-09-15 09:39:13:209 + Connection from 192.168.1.220 has been closed for client #0

I have tried this both on mcr.microsoft.com/windows/servercore:ltsc2019 and mcr.microsoft.com/windows:1903 base images, and both produce the same client message, and similar logs.

I've tried

  • Running the VNC server under the default ContainerAdministrator account
  • Creating a new user account with Admin membership, and running the VNC under that account
  • --isolation process --device class/5B45201D-F2F2-4F3B-85BB-30FF1F953599 from here
  • the --gpus all docker run option (as a guess)

But all hacks so far are fruitless.

I have no idea if it is even possible, but any suggestions/ideas looking at the VNC logs as to what else to could try/hack ? Suggestions on why the RFB init access id denied ?

OrdinaryOrange
  • 185
  • 1
  • 6
  • Have you tried installing directX? `dism.exe /online /quiet /norestart /Add-Capability /CapabilityName:Tools.Graphics.DirectX~~~~0.0.1.0` – Auge Jan 14 '21 at 07:06

0 Answers0