VMware Communities
jokerjoed
Contributor
Contributor

Workstation 9 - Shared Folders option is locking files

I've been using VMWare for weel over 7 years and have never had this issue.  I typically complete scripts using the host machine.  I then create a shared folders configuration to my scripting folder on my host.  Using the CMD wing in the guest (everything is Windows), i run the script.  If there is an error, I go back tot he host, make a change, save it, then simply retest on the guest.

this issue I'm having, it once I enable "shared folders", I can not make changes to teh file from teh host.  I need to etierh save as a different name or diable shared folders, save the script and then re-enable the shared folders so I can test.  Very anoying

I completed Google searches and was very suprised at the lack of infomration on this issue.  I did find some links, so I know I'm not the only one.

Is this a known issue with VMWare that they are working on fixing?

18 Replies
jokerjoed
Contributor
Contributor

Am I the only one having this issue?

Reply
0 Kudos
louyo
Virtuoso
Virtuoso

Hard to say. It is almost impossible to define the problem from your original post.

When you try to edit the files from the guest, what is the error message?

What happens if you create a share (net use) instead of the (sometimes problematic) shared folders option?

Is the guest user a registered user on the host (with proper permissions)?

I occaisonally use shared folders to my Linux host and I have to make sure of proper permissions. I find it much more reliable to use shares via Samba server on the host and mapped drives on the guest, but still have to watch permissions.

Lou

Reply
0 Kudos
jokerjoed
Contributor
Contributor

I will explain again and just to let you know, I’ve been doing this with the previous versions of VMWare Workstation and Fusion(Mac) without an issue, so something has changed.

Environment

Host – Windows 7x64

Guest – Windows 2008 R2x64

On the host machine, I have a vbscript that I’m altering.  This script needs to run on the guest.  I create a Shared Folders configuration to point to the Host directory where the vbscript is located.

What I do is open a CMD window on the guest to run the script.  If the script has an issue, I then go back to the host and try to alter the script.  Once the script is touched by the Guest, the host can no longer edit the file.  When I try to edit with Notepad.exe (or any other editing software), I get the following;

cid:image002.png@01CDB4FD.2A5B6250

When I try to alter the file from the guest, it works just fine

Looking at process monitor from the guest, nothing is holding the file, but completing it on the host, process monitor shows a VM process holding the file.

cid:image004.jpg@01CDB4FE.0BBE82E0

The only way I can get around this is to run the script on the Guest, disable “shared folders”, alter the script, then re-enable “shared Folders” so I can re-test the script.

Joe

cid:image001.png@01CDB4FB.DA725790

Reply
0 Kudos
louyo
Virtuoso
Virtuoso

>>so something has changed.

It seems that several things have changed, not all are for the better. Smiley Happy

I can't recreate what you are seeing, but I run on a Linux host. It nevers locks the file on me. I can also run/edit the file from another guest after running the script, even if it has errors.

Does it do the same thing if you map a drive letter on the guest?

Does it do the same thing if the script exits without errors?

Can you edit the script (on the host) from the guest?

Have you tried the same thing from other guests?

Sorry I can't offer more advice, perhaps you should open a trouble ticket with VMWare?

Lou

Reply
0 Kudos
jokerjoed
Contributor
Contributor

Does it do the same thing if you map a drive letter on the guest?

-        I have ‘shared folders’ mapping the drive for me.  I did disable that option, manually mapped a drive and the same issue occurred

Does it do the same thing if the script exits without errors?

-      Yes, even when the script works fine, the same “locking” of file occurs

Can you edit the script (on the host) from the guest?

-      Yes, I can edit the script on the ‘host’ from the guest OS.  The locking does not appear to be within the guest itself, but with the ‘vmware-vmx.exe’ process on the host.

Have you tried the same thing from other guests?

-      Same thing happens if I test on a different guest

Sorry I can't offer more advice, perhaps you should open a trouble ticket with VMWare?

New information.  To test some of your questions above, I altered the script that resides on the ‘host’ from the ‘guest’, which works.  When I go back to the host, I can then edit the script.  Editing the script on the guest causes the lock on the file to be released, which I can see by monitoring the Process Monitor.

