Citrix XenDesktop: Work-around to prevent Virtual Desktops from ‘hanging’ at logoff using RES Workspace Manager

Windows, and in particular Windows XP, is pretty sensitive when it comes to the log off proccess. When you leave applications running and just choose to log off this can sometime result in a hanging computer. In a traditional environment with physical machines this is not directly a problem because the user always has the ability to just push and hold the power button.

Now in a virtualized environment this suddely becomes a problem because power cycling the endpoint has no effect on the virtual desktop.
And beside that it is (unfortunately) more and more common for users to leave applications running in the background and just disconnect the session instead of logging off and let the disconnect and idle timer do the job.

The Citrix Web Interface contains functionality to let users restart their Virtual Desktop. But this is not a real solution for the more common user, especially when using a locked-down endpoint that is using a PNAgent site.

So this problem results in users calling the service desk telling that they cannot log in (because they get connected to the ‘hanging’ virtual desktop). They will discover this the next day when they want to login again. And this happens mainly at peak time causing queues at the service desk because every virtual desktop has to be restarted manually.

Finding and solving the issue(s) that cause a logoff to fail is a very time consuming proces, especially in environments with > 500 applications. So I came up with a simple, yet very effective work-around.

In a XenDesktop environment a virtual desktop communicates with the broker using the ‘WorkstationAgent’ service. When stopping this service the broker marks the virtual desktop as unregistered. Now after 4hr the broker will poweroff the virtual desktop which automatically solves the issue. We can use this information to create a work-around for the ‘haning’ virtual desktop problem.

We have to stop the ‘WorkstationAgent’ service directly after the logoff is initiated. This has to be done very early in the logoff sequence. A great way to trigger this is to make use of the external tasks feature in RES Workspace Manager. In this way we can execute a command line task at logoff.

Stop the ‘DesktopAgent’ service at logoff using an external task

To allow users to stop the ‘WorkstationAgent’ service we have to change the service rights. This is easely done with SetACL from Helge Klein:

SetACL.exe -ot srv -on WorkstationAgent -ace “n:users;p:start_stop,read” -actn ace

That’s it, with this work-around in place you have created some rest for yourself to search for the real cause and solution for the underlying problem!

Advertisement

Windows 8 Shortcut Keys

While playing around with Windows 8, I quickly discovered that many functions are not easily reachable with only a mouse. So I searched for a list of shortcut keys and discovered that there are some pretty handy ones that every Windows 8 user should know of:

Windows+X = list of direct shortcuts including CMD (both admin and non-admin), Windows Explorer, Search, Run, Control Panel and Network Connections
Windows+C = brings up the ‘right swipe’ settings panel
Windows+Q = list of Apps and search function
Windows+W = standard settings
Windows+R  = run box
Windows+T = running apps tiles
Windows+I  = more settings
Windows+P = projector settings (2nd screen, choose output type, etc).
Windows+L = lock session
Windows+K = 2nd screen output
Windows+H = Share
Windows+F = Files
Windows+D = Desktop
Windows+S = launch snipping tool (for OneNote)
Windows+M = Minimize window

Source: http://blogs.technet.com/b/instan/archive/2012/05/01/windows-8-shortcut-keys.aspx

RES Workspace Manager: Creating a zone for a specific Citrix XenDesktop Desktop Group

RES Workspace Manager is a very powerful product especially when making advantage of all the possibilities. Creating a context based workspace using a specific zone is just one example.

Within a Citrix XenDesktop environment you typically create multiple (pooled) desktop groups, each targetting a specific task.
This is for example a great way for creating an acceptance environment beside the production environment where the acceptance environment runs a newer ‘golden image’ before it is mounted to the production environment.

Now when running RES Workspace Manager on top of these environments you want to apply specific settings based on the used desktop group.
For example to provide a specific application, drive mapping, registry setting etc.

You can manage this by creating a zone for each desktop group:

Create a new zone

Add a rule based on a registry setting

Use the following setting and value, corresponding the name of the desktop group:
Setting: HKLMSOFTWARECitrixVirtualDesktopAgentStateDesktopGroupName
Value: Acceptance-Environment

That’s it, now you can use this zone for access control on almost every object!