I virtualize Citrix servers and have had great success since VI3 was released. One of the things I learned along the way was a conflict that was created when introducing VMware Tools to a Citrix server.
My Citrix users receive mandatory profiles when their first session is established with the Citrix server. Although the user is assigned a mandatory read only profile which lives in an isolated directory on each Citrix server, a profile bearing the user’s account name is still created under \Documents and Settings\<username>\. This is normal Windows Terminal Services behavior. Now, what’s supposed to happen is when the user logs off their Citrix session, the automatically created profile is supposed to be automatically deleted. However, the installation of VMware Tools will prevent the clean up and deletion of the profile. The next time that user logs on, a new profile folder is created with a .001 extension. Then .002. Then .003. And so on. On a larger scale with many users logging on and logging off, many profile folders are created and then orphaned. Left undiscovered, several hundred orphan folders will be discovered within just a day or two depending on how many sessions the Citrix server handles.
The root cause is that a file named \Documents and Settings\<username>\Application Data\VMware\hgfs.dat cannot be deleted by Windows and thus the folder structure must remain in place. The VMware Tools installation is partly responsible for the conflict. When VMware Tools is installed, it appends a value in the Windows registry to
HKEY_LOCAL_MACHINE\
SYSTEM\
CurrentControlSet\
Control\
NetworkProvider\
Order\
ProviderOrder
The value of hgfs is appended.
The fix is simple. Right-click ProviderOrder and choose Modify. In the Edit String Value dialog box, edit the value data string and remove the characters ,hgfs (including the leading comma). For example, if the data string contains LanmanWorkstation,hgfs then change it to LanmanWorkstation. If the value data string contains only hgfs, then erase it and leave the value data string empty.
Problem solved. Unfortunately only for the time being. The next time you upgrade VMware Tools on the Citrix VM, hgfs will be appended back in the registry and once again an accumulation of folders under \Documents and Settings\ will begin.



The User Profile Hive Cleanup Service (UPHClean) from Microsoft will take care of this problem and should be a “must install” tool on any Citrix/Terminal Server.
Download it here: http://snipr.com/4ortz
I’ve had UPHClean installed since day one (I install this service as a best practice on most of my Windows servers). UPHClean is unable to resolve the hgfs issue. If you know of a UPHClean tweak to handle hgfs, please share
Sorry you’re right it’s UPHClean 2.0 (in beta) that fixes it http://snipr.com/4p2qh
32-bit download:
http://blogs.technet.com/uphclean/attachment/2940877.ashx
64-bit download:
http://blogs.technet.com/uphclean/attachment/2940834.ashx
Be aware some people have had problems with the beta (I haven’t seen any on a few hundred Citrix servers) so you’d want to thoroughly test it in your environment. Hopefully they release a final version sometime in the next 6 months.
No need to apologize.
Yeah, d has been out forever. That’s the last known stable version I’m aware of so it’s the version I have been using in production for quite a while. Thank you for your comments.
Thank you for this article (despite its age). We are suffering from exactly this problem. I found the registry key entry exactly as stated except it was called vmhgfs with Vsphere 4 tools.
Thank you for the comment. I will look at updating the article for vSphere.