Screensaver not working in a XenDesktop VDI environment

Note: This blogpost is also posted on my personal blog – https://itmicah.wordpress.com

I was troubleshooting some RES Workspace Manager (RES WM) issues in a customer’s XenDesktop 7.x (Citrix) environment when I came across the following issue: The screensaver didn’t start automatically, even though I had forced a screensaver through RES WM. After some research I’d come to the conclusion that this was a known issue in XenDesktop 7.x. Apparently Citrix has decided to disable Screensavers and power-save options in XenDesktop. They provide the following solution in their eDocs documentation:

Edit the registry and create the following DWORD value:

HKLM\Software\Citrix\Graphics\SetDisplayRequiredMode = 0

This change does not prevent the remote machine screen saver or power save mode from coming on. If the power save mode comes on, the remote session is not updated until the user provides input (mouse/keyboard), but the screen will not be blanked. [#380550]

I implemented this solution by creating a GPO Preference that set the registry setting, but somehow it wasn’t working for me. Also, applying this fix has the disadvantage that it enables the power-save options as well so you’d have to force the power-save settings through a GPO. Luckily, I found a shortcut to get it all working:

The utility Powercfg.exe provided the way out. You can use this tool to see which process is preventing the powerplan from activating the screensaver, put the PC to sleep etc. In case of XenDesktop it turns out it’s a process called picaDispMgr.exe. We can then use the same tool to override that process’s powerrequests that keeps the screensaver inactive. Here’s how it’s done:

Open an elevated command prompt and run the following command:

powercfg /requestsoverride PROCESS picaDispMgr.exe DISPLAY

That’s all there is to it. You can either run this command using a startup script in RES WM or GPO or you can run it once in your XenDesktop build.