Citrix Server VDI – VDA not registering with Xendesktop Controller 7.x

Recently i was working with an client, where there was an requirement for Server VDI. You may decide to use server VDI for any reason like

  • End Users are administrators or programmers who want server OS
  • Or you may be a service provider hosting DaaS.

What ever the reason may be it’s possible from Citrix Xendesktop Enterprise license.

Back to the issue, when i had the server VDI provisioned it wasn’t communicating with the controller. It was in unregistered state.

I ensured i’ve followed the steps (i.e command line installation with /servervdi flag) as mentioned in the citrix article

I checked eventvwr of VDA and i was able to see the below event

The Citrix Desktop Service failed to initialize communication services required for interaction between this machine and delivery controllers.

If the problem persists please perform a ‘repair’ install action or reinstall the Citrix Virtual Desktop Agent. Refer to Citrix Knowledge Base article CTX119736 for further information.

Error details:
Failed to start WCF services. Exception ‘Object reference not set to an instance of an object.’ of type ‘System.NullReferenceException’

XDping logs had the below

WCF Endpoints: BrokerAgent::
C:\Program Files\Citrix\Virtual Desktop Agent\BrokerAgent.exe
Version Number :

XenDesktop version
Ping Service: /Citrix/VirtualDesktopAgent/ILaunch
Connect = Tcp to ::1:80 via ::1 (“Loopback Pseudo-Interface 1”) [OK]
Service = Invalid response <HTTP/1.1 503 Service > [ERROR]

Tried re-installing VDA, didn’t help.

Took citrix support, ran CDF trace and they did the analysis. Came back with the analysis on whats exactly failing

The following System.InvalidCastException is thrown as BrokerAgent starts up, creates our StartWorkerAgentThread, Initializes LaunchManager, and attempts to ConnectToStackControlCOMServer:

COM exception System.InvalidCastException: Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Citrix.StackControlService.StackControl’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{BEE5F9CD-A777-47C7-BA5A-CDD82FFEC4D8}’ failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

This is caused either by a missing StackController type library, or by incorrect registry entries relating to the same.

I had to check the below settings

  • Make sure that under HKCR\Interface\{BEE5F9CD-A777-47C7-BA5A-CDD82FFEC4D8}\TypeLib, (Default) is set to {9A0B1570-B01D-4196-BDC9-4CE132108BA6}, and the value is accessible.
  • Make sure that under HKCR\TypeLib\{9A0B1570-B01D-4196-BDC9-4CE132108BA6}\1.0\win32, (Default) is set to C:\Program Files\Citrix\ICAService\StackControlInterop.tlb, and the value is accessible.
  • Make sure the file C:\Program Files\Citrix\ICAService\StackControlInterop.tlb exists, and is accessible.
  • If under HKCR\TypeLib\{9A0B1570-B01D-4196-BDC9-4CE132108BA6}\1.0 a value win64 exists, delete it.


p>For me, last point did the trick (i.e deleting win64 key).

I had hard time finding a fix for the issue, there were not much of documentation from citrix and not users using it.

Hope this helps someone 🙂