{"id":3062,"date":"2011-08-01T10:24:28","date_gmt":"2011-08-01T08:24:28","guid":{"rendered":"https:\/\/ingmarverheij.com\/?p=3062"},"modified":"2011-08-01T10:25:34","modified_gmt":"2011-08-01T08:25:34","slug":"vmware-shared-folders-keep-profiles-in-use","status":"publish","type":"post","link":"https:\/\/ingmarverheij.com\/en\/vmware-shared-folders-keep-profiles-in-use\/","title":{"rendered":"VMware shared folders keep profiles in use"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"VMware Shared Folders\" border=\"0\" alt=\"VMware Shared Folders\" align=\"left\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/VMware-Shared-Folders.png\" width=\"92\" height=\"92\" \/><\/p>\n<p>When Microsoft Windows systems are virtualized with VMware ESX or Workstation, <a href=\"https:\/\/kb.vmware.com\/selfservice\/microsites\/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=340\" target=\"_blank\">WMware Tools<\/a> is installed. When the VMware tools are installed with the <strong>Complete<\/strong> option, the <strong>shared folders <\/strong>option is enabled. This feature is not enabled when you install VMware tools with the <strong>Typical <\/strong>option.<\/p>\n<p>The shared folder feature is not supported by ESX or GSX server and causes problems on Terminal Servers. The file <strong>hgfs.dat<\/strong> is opened by the VMware Tools with exclusive acces, which prevents the profile from getting deleted.<\/p>\n<p><!--more--><\/p>\n<h4>Bloating<\/h4>\n<p>In a terminal server environment is common to use <strong>roaming<\/strong> (or <strong>mandatory<\/strong>) profiles. To prevent the system from <strong>bloating<\/strong> with unused profiles, the profiles are usually <strong>removed<\/strong> at logoff. Since the hgfs.dat is locked, this is prevented and the server might end up with many profile folders.<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Documents-and-Settings.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Documents and Settings\" border=\"0\" alt=\"Documents and Settings\" align=\"left\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Documents-and-Settings_thumb.png\" width=\"284\" height=\"208\" \/><\/a><\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Local-Settings-Application-Data-VMware-hgfs.dat_.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Local Settings - Application Data - VMware - hgfs.dat\" border=\"0\" alt=\"Local Settings - Application Data - VMware - hgfs.dat\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Local-Settings-Application-Data-VMware-hgfs.dat_thumb.png\" width=\"284\" height=\"208\" \/><\/a><\/p>\n<h4>&#160;<\/h4>\n<h4>Event Log<\/h4>\n<p>In the event log the following events can be found.<\/p>\n<pre><strong>Event ID<\/strong>\t1533\n<strong>Source<\/strong>\tUser Profile Service\n<strong>Type<\/strong>\tError\n<strong>Description<\/strong>\tWindows cannot delete the profile directory C:\\Users\\<username>\\AppData\\Local\\VMware\\hgfs.dat. This error may be caused by files in this directory being used by another program. \n\n\tDETAIL - The directory is not empty.<\/pre>\n<pre><strong>Event ID<\/strong>\t1000\n<strong>Source<\/strong>\tUserenv\n<strong>Type<\/strong>\tWarning\n<strong>Description<\/strong>\tWindows cannot copy file C:\\Users\\<username>\\AppData\\Local\\VMware\\hgfs.dat to <remotelocation>. Contact your network administrator.\n\n\tDETAIL - The process cannot access the file because it is being used by another process.<\/pre>\n<p>&#160;<\/p>\n<h4>Solution<\/h4>\n<p>The problem can be solved by disabling the Shared Folder feature in VMware Tools. This has to be configured in the registry by removing the shared folder feature from the NetworkProvider.<\/p>\n<p>From VMware <a href=\"https:\/\/kb.vmware.com\/selfservice\/microsites\/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1317\" target=\"_blank\">KB article 1317<\/a>:<\/p>\n<ol>\n<li>Access the Windows Registry. Choose <b>Start &gt; Run<\/b>, then type <tt>regedit<\/tt>. The Registry Editor window opens. <\/li>\n<li>Navigate to <tt>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\NetworkProvider\\Order\\<\/tt>. <\/li>\n<li>Right-click <b>ProviderOrder<\/b> and choose <b>Modify<\/b>. In the Edit String Value dialog box, edit the value data string and remove the word hgfs, vmhgs, or vmhgfs).\n<ul>\n<li>If the value data string contains LanmanWorkstation,hgfs, LanmanWorkstation,vmhgs, or LanmanWorkstation,vmhgfs, change it to LanmanWorkstation. <\/li>\n<li>If the value data string contains only hgfs or vmhgfs, erase it and leave the value data string empty. <\/li>\n<\/ul>\n<\/li>\n<li>Click <b>OK<\/b>. <\/li>\n<li>Close the registry editor. Choose <b>File &gt; Exit<\/b>. <\/li>\n<li>Reboot the virtual machine. <\/li>\n<\/ol>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Network-Provider-Order-Before.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Network Provider Order - Before\" border=\"0\" alt=\"Network Provider Order - Before\" align=\"left\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Network-Provider-Order-Before_thumb.png\" width=\"179\" height=\"117\" \/><\/a><\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Network-Provider-Order-Edit.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Network Provider Order - Edit\" border=\"0\" alt=\"Network Provider Order - Edit\" align=\"left\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Network-Provider-Order-Edit_thumb.png\" width=\"179\" height=\"77\" \/><\/a> <\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Network-Provider-Order-After.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Network Provider Order - After\" border=\"0\" alt=\"Network Provider Order - After\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2011\/08\/Network-Provider-Order-After_thumb.png\" width=\"179\" height=\"117\" \/><\/a><\/p>\n<p>Instead of editing the value per server I created a small VBscript to deploy on all Terminal Servers.<\/p>\n<pre lang=\"vbscript\">'Define variables\n   Dim objShell\n   Dim strProviderOrder\n\n'Connect to subssystems\n   Set objShell = WScript.CreateObject(&quot;WScript.Shell&quot;)\n\n'Read registry key\n   strProviderOrder = objShell.RegRead(&quot;HKLM\\SYSTEM\\CurrentControlSet\\Control\\NetworkProvider\\Order\\ProviderOrder&quot;)\n\n'Remove VMware Shared Folder\n   strProviderOrder = Replace(strProviderOrder, &quot;vmhgfs,&quot;, &quot;&quot;, 1, -1, 1)\n   strProviderOrder = Replace(strProviderOrder, &quot;vmhgs,&quot;, &quot;&quot;, 1, -1, 1)\n   strProviderOrder = Replace(strProviderOrder, &quot;hgfs,&quot;, &quot;&quot;, 1, -1, 1)\n\n'Write registry key\n   objShell.RegWrite &quot;HKLM\\SYSTEM\\CurrentControlSet\\Control\\NetworkProvider\\Order\\ProviderOrder&quot;, strProviderOrder, &quot;REG_SZ&quot;<\/pre>","protected":false},"excerpt":{"rendered":"<p>When Microsoft Windows systems are virtualized with VMware ESX or Workstation, WMware Tools is installed. When the VMware tools are installed with the Complete option, the shared folders option is enabled. This feature is not enabled when you install VMware tools with the Typical option. The shared folder feature is not supported by ESX or [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[295],"tags":[371,370,23,76,41],"class_list":["post-3062","post","type-post","status-publish","format-standard","hentry","category-remote-desktop-terminal-server","tag-hgfs-dat","tag-sbc","tag-terminal-server","tag-vmware","tag-xenapp"],"_links":{"self":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/3062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/comments?post=3062"}],"version-history":[{"count":1,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/3062\/revisions"}],"predecessor-version":[{"id":3063,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/3062\/revisions\/3063"}],"wp:attachment":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/media?parent=3062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/categories?post=3062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/tags?post=3062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}