When logging off from a terminal server in a virtual machine the local profile cannot be deleted due to a file called “hgfs.dat” which is still in use.
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.
You can work around the problem by changing a value in this registry key:
The workaround disables the VMware shared folders feature in the virtual machine.