VMware Communities
mbaryo
Contributor
Contributor
Jump to solution

vmghfs file corruption when file written by eclipse

Hi all,

I'm using Workstation 10, Host OS Ubuntu 12.04, guest OS Fedora 12.  I have a single vmghfs mount exposing a Host folder as a filesystem in the guest.  In the guest, this appears in the guest fstab as: .host:/source    /home/chrisb/source    vmhgfs    defaults    0 0

When writing to a text file on the host in eclipse, I am able to consistently reproduce a file corruption bug from the point-of-view of the guest OS.  If I expand the file, everything is okay.  If I make the file smaller (for example, deleting a few characters of a text file) the size appears to change but the contents do NOT.  This problem does NOT occur when the file is edited in vim, however the effect appears to be the same in either case on the host (the file appears changed correctly on the host).  Issuing a 'sync' on the Host also has no impact on what the guest sees.

e.g.:

original

=====

1234567890

=====

edit on host

=====

12345890

=====

seen on guest:

=====

12345678

=====

I have not tried editing the file while it appears corrupted on the guest.

What causes this, and how do I prevent it short of abandoning eclipse?

Chris...

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
steve_goddard
VMware Employee
VMware Employee
Jump to solution

Hi guys,

this is a known issue, and is due to some Linux client caching changes I made to fix a separate caching corruption bug.

I missed something when the client checks if the file has changed on the host side and should purge the client side cache and read the file contents again as new.

It won't matter what the host side is per se, it is really an issue caused by anyone modifying the file from the host side, causing the client cache to be stale.

I am looking into getting this fixed.

Sorry for the headaches.

Steve

Thanks. Steve

View solution in original post

Reply
0 Kudos
16 Replies
mbaryo
Contributor
Contributor
Jump to solution

I did a little bit more digging and found that vim and gedit update the inode (even with backups off), but eclipse does not:

guest$ ls -i ib/test*

23728601 ib/testfs.txt

### edit file using gedit or vim on host

guest$ ls -i ib/test*

23728600 ib/testfs.txt

### edit file using eclipse on host

guest$ ls -i ib/test*

23728600 ib/testfs.txt

And, as mentioned above, the edit in eclipse isn't reflected properly in the guest.  This seems like fairly serious filesystem corruption.

Reply
0 Kudos
AlanaA
Enthusiast
Enthusiast
Jump to solution

It seems the vmhgfs shared folders feature of Workstation has had ongoing issues for a while. Each time I update to a major or minor version, I test out the shared folders feature to see how it works. So far I've always switched to using regular Samba shares on the host.

I'm testing Workstation 10.0.1 on a Xubuntu 12.04.3 host using the 3.8 kernel enablement stack and 2 Xubuntu 12.04.3 guests with the 3.2 kernel stack. I encountered similar issues as you. I edited a text file on the host or one of the guests but the second guest doesn't see any changes. Issuing sync commands on the host and the 2 guests didn't fix anything. A second issue I saw was when I edited a text file on one of the guests and then opened the file in the second guest, it showed the contents of a completely different file. That was when I switched Samba shares with the added benefit of increased performance.

For both the cases above, a reboot of the guest seemed to fix it but that's not a good workaround.

jimlongson
Contributor
Contributor
Jump to solution

I have seen the same problem on 10.0.1 when using NETBEANS and KOMODO IDE. No problem with ULTRAEDIT, ULTRASTUDIO or PHPSTORM. This was not a problem under 10.0.0. It occurs on both Windows 7 and Windows 8 hosts running Centos 5.9 and Centos 6.4 guests respectively.

steve_goddard
VMware Employee
VMware Employee
Jump to solution

Hi guys,

this is a known issue, and is due to some Linux client caching changes I made to fix a separate caching corruption bug.

I missed something when the client checks if the file has changed on the host side and should purge the client side cache and read the file contents again as new.

It won't matter what the host side is per se, it is really an issue caused by anyone modifying the file from the host side, causing the client cache to be stale.

I am looking into getting this fixed.

Sorry for the headaches.

Steve

Thanks. Steve
Reply
0 Kudos
simzen85
Contributor
Contributor
Jump to solution

Hi Steve,

