One of the great experimental features of a XenClient device connected to a Synchronizer is the ability to download Dynamic VM images.  These images are different from the regular, or Static VM images because they allow for a layering approach to desktop virtualization.  Folks familiar with XenDesktop Pooled VMs have seen the concept before – any desktop can be considered to be made up of 3 basic layers. The first layer represents the base OS, on top of which resides the second layer comprising of applications. And lastly on top of the applications, lies the third layer which has the user’s settings and data.  Consider the diagram below representing the layering of virtual disks to match the layered desktop concept:

Each of the layer is represented by a VHD, and three put together enable a Dynamic VM on a XenClient device (Read Part V of this great blog: http://community.citrix.com/pages/viewpage.action?pageId=158571842 to get a better understanding of how the three VHDs are configured for a XenClient Dynamic VM).  The “Documents & Settings” layer is backed up to the Synchronizer and persisted across reboots so that the user always has this information.  The applications layer is persisted across reboots, but not backed up to the Synchronizer. I’ll explain more on why it is not backed up further down.  Any changes made to the base OS layer is neither persisted across reboots, nor backed up to the Synchronizer.  What this gives the user is the ability to get a fresh vanilla install of their VM that matches exactly what the IT admin wants them to be running on.  The IT admin is happy since any changes that a malware for example might have corrupted on the base OS system files is thrown away on a reboot.



Now if the user connects to their XenApp farm using the Citrix Receiver and downloads Streamed Apps, the usual location that the files for the Streamed App are put is “C:\Program Files\Citrix”.  This folder turns out to be part of the base OS, and on a reboot any of the downloaded Streamed Apps would be thrown away.  These downloaded Streamed Apps need to be persisted across reboots, and that is the purpose of the application layer in XenClient Dynamic VMs.  Any changes made to files on that layer are persisted across reboots, but are not backed up (there is no reason to back them up since the XenApp farm already has the files which the user can download at any time).  The trick now is to redirect these downloaded apps to the applications layer VHD.  (To get a thorough read on the logic behind the redirect, read another great blog: http://community.citrix.com/display/ocb/2008/03/20/App Streaming – Deploy folder location)

Let’s cover the end to end of how to deploy a Dynamic VM image with Streamed Apps.  Here’s what the IT admin would do:

1. Create a VM on a XenClient device, install Receiver and plugins.  As a side note, would be great to connect to a Merchandising Server and download the plugins from it.

2. Upload the VM to a Synchronizer as Dynamic VM (see the section on Dynamic VM image mode in the Synchronizer for XenClient 1.0 SP1 Administrator Guide at http://support.citrix.com/article/CTX127693).

3. Start the VM once the upload has finished. Starting Windows Explorer will show something like

Note that there is a folder created by XenClient under “C:\Program Files\Citrix” called “AppCache”.  This is a junction point for the applications layer VHD.  If the admin were to open Windows Disk Manager in the Dynamic VM, they’d see something like



Disk 1 and Disk 2 are the Applications layer VHD and the Personalization layer (or Documents & Settings) VHD.  “C:\Program Files\Citrix\AppCache” is a junction point to Disk 1 in this case.



4. Start a command prompt with administrator privileges, and run the following commands:

  • Run the “C:\Program Files\Citrix\Streaming Client\ClientCache.exe” (“C:\Program Files (x86)\Citrix\Streaming Client\ClientCache.exe” for Windows x64) utility which allows RadeCache to be directed to another folder, and one should use this because it caters for all the ACL settings automatically and making appropriate registry changes for Streaming Client to pick up.

    I gave the cache size 20GB since the application disk defaults to 40GB. (Unfortunately there isn’t a way to change this default size right now)

  • Map the Deploy folder to “C:\Program Files\Citrix\AppCache\Deploy” by creating a Deploy folder in AppCache, setting the correct DACL, and modifying the registry to let Streaming Client know to use the new location.

    • mkdir “c:\program files\Citrix\AppCache\Deploy”
    • cacls “c:\program files\Citrix\AppCache\Deploy” /E /G Ctx_StreamingSvc:F
    • For 32bit Windows
      • reg add HKLM\Software\Citrix\Rade /v PreDeployDir /t REG_SZ /d “c:\Program Files\Citrix\AppCache\Deploy”
    • or for 64bit Windows
      • reg add HKLM\Software\Wow6432Node\Citrix\Rade /v PreDeployDir /t REG_SZ /d “c:\Program Files\Citrix\AppCache\Deploy”
    • echo y | reg delete HKCU\Software\Citrix\Rade\Offline

      Note that the registry key HKCU\Software\Citrix\Rade\Offline does not exist. If there were downloads prior to running the above commands, the registry key would have existed. Run the command to be on the safe side.

  • Map the RadeStore directory to the application layer VHD as well. This folder contains hive information etc that would get recreated on every boot if it does not exist. We’d gain a few seconds on application startup time if this folder’s contents are persisted across reboots as well.

    • mkdir “c:\program files\Citrix\AppCache\RadeStore”
    • cacls “c:\program files\Citrix\AppCache\RadeStore” /E /G Ctx_StreamingSvc:F
    • For 32bit Windows
      • reg add HKLM\Software\Citrix\Rade /v StoreLocation /t REG_SZ /d “c:\Program Files\Citrix\AppCache\RadeStore”
    • or for 64bit Windows
      • reg add HKLM\Software\Wow6432Node\Citrix\Rade /v StoreLocation /t REG_SZ /d “c”\Program Files\Citrix\AppCache\RadeStore”

        If the admin were to now look at Windows Explorer now, they’d notice that the AppCache folder (ie, the application layer VHD junction point) now has the Deploy, RadeCache and RadeStore folders redirected to it.






5. Shutdown and upload the VM again as the next version. This is the version that the admin would assign to users.

Once the user’s have downloaded the Dynamic image, and then downloaded some Streamed Apps from their XenApp farm, they would see them deployed to the applications layer VHD at junction point “C:\Program Files\Citrix\AppCache”. In the figure below, the user has downloaded Firefox and Acrobat Reader.



A reboot of their Dynamic VM would persist the AppCache directory contents, and have the Streamed Apps available to them at all times.



Hope the steps above will help in your PoC and Pilots of Dynamic VM images. It’s a very powerful concept and the product team is looking to make it a fully supported feature in the very near future.