Caffeine for Citrix Receiver!

Update: Caffeine 1.2 has been posted to include support for receiver 4.2 and above.

In this post I’m announcing a new little tool from my lab for managing power saving and screen saver settings while using the Citrix Receiver for windows. I’ve been using this tool for months, I love it and miss it when I use a workstation without this tool. I’ve also sent this out for feedback to a select few experts in the VDI market space and the feedback was very positive.

That being said, this tool will be welcomed by some (users) and hated by others (admins). I’m a bit torn about whether to publish it or not so if you want to add to the feedback drop me an email on

A big thanks to Mike Stanley, Kees Baggerman, Simon Pettit & Dan Garcia for the feedback!

Caffeine will also be available in the next release of ThinKiosk.

The Mission statement:

Often when using the XenApp, XenDesktop or even Citrix VDI in a Box, double prompting for passwords from windows devices is both common and a pain in the backside.  When you’re local workstation locks out you need to re input your workstation password, then re input your password again in the remote session… irritating and unnecessary.

From a security perspective its necessary to configure a secure screensaver on their desktop in the datacenter to ensure any connecting device receives a password prompt when the user is idle a certain amount of time, but it can be a management nightmare to exclude users from receiving double password prompts from managed windows devices.

Removing the double password scenario:

This issue extends from desktops, to laptops and to thin clients too and it often bugged me how often I spent entering my password twice each day.

With Caffeine for receiver, you  install a lightweight application that runs in the system tray. This application automatically attaches to Receiver sessions (via the ICA Client Object) and sends a keep alive every minute to ensure the remote screen saver never kicks in. Leaving just the local secure screensaver to lock the users out.

This works really well from Enterprise devices with double screensavers or home devices that are secure by default. This also allows you to keep your secure screensaver policies on the datacenter side and work around them from managed devices.

Sleep settings:

As a father, I struggle to find alot of time to work while my son is awake. Often I’ll start working on something and get dragged away for hours only to return to my pc asleep and my remote session disconnected and logged off due to policies. This infuriates me and I disable sleep on most of my devices for this reason… Which is costing me a fortune in electricity!

Further to just screensaving, Caffeine can also be configured to stop computers from going to sleep while a remote session is active. This will keep your pc awake when you are running a remote session if you need to step away but allow it to sleep when you don’t have a remote session… Best of both worlds!

If you still wish to use power saving while on battery, this is still available as above.

Wasted resource?

Well if I’m sending a keep alive from my enterprise device this means the sessions will never reach enough of an idle timeout to satisfy idle timeout policies. Which from an admin perspective mean’s these sessions will never terminate unless the remote machine is restarted.

With Caffeine you can configure these idle time-outs for managed devices via the settings (above) or via GPO meaning you can mirror your idle time-out settings…and dare I say feel confident they’re work reliably for once!

But.. but.. but.. security!!! We can’t have users turning off their secure screensavers!

Well, yes. This is the conflict of interest here, users want it and the admins wont! In order to make Caffeine as secure as possible I’ve included the following options for enterprises:

Caffeine requires administrative permissions to install:

By default only administrators of their local machines will be able to install Caffeine.

Enterprise Kill Pill:

Caffeine has a “Kill Pill” built in, you can download the enterprise GPO to stop Caffeine from working on your devices.

Secure screensaver requirement:

By default caffeine will only work if a secure screensaver is present locally. If the user attempts to remove the screensaver after login, they will be alerted and Caffeine will no longer keep the sessions alive:

Advanced Access Control.

Using Advanced access control with access gateway you can target machines running caffeine and exclude them from using your citrix environment.


The Caffeine for Citrix Receiver beta is now available for download.


  • .Net Framework 2.0
  • Citrix Receiver 3.2 and upwards.

Tested Platforms:

  • Windows 7 x64
  • Windows 8.1 x64



Caffeine for Citrix Receiver

Group Policy Template

Related Posts

While using the ShareFile mobile applications, NTF... Here's a weird little bug I caught in the wild while deploying XenMobile Enterprise. While browsing NTFS shares, published as connectors in the ShareF...
UnSticking an AppDisk provisioning task in XenDesk... Here's a wee little bug I've no idea how i created, but managed to clear it out anyway. After creating an AppDisk, it got a little stuck. I tried d...
Cannot Log into XenMobile 10.3 Appliance after ini... Here's a horrendous bug I just came across in the field today while deploying a XenMobile 10.3 Proof...