Is there any workaround for this bug ? I can't really develop on my Windows host (and deploy on my Linux guest) because of this exact bug Smiley Sad Need to enter some junk comments once in a while and save so that the guest can recognize the changes correctly.

T

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee
Jump to solution

Sorry for this mess but I am looking into this.


As for workarounds, can you revert back to the previous version of tools, 6.0.1 which I assume must have worked for you?

Seems the simplest choice given you can't work only in the VM. The only other choice would be after you edit the file in the Windows host, you make sure you have either unmounted the HGFS share which can also be done by disabling the Shared Folders feature from the UI (verify the mount has gone) or rebooted the Linux VM before you reuse the file with new changes. Seems like that is asking a lot though…but disabling sharing and enabling sharing again might be sufficient to get the VM file system cache purged but I have not tried it. Rebooting seems excessive and annoying but would be a sure fire way.

Steve

Thanks. Steve
Reply
0 Kudos
mbaryo
Contributor
Contributor
Jump to solution

I switched to NFS for linux-linux.  samba will work for windows-linux and is what some folks in my office use.

Reply
0 Kudos
ctives
Contributor
Contributor
Jump to solution

I have the same issue with editing in Netbeans in a Ubuntu - Ubuntu environment.  With a web server running on the guest machine, the pages are not being updated after edit within Netbeans.

Reply
0 Kudos
zfowen
Contributor
Contributor
Jump to solution

Hi Steve,

I met the same problem.

As a workaround, how can I revert back to the previous version of tools, where can I find the previous version software?

And When fix the bug?

Thanks.

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee
Jump to solution

You can download the 6.0.1 tools from https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/6.0.1/1331545/packages/

Pick the OS version of the zipped tar file and extract the files into a folder of your choice.

In  a terminal window change to that folder and run the vmware-install script. You will need to sudo it and select the default options should be fine.

Note before you do the tools install please check and possibly modify the configuration setting for the VM.

Can you check the VM .vmx file setting (see link below how to do this):

tools.upgrade.policy = "manual"

If it is set to autoupgrade it will override what you just did and revert back to the 6.0.2 tools.

You should see the build-1294478 in the vmware-toolbox-cmd output if you see build-1378637 then you have the 6.0.2 tools installed.

Be sure to modify the upgrade policy setting. Otherwise I think it will be getting in the way here.

For those using OS X here's a tutorial that explains how to edit the .vmx file:

VMware KB: Editing the .vmx file for your VMware Fusion virtual machine

Thanks. Steve
Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee
Jump to solution

Note I am not allowed to say when modifications fixes or otherwise are being released as the schedules are not within any one persons control and subject to change.

Sorry. I can say that it is being worked on though. By me.

Steve

Thanks. Steve
Reply
0 Kudos
simzen85
Contributor
Contributor
Jump to solution

May I ask is there any timeline for this to be resolved ? Thanks

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee
Jump to solution

This issue is now fixed and will be released in the next VMware tools release which will not be too long.

Note, I am not allowed to say when this is exactly as it is VMware policy as schedule changes often occur and so exact dates often change. Also I am not included or a party to those discussions.

Thanks for everyone's help and patience.

Steve

Thanks. Steve
Reply
0 Kudos
Francois_Lamour
Contributor
Contributor
Jump to solution

Workstation 10.0.0.2 just went out with this being fixed:

  • Linux virtual machines access updated contents when using shared folders.
    Resolved an issue that caused Linux virtual machines to see stale file contents when using shared folders.


Fusion 6.0.3 went out the same day but the release notes doesn't mention it. Since the issue was in Tools, it's also probably fixed...

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee
Jump to solution

There might have been a documentation release note miss for the Fusion 6.0.3 but the same set of fixes are in both releases.

Thanks for posting.

Steve

Thanks. Steve
Reply
0 Kudos
glenbot
Contributor
Contributor
Jump to solution

Steve, Thanks for your help on this it worked like a charm. I wrote in detail here on how to fix this problem including an inode.c file in tools that won't compile in some kernels. http://codrspace.com/glenbot/fix-vagrant-vmhgfs-file-corruption-bug-in-vmware-6-0-2-and-6-0-3/

Reply
0 Kudos