VirtualBox

Opened 13 years ago

Closed 6 years ago

#9069 closed defect (fixed)

shared folder doesn't seem to update => Fixed in 6.0.6

Reported by: Till Owned by:
Component: shared folders Version: VirtualBox 4.0.8
Keywords: Cc:
Guest type: Linux Host type: Linux

Description (last modified by bird)

I ran into an issue where when I change a file on/in a shared folder, the change is not seen when I serve up the file through a webserver (e.g. nginx).

I originally reported this with vagrant, but they directed me here. I tried 4.0.8 of course already. This issue is present on at least two operating systems (Linux und MacOSX).

The guest in both cases was Linux (Ubuntu Karmic 9.10). I can provide my image if necessary --- it's a vagrant box.

Per ticket I previously opened (on github, vagrant), it seems to be an issue related to the syscalls of sendfile.

Let me know if I can provide more information or test.

Change History (28)

comment:1 by Denis Obydennykh, 13 years ago

I'm using Virtual Box for development purposes. There I have installed LAMP + nginx. The communication between host Windows and virtual machine is made using virtualbox shared directories.

Some time ago nginx started working wrong - static files were not updated after changes (i've changed them from windows). If the browser tried to retrieve file throw nginx - it recieved old version (also with some special chars at the end of file). At the same time apache was working normal, vim and other programs inside virtualbox were showing right version of file.

The problem was solved by changing virtual machine disk controller from sata to ide.

comment:2 by Denis Obydennykh, 13 years ago

IDE solved the problem only for some time.

Seems that stat return wrong timestamp of last modification. And nginx thinks that file didn't changed.

comment:3 by steolo, 13 years ago

happens to me all the time...

actually, since my newly built machine, I also get incoherent states where folders or applications inside my ubuntu virtualmachine are listed in red, plenty of question marks, and are actually not-accessible.

comment:4 by billwiens, 12 years ago

I had the same issue, with the Apache webserver, and I found a solution on this StackOverflow post. I'm able to fix the problem by adding "EnableSendfile off" to my Apache configuration.

I'm assuming that the same problem can be fixed in nginx by editing the sendfile directive.

comment:5 by mpeters, 11 years ago

Same issue for several years now. This really needs to be fixed since shared folders between hosts and guests are essential for many work flows. And sendfile is a very useful performance improvement for lots of software. And it's just such an obscure bug that can suck tons of time trying to track down and fix.

Please put some effort into at least investigating this and hopefully it'll be a quick fix.

comment:6 by peppy, 11 years ago

This NEEDS to be fixed. I spent a good deal of today trying to figure why my changes just weren't showing in nginx. Very hard to track down, as cat, ls show the changes, and restarting nginx does not help.

comment:7 by Bear L, 10 years ago

This has been driving me nuts for months. I've been thinking it was a caching issue with Apache, and trying unsuccessfully to implement expiry. If not resolved this could drive me away from VirtualBox.

I am using a Win7 Pro computer, with the latest version of VirtualBox, and the correct Guest Additions. Most of my development editing is done on the windows side, using gVIM and Notepad++. The symptom only shows up on html and css files. Any PHP changes show correctly on refresh.

This problem also exists using IDEs like PhP Storm or others.

If I edit an html file using gVim on Win7, and refresh the browser, the changes are not shown, and view source shows the unchanged file. If I open the file in a terminal using vim, and simply save it using ":w!" then changes show in the browser. I thought is might have something to do with access or modification times, so tried stat index.html between each action.

# before saving on Win7 gVim
$ stat index.html
  File: `index.html'
  Size: 14827           Blocks: 29         IO Block: 4096   regular file
Device: 15h/21d Inode: 1176        Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (  500/  vboxsf)
Access: 2014-05-15 10:44:40.413631400 -0600
Modify: 2014-05-15 10:44:40.415631700 -0600
Change: 2014-05-15 10:44:40.415631700 -0600

# after saving on Win7 gVim -- changes not in browser
$ stat index.html
  File: `index.html'
  Size: 14830           Blocks: 29         IO Block: 4096   regular file
Device: 15h/21d Inode: 1176        Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (  500/  vboxsf)
Access: 2014-05-15 10:46:49.001460000 -0600
Modify: 2014-05-15 10:46:49.001960100 -0600
Change: 2014-05-15 10:46:49.001960100 -0600

# attempting just a `touch` -- no success
$ touch index.html
$ stat index.html
  File: `index.html'
  Size: 14830           Blocks: 29         IO Block: 4096   regular file
Device: 15h/21d Inode: 1176        Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (  500/  vboxsf)
Access: 2014-05-15 10:47:19.000000000 -0600
Modify: 2014-05-15 10:47:19.000000000 -0600
Change: 2014-05-15 10:47:19.000000000 -0600

# after vi on linux just ":w!" -- shows changes in browser
$ stat index.html
  File: `index.html'
  Size: 14830           Blocks: 29         IO Block: 4096   regular file
Device: 15h/21d Inode: 1181        Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (  500/  vboxsf)
Access: 2014-05-15 10:48:07.564936300 -0600
Modify: 2014-05-15 10:48:07.568436700 -0600
Change: 2014-05-15 10:48:07.568436700 -0600

Oddly, if I rename the file on the windows side, or unmount and remount the filesystem, the changes show up immediately.

System info:

  • Host: Windows 7 Professional 64 bit
  • VirtualBox: 4.3.10
  • Guest OS: CentOS-5.7 (RedHat 32 bit)
  • Apache: 2.2
Last edited 10 years ago by Bear L (previous) (diff)

comment:8 by Computime, 10 years ago

I've same problem:

virtualbox

apache 2.2.15 
php 5.5
myslq 5.6

mounted volume (share folder), so I work on host files and the websever is on virtualbox.

I setted "EnableSendfile off" and all work fine, but it's not a solution, is a brutal patch. When do you resolve it? thanks

comment:9 by cgill27, 10 years ago

I can confirm seeing the same issue. Windows host, centos linux guest running Apache, sharing web files between vm and windows using a virtualbox share.

Phpstorm would save a javascript file, and in the vm you can cat or vi the file and see the change, however reloading the javascript file via browser you could not see the change.

The workaround to disable Apache's sendfile does work. http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile

comment:10 by traiii, 10 years ago

I have the exact same issue with static files from my shared folder not updating after being served once from my virtualbox vm. I am using the gunicorn python server to run a python app. Since I am not using apache or nginx to serve my static files, the disabling sendfile fix does not work for me.

comment:11 by paul-sh, 10 years ago

Are there any updates on this issue? There's a related ticket #12597.

comment:12 by CleanCut, 10 years ago

I am affected by this issue as well. This is a showstopper for our organization.

comment:13 by CleanCut, 10 years ago

I added some specific feedback on my experience to ticket #12597, which seems to be a more specific description of the sendfile bug.

comment:14 by rmc33, 10 years ago

I can confirm I am seeing the same issue. The file is updated in the file system but apache is showing an older or corrupted file when viewing from the browser. The workaround to disable sendfile in apache does work. I think updating apache would fix this. I do not need to disable sendfile in apache 2.4.6 but I do need to with an older version 2.2.15.

Last edited 10 years ago by rmc33 (previous) (diff)

comment:15 by tristan0x, 9 years ago

Bug still applies on 5.0.3

comment:16 by MartinP, 9 years ago

I am having this issue with stale files using VirtualBox 4.3.22 to run Mint 17.0 guest (with guest additions 4.3.22.98236) on top of Windows 8.1 host.

However, I'm having this when I simply use nemo to copy and paste a sub-folder from the shared folder to a native folder inside the vm's file structure.

If I right-click to edit the files in the shared folder, gedit sees the new content. But if I then copy the folder containing that file (copy from source, paste to destination), then edit the copy, the copy ends up with the stale contents.

Sometimes gedit claims the contents of the copy files are corrupt and the file cannot be edited. Perhaps explained if this link is correct that the file length is being overridden to not match the contents:- https://frankooh.wordpress.com/2011/01/21/vboxsf-and-small-files/

Noting that comment 7 mentions PHPStorm - I am editing the files using RybyMine 7.1.3, which comes from the same stable of products based on IntelliJ.

comment:17 by arimus, 9 years ago

Note, I also had this same problem on 5.0.3 in a CentOS 7 guest & OSX Host. I was getting the following trying to manually mount:

/sbin/mount.vboxsf: mounting failed with the error: No such device

Two things helped: rebuild the vbox additions, in case you've done yum update and have a different kernel running. Also, the vboxsf module isn't auto-loaded by default. Add "modprobe vboxsf" to /etc/rc.modules and ensure that file has execute bit set (chmod +x /etc/rc.modules). Reboot the VM.

comment:18 by doozr, 9 years ago

I created ticket #14920 with detailed instructions on how to replicate this issue in Docker volumes before finding this one already exists. Interestingly the guest OS sees the changes fine; it's only the bind-mounted Docker volume that has the issue. It's 100% reproducible.

comment:19 by bettrrr, 9 years ago

+1 I have the same issue and all people who use Virtualbox with e.g. Docker and Vagrant with Nginx or Apache inside.

comment:20 by leo108, 9 years ago

I'm using nginx, it work well if I set "sendfile off" in nginx.conf, but after I update to 5.0.10, "sendfile off;" does not work anymore

====update====

I turn off the open_file_cache and it works now

Last edited 9 years ago by leo108 (previous) (diff)

comment:21 by val, 9 years ago

+1 Really annoying !

Last edited 9 years ago by val (previous) (diff)

comment:22 by DarkFranX, 9 years ago

Little update related to #14920. Clearing pagefile inside the Ubuntu VM between file updates is a (inconceivable) workaround for me. Doing that, programs in a Docker Alpine container gets the updated file.

Run as root:

echo 1 > /proc/sys/vm/drop_caches

Otherwise, create new files instead of modifying the old ones.

This is happening when using Docker images based on musl libc instead of glibc. With Alpine emerging, it could be worth looking into.

And this link could be a strart: http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc

Last edited 9 years ago by DarkFranX (previous) (diff)

comment:23 by bmccord, 9 years ago

+1 still happening with VirtualBox 5.0.18

comment:24 by bronek, 8 years ago

Related: #819, #12597, #14920

comment:25 by rhazelaar, 8 years ago

+1 Same for VirtualBox 5.0.22 on Windows 10 Home and docker toolbox 1.11. Any insight about a possible fix?

[EDIT]: I built up a docker container from the official debian jessie image. However no luck. Does jessie also use musl libc instead of glibc?

Last edited 8 years ago by rhazelaar (previous) (diff)

comment:26 by fruch, 8 years ago

I also see it on: Win7 5.0.20

working with alpine docker image,

very annoying that update are coming in. (restart of the VM helped)

doing this on the docker2boot vm, didn't work echo 1 > /proc/sys/vm/drop_caches

comment:27 by Aleksandr Guidrevitch, 8 years ago

+1

On Mac Os X host, ubuntu 14.04 guest, VirtualBox 5.0.26. I'm trying to build Jekyll site, and either old copy of file gets copied, or garbage gets added to the files, or files are incomplete (cut down) even though the file size matches the original file. FYI Jekyll builds static site from templates, so it reads templates, compiles them and puts to another directory. The problem is with static (in my case javascript) files which are not processed by templating engine but directly copied to destination:

  1. Read from share -> write to share : garbage gets added, or file is cut down, or old copy
  2. Read from share -> write to root partition : garbage gets added, or file is cut down, or old copy
  3. Read from root partition -> write to root partition: good

So it definitely feels like read issue I've tried to rollback to 5.0.16 - no luck.

Last edited 8 years ago by Aleksandr Guidrevitch (previous) (diff)

comment:28 by bird, 6 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed
Summary: shared folder doesn't seem to updateshared folder doesn't seem to update => Fixed in 6.0.6

Should be fixed in 6.0.6 (maybe except for kernels older than 2.6.30).

Version 0, edited 6 years ago by bird (next)
Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette