Releasing files locked by Shared Folders feature
Solution 1
This appears to be a bug in VMWare, so there is no need to check a 3-rd party antiviral software or use unlockers - all the latter break normal functioning of VMWare Workstation itself.
Multiple threads on the VMWare forum addresses the same problem. For example:
The only solution which works is mentioned in the posts by Loren Pechtel, so all credits should go to her: you should access ("touch") the locked file from the guest system.
For example, I open and close the locked file properties from Windows Explorer in the guest. This is enough to drop the lock in the host.
Solution 2
I ran into the same problem using a script to copy files from a shared host folder to my client. Ended up with locked files on the host. The easiest way to get around this is to do as others have posted before, access the host file from the client using a command.
For me I used "attrib -r HOST_FILE" in my script after copying host file. Since I mounted my shared folder as read only this did nothing but DID clear the lock.
Solution 3
Some ideas :
- Check if any program (such as an antivirus) is reading the files, on both host and guest.
I normally use Unlocker or Process Explorer for that. - Check if the files are not just copying very very slowly.
This could be the guest having a problematic network driver. - Try to turn off all firewalls, antivirus or other security products.
- I am more than half-way convinced of a serious bug existing in the VMware implementation of shared folders, where host and guest can get utterly confused. I usually avoid shared folders, because it is impossible to guess in advance whether they will work reliably on any new configuration, while network or FTP shares always work.
Solution 4
-
you can try to use Unlocker Software (click to download unlocker)
Install Unlocker, disabling the option for Explorer extensions and other junk
open CMD, than navigate to C:\Program Files\Unlocker.
run Unlocker.exe "the-path-to-the-locked-folder", from CMD.
a pop up confirming the lock release, than click unlock to unlock the file.
- Finish, File has been unlocked,
Related videos on Youtube
Alois Mahdal
Updated on September 18, 2022Comments
-
Alois Mahdal over 1 year
I make a lot of use from VMWare Workstation's Shared Folders feature: You set a folder on host machine as shared for guest OS, and you can access it on guest, in similar way as a SMB share (read-only or read-write).
The thing that annoys me is that after copying a couple of files from hots to guest, Workstation locks these files from writing, even if the share is set as read-only.
This is especially annoying in often scenario when I'm trying to debug/use a script on guest while I'm still editing it on host.
So far the only ways I know how to make Workstation release these files are:
- suspending the guest machine: that's a terrible pseudo-workaround. It's slow (especially with higher amount of guest RAM) and sometimes the interruption may not be welcome
- copying amount of some random other files, hoping that Workstation has an internal limit on amount of files it would lock: such hack that might useful regularly only if we knew the amount ant it was small
So what are some good ways to make Workstation release those files?
Or alternatively, how to avoid locking them in the first place?
Edit: I did not make few things clear:
I know that it's Workstation (vmware-vmx.exe) that is locking these files (probably due to some internal buffering)
I don't want to release the files by force. I tried that, but releasing them by force makes machine unstable, which I cannot afford
Apparently this is caused by a bug in Workstation.
-
Alois Mahdal almost 12 yearsAnd, regarding avoiding SF: It has proved for me for almost two years of daily testing that of all solutions, SF are the most reliable (and fastest) one. The most significant reason for that is that they actually do not depend on network: you can have restrictive firewalls, broken driver, or zero NICs on guest, and still transfer files as you wish via SF.
-
Alois Mahdal almost 12 yearsSorry, I'd like to avoid using "ad-supported" software (sounds almost like ad-ware). (I already have Process Explorer for these things.)
-
tvdo almost 12 years@AloisMahdal It may just be referring to the bundling of toolbars with the installer (which you should deselect when installing). In any case, I personally prefer the official/developer's site for software downloads, not sites like Softpedia. Of course, Process Explorer works just as well and you have already stated forcibly closing those handles cause instability.
-
harrymc almost 12 yearsNo problems in 2 years? What luck! Most of my SF never worked or were too slow to be usable, and the same as you are seeing now, for no obvious reason. The only suggestion I have left is to use the latest VMware version and of VMware tools (reinstall even if up-to-date, just in case), then delete and recreate the SF. Sometimes this helps. But if it doesn't, then the only next step I can see is to contact VMware Support.
-
Alois Mahdal about 11 yearsIrony: shortly after my comment about SF reliability, I upgraded to Workstation 8 and started having problems: everything would timeout on
\\vmware-host\Shared Folders\folder\subfolder
unless\\vmware-host\Shared Folders\folder
has been opened at least once since boot. I'm not working in that company (and probably not going to see Windows for a long time, yay), though... -
Mark Booth over 7 yearsWhen this happened to me with Workstation 12.5 Unlocker couldn't see or remove any file locks on the file. I never saw this problem with Workstation 7.
-
harrymc over 7 years@MarkBooth: Later version of Unlocker and Windows don't seem to play well together - this answer is from 2012.
-
Mark Booth over 7 yearsThanks @harrymc, this is the first time that Unlocker has failed me since upgrading to Windows 10/Workstation 12.5, and I've been using Unlocker for years.