Caffeine for Citrix Receiver!

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 andrew@andrewmorgan.ie.

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.

Availability:



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

Pre-Requisits:

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

Tested Platforms:

  • Windows 7 x64

 

Download:



Caffeine for Citrix Receiver

Group Policy Template











  1. SL
    November 6, 2012 at 1:54 am

    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
    November 6, 2012 at 2:00 am

    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. Audun Levin
    March 14, 2013 at 1:11 pm

    When I launch caffeine, it says “error invoking reciever”. I use reciever 3.4.

    • March 15, 2013 at 5:41 pm

      It works fine on 3.4 here, are you sure you have receiver enterprise installed?

  4. Arno
    March 18, 2013 at 9:24 am

    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 **************
    mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.6400 (Win8RTMGDR.050727-6400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    —————————————-
    Caffeine
    Assembly Version: 1.1.1.0
    Win32 Version: 1.1.1.0
    CodeBase: file:///C:/Program%20Files%20(x86)/andrewmorgan.ie/Caffeine%20for%20Receiver/Caffeine.exe
    —————————————-
    Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    —————————————-
    System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.6400 (Win8RTMGDR.050727-6400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    —————————————-
    System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    —————————————-
    System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    —————————————-
    System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    —————————————-
    System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    —————————————-
    System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    —————————————-
    ICAKeepAlive
    Assembly Version: 1.1.1.0
    Win32 Version: 1.1.1.0
    CodeBase: file:///C:/Program%20Files%20(x86)/andrewmorgan.ie/Caffeine%20for%20Receiver/ICAKeepAlive.DLL
    —————————————-
    Interop.WFICALib
    Assembly Version: 2.8.0.0
    Win32 Version: 2.8.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/andrewmorgan.ie/Caffeine%20for%20Receiver/Interop.WFICALib.DLL
    —————————————-
    System.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.6387 (Win8RTM.050727-6300)
    CodeBase: file:///C:/Windows/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
    —————————————-

    ************** 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 system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    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.

    • March 19, 2013 at 5:06 pm

      I’ve not tested windows 8 yet. Ill do so and come back to you.

      • Arno
        March 22, 2013 at 2:22 pm

        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. 😉

        Regards

      • March 22, 2013 at 6:55 pm

        Hi Arno, thanks for the feedback. Ill get back to caffeine in a few weeks. I’m flat out with thinkiosk.

  5. Michael Zehnpfennig
    April 11, 2013 at 11:25 pm

    Works great for me on my old Win XP station. Thanks for the great application!

  6. July 23, 2013 at 6:16 pm

    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?

    • July 24, 2013 at 8:17 am

      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.

      A

      • July 24, 2013 at 8:25 am

        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.

      • August 4, 2013 at 8:39 am

        I’ll update it to .net 4 shortly

  7. Mike J.
    March 15, 2014 at 11:40 pm

    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.

    Thanks
    MJ

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s