Gosh, cursors are pesky little things!

Until I joined HDX and started researching them, I had no idea how complicated and troublesome a little arrow could be! Citrix XenDesktop and XenApp both involve constructing a desktop on a server and then remoting the pixels of the desktop to an end-client device; that end-client device could be a Windows workstation, a Linux thin client, an iPad or a smartphone. This means there are two potential places a cursor can be added on top of the desktop, 1) on the server or 2) on the client device.

Server-Rendered Cursors

Server-rendered cursors are expensive for virtualised desktops. Every time the user moves their mouse, that message is sent to the server, so the desktop can be redrawn and then the new desktop is sent back to the user. This can generate high-bandwidth and if the desktop is very complex (e.g. a complex CAD model where the application is recalculating the part) this can become a bottleneck. It can also result in a lot of redrawing of transient intermediate frames that are unnecessary, intermittent information that a user doesn’t need e.g. when they are scrolling or moving a window rapidly.

Client-Rendered Cursors

Client-rendered cursors involve the instruction to redraw the mouse being done on the client and simply overlaid upon the “background” desktop.

Recognising A Server-Rendered Cursor

In XenApp, it is very easy to recognise a server-rendered cursor by dragging the mouse to the edge of an application window. If the tail is chopped off then the mouse is server rendered, a client-rendered mouse being overlaid would retain its tail.

Mouse Shadow

One of the newer costly graphical features that has appeared in desktops is mouse shadow. Enabling mouse shadow can in many circumstances force XenDesktop to switch from efficient client cursor rendering to latency prone server-rendered cursors. For optimal bandwidth commensurate to Windows 7 behaviour, we would recommend:

  • Considering the use of Legacy graphics mode
  • a plain desktop without themes
  • ensuring mouse shadow is disabled

Known Issue

Server-rendered cursors are seen most frequently in legacy graphics mode on XenDesktop 7.x and XenDesktop 5.x Standard VDA.

On XenDesktop  5.x, there was logic to avoid this by automatically disabling the mouse shadow allowing cursors to be rendered on the client and not the server. However, this logic regressed on XenDesktop 7.x and Citrix is working to restore that logic. Meanwhile, to manually switch to client-rendered cursors when running in legacy graphics mode, on the VDA run “control mouse” and click the Pointers tab. Change the Scheme to (None) and clear the “Enable pointer shadow” checkbox and click OK

Note: It is also possible to enforce  settings e.g. by a PowerShell script that runs at logon that excludes all Aero based cursors

$excludedCursors = "Windows Aero (extra large)",  `
"Windows Aero (large)",  `
"Windows Aero"



Keeping Desktops Simple Reduces Bandwidth

Back in the good old days when resources were limited, every byte was carefully thought about, but as PCs got more powerful year-on-year developers needed to be less careful and visual prettiness became more of a priority. With the increasing demand for thin clients and low cost end-points and devices, we are in a new world where the devices being used are often becoming less powerful. Operating systems have become more graphical with Microsoft moving from protocols like GDI in Windows 7 to technologies such as DirectX and Aero in Windows 8 and beyond.

Many customers, though, are limited by their legacy infrastructure and hardware, poor bandwidth connections to remote branch offices, etc. If low bandwidth is a priority introducing a corporate branded desktop with optimal bandwidth requirements can offer some performance gains (e.g. mimicking the behaviour of Windows 7 by turning visually intensive Aero themes off and by using plain desktops). It is a lot less work for the operating system to redraw an outlook window on top of a plain desktop than a picture of the user’s cat/baby/favourite holiday spot.

Server Rendered Cursors in CAD Applications

Some CAD applications are written with bespoke controls and cursors in such a way that the application cannot remote the cursor and enable client-rendered cursors. Although this is becoming less common in newer versions, many CAD/3D applications were written for physical workstations and these complex cursors still need to be server-rendered. I’m certainly aware that many Autodesk products force server-rendered cursors.

If it is the case that you experience lagging or sluggish cursors, you should check for high latency or a very busy server not keeping up with the end client. One very successful technique for improving the user experience and reducing bandwidth is to adjust a parameter called MouseTimer on the receiver, this is set by default to 10ms, by increasing it you will increase the interval between mouse messages being send to the server and actually make the user experience smoother. The reduced server load should also increase the frame rate delivered. Typically, our consultants have found that setting this parameter to between 50-120ms usually has good results. Some trial and error is recommended, as users’ subjective view of lag and the specific load of each application varies. You can find details of how to set MouseTimer in the Citrix Receiver documentation, here.

Further Information:

  • Fedi and Gabriel’s post contains case studies of user scenarios upgrading to 7.x versions of XenDesktop and XenApp where the aim is to maintain equivalent bandwidth owing to legacy constraints and contains further information on MouseTimer and the use of Legacy graphics mode:   /blogs/2014/10/22/whats-new-with-hdx-display-in-xendesktop-xenapp-7-x/
  • Lagging or sluggish cursors can be a result of high latency or a very busy server not keeping up with the end client. There are lots of metrics available in Citrix XenCenter, XenServer and XenDesktop Director that can help you identify high CPU or GPU load, storage IOPs and latency (here is a list including many suitable for HDX use) as well as wealth of tools to monitor frame rates and latency such as FRAPS, GPUPerf from Magnar Johnsen and HDX Monitor. Users may also wish to look at the DirectX and OpenGL library usage, as detailed in one of my previous blogs, here.
  • There is a lot of good advice on how we generally recommend HDX is configured with respect to network conditions, for example Citrix Consultant Amit Ben-Chanoch’s blog series. There are a few tweaks you can make to adjust the balance though, these usually aren’t necessary but can be worth trying for the pickiest of users.