26 Comments About “Caffeine for Citrix Receiver!

  1. SL

    Hi. I’m trying to install Caffeine, I keep on getting a message saying that the windows installer could not find the cab files in a zip file in the temp folder. I’ve even manually saved the zip file in the temp folder but to no avail. I am logged in as administrator using windows 7 64. Are there any solutions to this? Much thanks

  2. SL

    Nevermind…the problem was that I was trying to run the windows installer from inside the zip file. Extracting the contents of the zip file to the desktop seemed to do the trick. I, too, have little ones and it would be nice to have my citrix not sleep! Much thanks!

  3. Arno

    Im getting allot of exceptions on Windows 8 64bits. Last time a repair fixed it but I repaired .net, repaired the program nothing seems to work. Any healthy tips? :p

    Here’s the error:

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.OverflowException: Value was either too large or too small for a UInt32.
    at System.Convert.ToUInt32(Int32 value)
    at Caffeine.lastinput.GetIdletime()
    at Caffeine.Tray_Main.tmrCheckSessions_Tick(Object sender, EventArgs e)
    at System.Windows.Forms.Timer.OnTick(EventArgs e)
    at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    ************** Loaded Assemblies **************
    Assembly Version:
    Win32 Version: 2.0.50727.6400 (Win8RTMGDR.050727-6400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Program%20Files%20(x86)/
    Assembly Version:
    Win32 Version: 8.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/
    Assembly Version:
    Win32 Version: 2.0.50727.6400 (Win8RTMGDR.050727-6400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/
    Assembly Version:
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/
    Assembly Version:
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/
    Assembly Version:
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/
    Assembly Version:
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/
    Assembly Version:
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Program%20Files%20(x86)/
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Program%20Files%20(x86)/
    Assembly Version:
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_32/System.Web/

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the section.
    The application must also be compiled with debugging

    For example:

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.

      1. Arno

        Another users has logging in on my machine the past couple of days and for some reason Caffiene started to work again.
        Great app btw thanks for the hard work.

        If there is any way I could help debug this .net problem let me know!
        And if my error returns ill try get u some more info instead of this lousy details pane. ;)


  4. Joseph Yim

    I use your Caffeine to keep my office connection all the time and thanks for the great work! However, I found that the Caffeine will cause some strange character in my putty session in remote desktop, do you have any idea?

    1. Andrew Morgan

      Caffeine uses an unused Microsoft keyboard key to submit the keep alive. Putty seems to like this keystroke.

      It’s a keystroke or a mouse movement. Maybe a mouse movement would be more appropriate in your case ill work on it.


      1. yimkc

        Thanks for your quick reply.
        On the other hand, Caffeine does not work on Win 8.1 preview as the .NET 2.0 is no longer bundled. Not sure if my finding is correct.

  5. Mike J.

    Hi Andrew, I’m having a similar issue with putty where it keeps sending a “~” keystore while I’m doing my work and this is causing problems. Are you able to provide an fix to this issue please? We would really appreciate it.


  6. Pingback: Desktop-Sperrung in ICA-Sitzungen vermeiden | Markus Otten

  7. Jeroen Cuijon

    Hi Andrew,

    When trying to uninstall i get the following error:

    Could not open key:
    Verify that you have sufficient access to that key, or contact your support personnel.

    Using Windows 8.1 Professional with the latest updates.

    Hope you can help.
    Thanks in advance

    1. Jeroen Cuijon

      An update on the problem.
      After trying to uninstall the software(and receiving the error) Internet Explorer fails to start.
      I have to reset Internet Explorer in order to get it working again.

      Hope this helps.

      Thanks in advance

  8. andyjmorgan Post author

    Hi there,

    in Regeditm Browse down to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products

    search for “Caffeine for Receiver”, delete the keys belonging to it.

    I’m currently updating the installer to fix this issue.

  9. Pingback: Caffeine für Citrix Receiver | Meine kleine Farm - Ein Citrix Blog

  10. Pete

    Hey Andy, thanks for this software! Unfortunately, after my upgrade to Windows 10, it no longer seems to work – I’m guessing there’s an issue with the .NET software that needs to be included?

  11. Pete

    Hi again Andy, just checking in to see if .you had time to check this out? Is it something on my end, or an actual issue?

    If it is on my end, are there specific requirements I’m likely missing? .NET frameworks, etc…

    Thanks again!

  12. Anjan Sharma

    Hi Andy, it seems I’m facing the same problem in putty some other users have already reported before me. I use a command line tool in putty which periodically closes as if someone is pressing the Escape key which is the only way to close the tool. My guess is Caffeine is sending the ESC key every now and then.

    Can you please fix this? I reckon a slight mouse movement every 5 mins or so would be a better way to keep the session alive than assuming some key is not required by the user.

    1. andyjmorgan Post author

      Hi Anjan,

      It sends a custom key (windows media) every 60 seconds. Moving the mouse is tricky, as you’re not always on the window, nor do you know where the mouse is!

      I’ll be upgrading the application this year, but not in q1/q2.




Leave a Reply