How to Fix unexpected disconnects with Citrix Receiver Mac OSX

We were receiving complaints from several users that they would lose the connection to their published applications when working on their Mac OS X devices. When working on these devices their published applications would suddenly be disconnected.  The users would receive the following message:error: cannot connect to server

While investigating the issue and some Googling by my colleague Patrick de Ritter we found that we where not alone. Beside the small note Dan Brinkman already wrote about this issue there is also a nice thread about the issue on the Citrix Discussions forum.  To clarify this issue I decided to write an article on how to fix unexpected disconnects with Citrix Receiver for Mac OSX.

The issue the users are experiencing seemed to be caused by a new feature in OSX 10.9 called App Nap. It is a sort hibernation mode for applications and causes the above described effect for users. To prevent this from happening we took the following steps:

  • Select the check box at Prevent App Nap check box to prevent the application from hibernating.
    Receiver 1
    Because the Citrix Receiver only handles the connection to StoreFront, you’ll also need to set this for the Citrix Viewer (previously known as the XenApp Viewer).
  • Use Command + I (or right-click the app, then click Get Info) to open the Get Info window.Applications Citrix receiver info
  • Open the Applications folder and find the Citrix Receiver.
    screenshot4
  • To do this, right-click the Citrix Receiver app and select Show Package Contents. Navigate to the Helpers folder, under the Contents folder, and use Command + I (or right-click the app, then click Get Info) to open the Get Info window for Citrix Viewer.screenshot4
  • Again, select the check box at Prevent App Nap to prevent the application from hibernating. After the user logs on again (because of the services running in the background), the application will never hibernate again for this user. That’s right, these settings are for the logged in user only.Receiver 2
  • Besides changing the settings through the GUI it is also possible to create a script. This script can be started by the user and needs to run in the users context and is case sensitive:

defaults write com.citrix.Receiver.nomas NSAppSleepDisabled –bool TRUE

defaults write com.citrix.XenAppViewer NSAppSleepDisabled –bool TRUE

After the settings have been changed the user won’t experience disconnected sessions, caused by a hibernating application anymore. Remember the user needs to re-login before the changed settings will be effective

Please note: We tested this against Apple OS X 10.9

10 Replies to “How to Fix unexpected disconnects with Citrix Receiver Mac OSX”

  1. Hi!
    Did you have the opportunity to validate if this fix still works in Mac OS X 10.10 Yosemite? I don’t have a Mac myself, and I’m trying to help a Yosemite user who gets the exact symptoms you describe above. I have read that in Yosemite, the “Prevent App Nap” checkbox has been removed; does the command line stil work?

  2. Really this post saved my day. I have been suffering with citrix viewer disconnecting after couple of hrs on Mac. After OS X Yosemite i saw this weird behavior.

    Thank you sooooooo much for this. I simply checked the options that you mentioned in the article, and restarted the mac, thats it, It did a miracle

  3. Hi, when I try to use the command line to disable App Nap, it only works for the Viewer, not the Citrix Receiver. I get the error message “Unexpected argument TRUE; leaving defaults unchanged.” Any advice? I am not familiar with using these commands.
    (I can’t do it through the info page because the check box disappeared after the last citrix viewer update and I can’t get it back)

    • Hi Marie,

      I have only tested this on an earlier version of the Citrix receiver which includes both the viewer and more classic functionality. If the issue still exists in the curent releases of MACos than this should solve the problem. To verify ?; what version of MACos en what version receiver are you using?

  4. Great tip! Unfortunately App Nap feature doesn’t exists in Receiver 12.1.00 (latest version), so I’ve had to downgrade to 11.8.2.

    • I don’t know. The receiver version I tested was version 11.8.x. Not sure if this is still valid. Haven’t worked on a Mac for some time now. If the setting still exists on you’re mac please test and let me know.

Leave a Reply

Your email address will not be published. Required fields are marked *

*