Since early 2020 there has been massive growth in the number of active Teams users and organizations deploying Teams, to now more than 200 million monthly active users across the globe.
With the increase of market share, it’s one of those applications that either you expect an organization to already be using or planning to deploy out to their environment sooner rather than later. This means that a lot of existing and also new Citrix Virtual Apps and Desktops Deployments are under scope for Teams deployment and consumption.
Multimedia processing however can quickly send the end user experience south. Play a simple video on any device and you will notice that CPU first and foremost takes a hit, but times that by multiple users at once across shared Hypervisors and you can start to imagine the impact it may have on your Citrix deployments and the end user experience.
Given that many people are working from home and therefore using Teams to host one-to-one or multi-party calls, we need to make sure that the video and audio quality delivered via Teams is great and VDI or Session Based users do not take a performance hit whenever audio and/or video calls are taking place.
To help achieve that, we can use HDX Optimization for Teams, jointly developed by both Citrix and Microsoft, to offload media processing to the endpoint itself.
- Overview of how it works
- HDX Optimization for Teams diagram and call flow
- Considerations, Known Issues, and Limitations
- Endpoint software requirements
- Endpoint hardware requirements
- Thin Clients
- Citrix VDA software requirements
- Citrix VDA hardware requirements
- Network requirements
- Network latency recommendations
- Split tunneling
- Firewall requirements
- Headset / Handset device requirements and Recommendations
- Antivirus requirements
- Profile management requirements
- Installation of Teams on VDA
- If Teams was already installed
- Update of Teams on VDA
- Uninstalling Teams
- Post install OS and Profile pieces
- Citrix Policy
- Confirming Teams optimization
- HDX Optimization for Teams in Action
- Proxy servers and DNS
- Disabling GPU hardware acceleration
- Controlling Teams first run
- Controlling automatic run of Teams
- Windows Firewall
- Current Release versus LTSR
- Screen Sharing
- Troubleshooting HDX Optimization for Teams
- Check Teams is optimized
- Check status of services
- Using HDX Monitor
- Logs
- Basic troubleshooting steps
- Known Limitations
- Misc. links
Overview of how it works
Generic delivery of Teams
If you are familiar with delivering Skype for Business using the HDX RealTime Optimization pack, you’ll be aware of the term Generic delivery. With generic delivery of Teams, the video and audio traffic “hairpins” from the user endpoint to the Citrix VDA and back to the endpoint, which degrades video and audio quality whilst placing high resource consumption load on the VDAs themselves.
Optimized delivery of Teams
HDX Optimization for Teams allows you to deliver 720p high-definition video calls at 30fps through your Virtual Apps and Desktops solution. This is made possible using the WebRTC media stack.
The optimized solution can be thought of as splitting the Teams client in two, with the user interface living inside of the VDA and the media rendering/engine running on the endpoint. This shifts resource consumption to the endpoint, reducing impact on your VDAs, and shapes the Teams audio and video traffic in a much more optimized fashion because now media traffic flows point-to-point between clients or the Teams conferencing service in Microsoft 365.
Other advantages of optimized Teams delivery:
- Local peripherals such as your webcam and microphone will be automatically redirected into Teams.
- Less HDX traffic will be consumed due to the way traffic is shaped with the optimized approach.
- The solution is supported by both Microsoft and Citrix.
- There is no modification needed to the Teams back-end, or any additional software pieces required to be installed on the VDA or endpoint, which is an improvement over the Skype for Business RealTime Optimization Pack.
- Screen sharing is also possible and mentioned further in detail under section Screen Sharing.
HDX Optimization for Teams diagram and call flow
- User launches Microsoft Teams.
- Teams authenticates to Microsoft 365 and tenant policies get pushed down to the Teams client.
- Relevant TURN and signalling channel information is relayed to the Teams app.
- Teams detects that it is running on a VDA and makes API calls to the Citrix JavaScript API.
- The Citrix JavaScript in Teams opens a secure WebSocket connection to WebSocketService.exe running on the VDA. WebSocketService.exe runs as a Local System account and listens on 127.0.0.1:9002.
- WebSocketService.exe performs TLS termination, user session mapping, and spawns WebSocketAgent.exe which now runs inside the user session.
- WebSocketAgent.exe initiates a generic virtual channel by calling into the Citrix HDX Browser Redirection Service (CtxSvcHost.exe).
- Citrix Workspace app’s HDX Engine, wfica32.exe, spawns a new process called HdxRtcEngine.exe (or HDXTeams.exe before Workspace app 2009.6) which is the new WebRTC engine used for Teams optimization.
- HdxRtcEngine.exe and Teams.exe have a 2-way virtual channel path and can start processing multimedia requests.
- User A clicks to call User B. Teams.exe communicates with the Teams services in Azure to establish an end-to-end signalling path with User B.
- Teams on the VDA asks HdxTeams (HdxRtcEngine) for a series of supporting call parameters such as codecs and resolutions, which is known as the Session Description Protocol (SDP) offer. These call parameters are than sent, using the established signalling path, to the Teams services in Azure and from there on to User B.
- The SDP offer/answer and Interactive Connectivity Establishment (ICE) connectivity checks complete.
- ICE connectivity checks (NAT and firewall traversal) complete using Session Traversal Utilities for NAT (STUN).
- Secure Real-time Transport Protocol (SRTP) media flows between HdxRtcEngine.exe and User B.
- If it is a meeting, SRTP media flows between HdxRtcEngine.exe and the Microsoft 365 conference servers.
Considerations, Known Issues, and Limitations
The advantages of being able to offload media to the endpoint and run Teams on VDI or Session Based VMs comes with some things you need to be aware of. Namely, there may be features and functionality available in Teams that are limited in a virtualized environment, which isn’t specific to Citrix deployments as such, but simply desktop and server virtualization as a whole.
There are also some known issues and limitations affecting Teams when deployed to VDI environments. Some examples are below, as of August 2021:
- With Teams running on a Citrix session, if the user disconnects and then reconnects, Teams may be in a non-optimized state. It is recommended that users quit out of Teams before they disconnect from Citrix to avoid this from happening.
- You could also help prevent this by logging off disconnected sessions after a period of time.
- Incoming and outgoing video stream resolution is limited to 720p.
- Application screen sharing is not supported.
- Only one video stream for incoming camera or screen share stream is supported. As such, when there is an incoming screen share, that screen share is shown instead of the video of the dominant speaker.
- High DPI scaling is not supported.
Note that multi-monitor screen sharing was previously limited in that only the main monitor could be shared. This meant that if you wanted to share the contents of an application screen, you would have had to drag the app to your primary monitor. Now with Workspace app 2106 or newer for Windows, Mac, and Linux, you can select the monitor you want to share if the Workspace app Desktop Viewer is in full-screen mode and spanned across all your monitors.
If Desktop Viewer is disabled or you are using Desktop Lock, you cannot select which monitor to share.
Endpoint software requirements
- Citrix Workspace app 1907 for Windows or newer.
- Citrix Workspace app 1912 LTSR CU5 for Windows contains Teams enhancements.
- Citrix Workspace app 2012 for Mac or newer.
- Citrix Workspace app 2006 for Linux or newer.
- Citrix Workspace app 2105.5 for ChromeOS.
- Screen sharing optimization (incoming and outgoing) is disabled by default but can be enabled by referring to Citrix documentation.
- Windows 7, 8, 10 32-bit or 64-bit, including Windows Embedded editions.
Endpoint hardware requirements
- 1GB RAM and 600MB disk space to run Workspace app.
- Quad core CPU running at 1.8-2.0 GHz for 720p HD resolution.
- Quad core CPU with 1.5 GHz or lower speeds that is equipped with Intel Turbo Boost or AMD Turbo Core that can boost GHz up to 2.4 are also supported.
Thin Clients
According to Citrix, the following Thin Clients have been verified:
- HP: t630/t640, t730/t740, mt44/mt45.
- Dell: 5070, 5470 Mobile TC.
- 10ZiG: 4510 and 5810q.
See the Citrix Ready Marketplace for a full list of verified endpoints.
Citrix VDA software requirements
- Microsoft Teams 1.3.00.4461 or newer.
- VDA 1906.2 or newer.
- Windows 10 1607 64-bit and higher.
- Server 2012 R2, 2016, or 2019, 2022 Standard and Datacentre editions.
Citrix VDA hardware requirements
- 2 vCPU for Desktop OS (VDI).
- 4, 6, or 8 vCPU for Server OS (SBC) keeping in-line with the underlying NUMA configuration of your Hypervisor host.
- 4GB RAM for Desktop OS (VDI).
- 512 to 1024MB RAM per user for Server OS (SBC).
- 8GB HDD space for Desktop OS (VDI).
- 40 to 60GB HDD space for Server OS (SBC).
Network requirements
Some recommendations/requirements below:
- Ensure endpoints can resolve DNS queries to discover the TURN/STUN services provided by Microsoft 365 and that firewalls do not prevent access.
- Bypass proxy servers.
- Avoid VPN hairpins.
- Bypass network SSL intercept and deep packet inspection services.
- From the branch office, route to the Microsoft 365 network as direct as possible.
See here for a full list of things you should do to ensure that your network is ready for Microsoft Teams.
Additionally, run the Skype for Business Network Assessment Tool to determine if your network is ready for Teams.
Also see Implement QOS in Microsoft Teams.
Network latency recommendations
The following network performance characteristics are recommended by Citrix to ensure a great user experience with Teams.
- One way latency – < 50ms.
- RTT latency – < 100ms.
- < 1% packet loss during any 15 second interval.
- < 30ms packet interarrival jitter during any 15 second interval.
Split tunneling
Routing traffic outside of the VPN tunnel for key Microsoft 365 services such as Exchange Online, SharePoint Online, and Microsoft Teams is recommended. This will reduce the amount of traffic the VPN has to handle and provide users with the best performance possible against the Microsoft 365 services they use.
You should configure IPv4 and IPv6 ranges to be routed outside of the tunnel. You can read more here.
Firewall requirements
- Teams will use UDP 1024-65535 high ports for optimized traffic for peer-to-peer connections if there is nothing blocking them.
- Otherwise, Teams uses Transport Relay on UDP 3478-3481 or TCP 443 as fallback.
Allow access to the following address ranges:
- 13.107.64.0/18
- 52.112.0.0/14
- 52.120.0.0/14
Headset / Handset device requirements and Recommendations
- Skype for Business supported devices: https://docs.microsoft.com/en-us/skypeforbusiness/certification/devices-usb-devices
- Microsoft Teams supported devices: https://products.office.com/en-us/microsoft-teams/across-devices/devices
- iPhone headsets are not supported by Teams.
- It is a recommendation to use Microsoft Teams certified headsets that include built-in echo cancellation, and certified cameras.
- If you are using external speakers, place them as far as possible from your microphone to avoid any echo.
Antivirus requirements
Exclude the following processes from on-access type scanning from your antivirus provider:
- %LocalAppData%\Microsoft\Teams\current\teams.exe
- %LocalAppData%\Microsoft\Teams\update.exe
- %LocalAppData%\Microsoft\Teams\stage\squirrel.exe
Profile management requirements
For non-persistent deployments, you will need to use a solution like FSLogix to ensure that the appropriate Teams data stored in the user profile is persisted. Profile inclusion and exclusion recommendations are listed below.
Profile management inclusion
- %LocalAppData%\Microsoft\IdentityCache
- %AppData%\Microsoft\Teams
Profile management exclusion
- .txt files from location %AppData%\Microsoft\Teams
- %AppData%\Microsoft\Teams\media-stack
- %AppData%\Microsoft\Teams\Cache
- %AppData%\Microsoft\Teams\GPUCache
- %AppData%\Microsoft\Teams\meeting-addin\Cache
- %AppData%\Microsoft\Teams\Service Worker\CacheStorage
Installation of Teams on VDA
It is preferred to install Teams after installing the VDA software. You should also install Teams using the machine-wide installer (per-machine installation) and appropriate switches, rather than using the per-user installation which won’t work well on a non-persistent setup. Per-machine installation suitable for most VDI deployments.
- For persistent VDI: You can use the ALLUSERS=1 switch.
- For non-persistent desktops: It is recommended to disable auto-update by additionally using the ALLUSER=1 switch.
Full command example for non-persistent desktops:
msiexec /i <path-to-msi> ALLUSER=1 ALLUSERS=1
Full (optional) command example for persistent desktops:
msiexec /i <path-to-msi> ALLUSERS=1
With the machine-wide installer, Teams will be installed under C:\Program Files (x86) instead of in the %AppData% directory of the user profile.
App Layering
Since with App Layering you will be installing Teams without the VDA present, you can create the following registry key on the Teams layer:
- HKLM\SOFTWARE\WOW6432Node\Citrix\PortICA (for 32-bit Teams)
- HKLM\SOFTWARE\Citrix\PortICA (for 64-bit Teams)
You should technically also be able to use a Platform layer for packaging.
If Teams was already installed
- If the user has already installed Teams using the EXE, have the user uninstall it using Add/Remove Programs.
- If an administrator installed Teams using the MSI, uninstall it using Add/Remove programs and get each user to log in to complete the uninstall from their profile.
- If an administrator installed Teams using Office Pro Plus media, uninstall it using Add/Remove programs and get each user to log in to complete the uninstall from their profile.
Update of Teams on VDA
To update the per-machine based version of Teams, you simply uninstall the currently installed version in your master image and then install the new version using the command line and switched mentioned above.
You can use the following command to uninstall:
msiexec /passive /x <path-to-msi>
As there are frequent updates to Teams, up to a couple per month, you will want to keep on top of this process right and regularly. Visit the What’s new in Microsoft Teams page for a list of new features and functionality.
Uninstalling Teams
If you uninstall Teams:
- Teams shortcut is removed from C:\Users\Public\Desktop.
- Teams shortcut is removed from %ProgramData%\Microsoft\Windows\Start Menu\Programs.
- Teams string is removed from HKLM\SOTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run.
- Teams data (per-machine) is removed from C:\Program Files (x86).
- Teams data is not removed from any user profile under %AppData%\Microsoft\Teams, as that data prevents the first-time setup from running again if a user logs on to other machines that has the machine-wide installer.
Post install OS and Profile pieces
Once the per-machine based version of Teams has been installed, the following files, folders, and registry entries are present:
- Directory: C:\Program Files (x86)\Teams.
- This directory contains the setup.json and Teams.exe files.
- Registry: A TeamsMachineInstaller string with value %ProgramFiles%\Teams Installer\Teams.exe –checkinstall –source=default under HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run.
- File: A desktop shortcut to C:\Program Files\Microsoft\Teams\current\Teams.exe is created under C:\Users\Public\Desktop.
- File: A Start menu shortcut to C:\Program Files\Microsoft\Teams\current\Teams.exe is created under C:\ProgramData\Microsoft\Windows\Start Menu\Programs.
For anyone who then logs on to the machine, Teams starts automatically, and after the user authenticates to Teams, installs into the user profile for the first time under %AppData%\Microsoft\Teams. From my observation this will consume 500~ MB.
During this initial installation period, RAM and CPU spike. On my test machine RAM reached 800 MB and CPU reached 100% for 20-30 seconds roughly. As such, you may want to control a mass rollout of Teams by removing the Run string created under HKLM, and instead create one under HKCU for each user in a more controlled manner, or have users manually launch Teams, for example. Solid communication out to end-users in advance can help.
Citrix Policy
There is a required Citrix Policy named Microsoft Teams redirection which is set to Allowed by default.
Confirming Teams optimization
You can check the Teams UI, by clicking About > Version and confirming that the Citrix HDX Optimised legend displays.
Also, once HDX confirms that the Microsoft Teams redirection policy is allowed and Workspace app is version 1907 or above, it sets a DWORD on the VDA to 1. The MSTeamsRedirSupport DWORD will be set to 1 under HKCU\SOFTWARE\Citrix\HDXMediaStream.
On the endpoint runs HdxRtcEngine.exe, which confirms Teams is running in optimized mode.
On the VDA runs WebSocketAgent.exe, which confirms Teams is running in optimized mode. WebSocketAgent.exe is spawned by WebSocketService.exe, which performs TLS termination and user session mapping.
Additionally, peripherals such as your headset and camera will be obtained by the WebRTC media engine of Workspace app and passed through to Teams (Teams does not access peripherals directly). Peripherals will show like below with Teams is optimized within a Citrix environment.
If Microsoft Teams is not optimized, you will likely see references to Citrix HDX like below, and higher resource consumption will be placed on your VDAs.
HDX Optimization for Teams in Action
The picture below is the resource consumption on a VDA during a Teams audio and video call that is unoptimized. CPU was averaging about 30% and the Send / Receive throughput over 1 Mbps.
To demonstrate the difference in resource consumption, the below picture is after the Teams call was ended. CPU and network throughput drops as expected to low levels.
The final picture below is the same VDA participating in an audio and video call that is this time optimized. Comparing this to the unoptimized scenario, network throughput is much lower, and CPU was averaging no more than 10% due to the audio and video processing being offloaded to the endpoint.
It is also worth noting that the audio quality was much better and a lot of the quieter sounds such as mouse clicks were being picked up on the call as a result of the audio being clearer.
Proxy servers and DNS
Proxy
Whilst Proxy servers will typically be configured on VDAs, you must make sure they do not impact the operations of Teams and HDX Optimization for Teams.
To do this, make sure that the Bypass proxy servers for local address setting in Internet options > Connections > LAN settings > Proxy server and make sure that 127.0.0.1:9002 is bypassed.
If you use a PAC file, the PAC file must return DIRECT for wss://127.0.0.1:9002 otherwise optimization will fail.
For corporate devices that also need to route through a proxy when accessing internet resources, the following versions of Workspace app support proxy servers:
- Workspace app 2012 for Windows.
- Negotiate/Kerberos, NTLM, Basic, and Digest.
- PAC files supported.
- Workspace app 1912 LTSR CU5 for Windows.
- Negotiate/Kerberos, NTLM, Basic, and Digest.
- PAC files supported.
- Workspace app 2101 for Linux.
- Anonymous authentication/
- Workspace app 2104 for Mac.
- Anonymous authentication.
DNS
Endpoint clients must be able to resolve the following Microsoft Teams TURN FQDNs:
- worldaz.turn.teams.microsoft.com
- usaz.turn.teams.microsoft.com
- euaz.turn.teams.microsoft.com
Disabling GPU hardware acceleration
Does your underlying hosts have dedicated GPUs? If not, then you should disable GPU hardware acceleration within Teams so that the Teams UI and animations do not attempt to be rendered using GPU emulation which impacts on the CPU.
The problem with doing this for multiple users is that due to how Teams has been developed, there are currently no Group Policy settings or simple registry tweaks we can make to turn this off for all or some users. Instead, we need to manipulate a file called desktop-config.json which is stored in the user profile under %AppData%\Microsoft\Teams. The disablement would then take effect the next time Teams is launched.
If I were to manually browse to Settings within the Teams UI and check Disable GPU hardware acceleration, the disableGpu setting under the appPreferenceSettings section changes from false to true.
To automate disabling GPU hardware acceleration, firstly there are different ways you could do this but to show one example I will use Group Policy to run a PowerShell script on user logon. The script itself was garnered from Citrix Discussions – Powershell command that can be used to disable GPU in Teams Settings and modified slightly.
if (!(Test-Path $env:AppData\Microsoft\Teams\desktop-config.json)) {Exit}
$JSONFile = $env:AppData+"\Microsoft\Teams\desktop-config.json"
$User = $env:USERDOMAIN+'\'+$env:USERNAME
$JSON = Get-Content $JSONFile | ConvertFrom-Json
if
($JSON.appPreferenceSettings.disableGpu -eq $False) {
Get-Process -Name 'Teams' -IncludeUserName -ErrorAction SilentlyContinue | Where-Object UserName -eq $User | Stop-Process -Force
$JSON.appPreferenceSettings.disableGpu = $True
$JSON | ConvertTo-Json | Out-File $JSONFile -Encoding ASCII
& "C:\Program Files (x86)\Microsoft\Teams\current\Teams.exe" }
You can then attach the script to a Group Policy Object so that is runs at user login.
The below screenshot confirms that GPU hardware acceleration has been disabled without manual intervention.
Controlling Teams first run
Whenever Teams runs for the first time and user sign in occurs, CPU spikes to high levels and RAM in my testing spikes to around 800 MB before dropping down to just below 500 MB.
Obviously for physical desktop deployments this is fine, but a mass rollout of Teams to VDI or SBC workloads should have some consideration as to how and when this rolls out, otherwise you will quickly hit performance issues.
Again, like controlling the GPU hardware acceleration setting, there are different ways to do this. One of the simplest ways is by performing at least two actions initially:
- Delete the Teams run string on each VDA from HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run
- Create an HKCU based run key that has the following data set: C:\Program Files (x86)\Microsoft\Teams\current\Teams.exe –process-start-args “–system-initiated“
With the creation of the HKCU run string, you can be tactical in how you want to deploy it to end-users using Group Policy Preferences or Workspace Environment Management for example.
Once you are comfortable that Teams has been delivered and configured to most or all of your users, and you want Teams to auto launch when users log in, don’t forget to re-create the HKLM run string to use going forward, and remove the HKCU based string for good measure.
Note on Citrix Workspace app
Since there are minimum Workspace app versions required for Teams optimization, it is important to make sure that all your clients are updated to the minimum levels before end-users can use Teams via Citrix Virtual Apps and Desktops. If not, media processing will fall back to the VDA and impact your compute resources.
This can be challenging for almost all environments since they allow access to resources from personal devices which often run older versions of Workspace app. To account for the challenges there are a couple of things you could think of doing, such as:
- Using Citrix Gateway expressions to block certain Workspace app versions.
- Having a set of external desktops for users who cannot meet the requirements, and those desktops do not have Microsoft Teams installed, or users use the Teams web app with BCR instead.
- Disable fallback, by implementing one of the following registry DWORD values on the VDA:
- HKLM\SOFTWARE\Microsoft\Teams\DisableFallback
- Set to 0x1 to disable audio and video
- Set to 0x2 to enable audio only
- HKCU\SOFTWARE\Microsoft\Office\Teams\DisableFallback
- Set to 0x1 to disable audio and video
- Set to 0x2 to enable audio only
- HKLM\SOFTWARE\Microsoft\Teams\DisableFallback
Controlling automatic run of Teams
Like controlling the first run of Teams, you may also want to keep Teams from automatically launching at each user logon. This would help combat high compute usage during logon storms to your Citrix Virtual Apps and Desktops environment.
If this is desirable, simply delete the HKLM run string for Teams under HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run and any HKCU equivalent if you created those.
Then, you could leave the Teams shortcut that is created as part of the per-machine based install under C:\Users\Public\Desktop for users to launch when they want to use Teams. Alternatively, you could employ a script that launches Teams for the user after they have logged on for a period of time, if the user has not launched it themselves.
Windows Firewall
When users begin to use Teams optimized for the first time, they may notice a Windows Defender Firewall security alert asking if they want to allow HDX Overlay Teams (HdxTeams.exe or HdxRtcEngine.exe) to communicate on the network. It is important to allow access.
Current Release versus LTSR
If Teams is a critical app for the business and the latest features are a must, or an organisation wants to align Citrix closely with the features available on their physical desktops, organisations may look to adopt Current Release versions of Virtual Apps and Desktops so that any new feature that requires a VDA upgrade is covered.
Not all new features require a VDA upgrade however, so this doesn’t mean that a new Teams feature automatically results in a VDA upgrade for your environment.
Screen Sharing
Incoming screen sharing using HDX Optimization is treated like a video stream, so if the other peer shares their camera and then begins to share their screen, their camera video feed is paused in favour of the sharing video feed. The peer must resume their camera sharing manually afterwards.
Outgoing screen sharing is optimized and offloaded to the endpoint, like video and audio. The media engine captures and transmits the Citrix Desktop Viewer, CDViewer.exe window. If you want to share a local application running on your client machine you can overlay it on the Citrix Desktop Viewer window, and it is also captured.
For multi-monitor sharing, you must run at a minimum Citrix Workspace app 2106 for Windows, Linux, or Mac.
Troubleshooting HDX Optimization for Teams
See here for a list of troubleshooting tips from Citrix.
Check Teams is optimized
When Teams is running optimized, the HdxRtcEngine.exe process runs on the endpoint and the WebSocketAgent.exe process runs on the VDA.
Check status of services
There are a couple of services required to be running on the VDA for successful Teams optimization.
- Citrix HDX Teams Redirection Service: Provides establishment of virtual channel used with Microsoft Teams.
- Citrix HDX HTML5 Video Redirection Service: Responsible for TLS termination of secure WebSockets and spawning the WebSocketAgent.exe process into user sessions when Teams starts. This service also runs as WebSocketService.exe and needs to be listening on 127.0.0.1:9002. You can confirm this using command netstat -anob -p tcp | findstr 9002 on the VDA.
On successful connection, the state turns to ESTABLISHED.
Using HDX Monitor
The latest versions of HDX Monitor allow you to see some information about active Teams calls.
When viewing session information via HDX Monitor, if the Number of connections under Webrtc is set to 0, either Teams has not been launched within the session or has been launched but is not optimized.
When Teams is running optimized, the Number of connections for the session will change to 1.
When a Teams call is in progress, the Virtual channel state will switch from Idle to Active. HDX Monitor will also show you the maximum Kbps outgoing and incoming bandwidth used for the entire HDX session over all Teams calls.
Logs
There are various logs you can turn to when troubleshooting HDX Optimization for Teams.
Client Endpoint (Windows)
- Folder: %LocalAppData%\Temp\HdxRtcEngine
- Contains hdxrtcengine.log and webrpc.log.
Additionally, there are log files stores on Mac and Linux endpoints, and you also have the option of enabling CDF tracing using specific trace providers.
VDA Trace Providers
- HDX_Multimedia_TeamsService
- HDX_Multimedia_WebSocketAgent
- HDX_Multimedia_WebSocketPipe
- HDX_Multimedia_WebSocketService
Endpoint Trace Providers
- IcaClient_Multimedia_HdxRtcEngine_CtlGuid
- IcaClient_DriversVd_TeamsRedir_CtlGuid
Basic troubleshooting steps
- Confirm you are running a compatible version of Workspace app. Refer to the Endpoint software requirements section.
- Confirm that HdxRtcEngine.exe is running on the endpoint and WebSocketAgent.exe is running on the VDA. If not, exit Teams on the VDA.
- Start Teams and check again if the aforementioned processes are running.
- If the processes are still not running or Teams is not optimized, restart the Citrix HDX Teams Redirection Service (if possible) and disconnect from your ICA session, then reconnect.
- If the processes are still not running or Teams is not optimized, completely log off the VDA and back on, or reboot the VDA and/or endpoint.
Known Limitations
The documentation for each Citrix Virtual Apps and Desktops release contains a section containing known limitations that are either Citrix limitations, Microsoft limitations, or both.
The example URL is for Virtual Apps and Desktops 7 2190: https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/multimedia/opt-ms-teams.html#known-limitations
Misc. links
- Supported headsets and handsets: https://products.office.com/en-us/microsoft-teams/across-devices/devices
- Skype for Business supported devices: https://docs.microsoft.com/en-us/skypeforbusiness/certification/devices-usb-devices
- Roadmap for Citrix Virtual Apps and Desktops, which includes some items for Teams: https://www.citrix.com/en-gb/products/citrix-virtual-apps-and-desktops/resources/citrix-virtual-apps-and-desktops-roadmap.html
Need Help Getting Teams to Run in your Citrix Environment?
EUC UK can help. Contact us today by emailing us at info@eucuk.com
Ray Davis
November 1, 2021Good details.
mw
December 16, 2021What are we losing when we optimized the citrix profile ?
Mark Lynch
January 24, 2022A great Article with many useful points that I wish I had seen when I set this up! I’ve bookmarked this for my future reference.
Johannes Nowak
February 15, 2022Is there any way for other softphone / collaboration vendors to use this optimization for their WebRTC implementation?
Andreas
February 18, 2022really great Article with a lot of really useful points an tips,
Many thanks for your work and sharing your knowledge!
Sam
May 25, 2022thank you very much for your detailed blog.
There is actually a MS teams GPO available. We have not tested this extensively but this seems to work ok. Perhaps is something for you to review and add to this blog
“Microsoft Teams
Policy Setting Comment
Prevent Microsoft Teams from starting automatically after installation
“
Sam
May 25, 2022Also, is the registry key “reg add “HKLM\SOFTWARE\Microsoft\Teams” /v IsWVDEnvironment /t REG_DWORD /d 1 /f” required for Citrix VDAs or only MS Azure Virtual Desktop?
Pingback: CVAD Guide to Microsoft Teams | BLOGS