Joe

Reply
0 Kudos
Loren_Pechtel
Contributor
Contributor

Thanks for the new information--that provides at least a partial workaround.

From what I have been able to figure out once a program in the VM opens a file it remains locked until that program terminates--and note that Windows never terminates.  Your additional information suggests that you can trick it by opening one of those that's being held by Windows with another program and it releases when the other program closes.

Note that I'm experiencing this in ver 7, this is a long-standing bug.

Reply
0 Kudos
raybk
Contributor
Contributor

I have the same problem. I need to shutdown the guest to free the host files.

Reply
0 Kudos
shacktoms
Contributor
Contributor

I also have this problem, but I can release the locks on the host files by disabling the shared folders. That is disruptive, but less disruptive than shutting down the guest.

Shack

Reply
0 Kudos
ellisdp
Contributor
Contributor

I have the same issue. Any files/folders I access in a shared folder within a VMware Guest are then locked and cannot be updated/deleted on the host until I shut down the VM, even when nothing in the guest is actually using them.

VMware Workstation 9.0.3 build-1410761, host and guest o/s is Windows 7 Pro.

Reply
0 Kudos
newbie93
Hot Shot
Hot Shot

I been running into this since Windows 7 was released. It seems to be worse when the VM(s) and the host are windows 7. It's not always 100% repeatable. I think this started with Vista and the "new" security that came along with it.

I have had this problem with every version of Workstation since 9.0. I have not tried the 2014 "Preview" (v11) to see if it still exists.

I've tried to put a readonly permission for the folders that the guest "sees". It seems to help reduce the likelihood, but it still happens.

FYI, to make things a little less painful, just suspending the VM(s) allows the file(s) to be deleted from the host and then a quick resume of the VM(s) has always worked for me. At least one doesn't have to wait for a full power down, power up sequence..

Maybe some year, this will be resolved, I am really unsure of whether it's a Workstation or a Windows problem.

It doesn't appear to be any better for Win 8.1 guests either.

Reply
0 Kudos
dxiv
Contributor
Contributor

It's such a "legacy" issue that I can only guess somebody out there must consider it a feature 😉 It goes all the way back to v6 (https://communities.vmware.com/thread/108849) and still exists in the v11 July preview (https://communities.vmware.com/thread/495039).

Reply
0 Kudos
emusic
Enthusiast
Enthusiast

In Workstation 12.5, the problem persists.

A workaround is to use non-buffered copy mode.

In Win7+ guests, xcopy /j can be used.

In XP, copywobuf utility can copy a single file. To copy a directory tree, a simple CMD script (with for /r) can be used.

pcoyne
Contributor
Contributor

xcopy /j worked for me. Source file in the host OS is no longer locked after copy. Thanks!

Reply
0 Kudos
marcuoli
Contributor
Contributor

VMWare Player 15.0.2 build-10952284 over here, year 2019, and the same problem !!!!!!

Reply
0 Kudos
emusic
Enthusiast
Enthusiast

I'm afraid VMware doesn't consider this problem worthy of attention...

Reply
0 Kudos
marcuoli
Contributor
Contributor

I'm afraid so....

Reply
0 Kudos
ndubee
Contributor
Contributor

Also affected by this problem on several instances of Workstation, used to virtualize old XP boxes. Highly frustrating. Anybody tried opening a support ticket with VMware?

Reply
0 Kudos
JohnW3
Contributor
Contributor

This bites me every time I copy a file from the guest to the Shared Folders of the host. In the host, the file is still locked by Workstation (v15.5).

I'm wondering if the underlying cause is within Windows, which might explain why VMware hasn't fixed it. Opening the file with Windows from within the guest won't free the lock, but other posts indicate that opening with a different app will free the lock. I have usually done something with Windows in the guest that causes it to lock a different file, thereby unlocking the file I want.

IObit has a free file unlocker (www.iobit.com/en/iobit-unlocker.php) that has become my go-to workaround. With its context menu entry in File Explorer, it is a sweet and simple solution.

Reply
0 Kudos