Monday, March 16, 2009

User Profile Hive Cleanup tool to remediate profiles not unloading

Issues: User profiles not unloading after logoff.
Resolution: UPHCleanup 1.6d

Windows blog:
http://blogs.technet.com/uphclean/

Real world problems

Here are actual scenarios that UPHClean v2.0 resolves:

  • VMware hgfs.dat
  • VMware creates the hgfs.dat file in profile folder for the first user that logs in and keeps it open. When using roaming profiles you get a problem with that. (read VMware FAQ1317 for a solution)
  • SUN Java (JRE)In some cases SUN Java creates a folder called hsperfdata with file permissions only set to the user and can not be removed by the system without taking ownership. SUN say’s this is by design (bug id 5042659)
  • Microsoft Internet explorer cookies and favoritesFavorites and cookie files sometimes excide more than 255 chars and can only be deleted through the command line
  • Also suspects for open file handles causing sharing violation SAP SapGui (SapWorkDir), Imprivata SSO, Indexing Software, Virus scanner etc.
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1317


Details

When I log off from a terminal server in a virtual machine, why do I get these messages?

Windows cannot copy file C:\Documents and Settings\\Application Data\VMware\hgfs.dat to \\\\\\Windows\profile\Application Data\VMware\hgfs.dat

Windows cannot update your roaming profile. Reason: The process cannot access the file because the file is being used by another process.
Solution

If you use Terminal Services (TS) to connect to a virtual machine running a terminal server, and you have the roaming profiles feature enabled, TS caches your profile in the virtual machine for the duration of your TS session. When you log off at the end of the session, TS tries to rewrite your profile to the roaming profile server.

If you also have the VMware shared folders feature enabled in the virtual machine, TS tries to copy the file hgfs.dat back to the roaming profile server. This operation fails because VMware Tools keeps the file open with exclusive access; the file cannot be accessed by the Windows guest. This results in the error messages you have seen.

These messages are seen only by the first user to log on through TS; subsequent logons do not cause the user profiles to be cached, because the shared folders feature was not designed for concurrent session access.

You can safely ignore the failure to copy the roaming profile, but you may lose changes to your shared folder mappings that were made in the current session.

The shared folders feature is not supported by ESX Server or GSX Server, but is enabled when you install VMware Tools with the Complete option. The feature is not enabled when you install VMware Tools with the Typical option under these products.

You can work around the problem by changing a value in this registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order\

The workaround disables the VMware shared folders feature in the virtual machine. Since the feature is not supported by ESX Server or GSX Server, disabling it is not a problem. However, if you migrate the virtual machine to Workstation, you will not have access to VMware shared folders unless you re-enable the feature.

  • Access the Windows Registry. Choose Start > Run, then type regedit. The Registry Editor window opens.
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order\.
  • Right-click ProviderOrder and choose Modify. In the Edit String Value dialog box, edit the value data string and remove the word hgfs.
  • Click OK.
  • Close the registry editor. Choose File > Exit.
  • Reboot the virtual machine.

If you ever want to re-enable the VMware shared folders feature, add ,hgfs to the end of the value data string, or set the string to hgfs if it is empty. Alternatively, you can reinstall VMware Tools, using the Complete option to re-enable shared folders.

Product Versions
VMware ESX 2.0.x
VMware ESX 2.1.x
VMware ESX 2.5.x
VMware ESX 3.0.x
VMware ESX 3.5.x
VMware ESXi 3.5.x Embedded
VMware ESXi 3.5.x Installable
VMware GSX Server 3.x (Linux hosts)
VMware GSX Server 3.x (Windows hosts)

No comments:

Post a Comment