3

I have a problem with files on a mounted share inside a Virtualbox machine.

The problem is that even though I can see the content of the files fine enough from the shell, the same files turn out slightly corrupted, truncated or in old versions, sometimes when served over http via an Apache web server.

The problem seems only to happen once the file reaches a certain length (100-200 characters). Sometimes non-readable characters are added to the end, resulting in little question marks in the browser. Another common symptom is that when the file is changed from the host, there is no way to get Apache to serve the new version. (The problem is not related to ETags and Apache has perfect read permissions on all files. I doubt it's solely related to encodings either.)

It really looks like a filesystem-level problem which only manifests itself in Apache.

Some facts:

Host: MacBook Pro/Snow Leopard

Guest: Fedora 16

Apache: 2.2.22

VirtualBox: 4.1.8

I have tried mounting in fstab but also manually, changing userid to apache.

I apologize for the vague (unresearched?) problem description, but I really don't know where to start with this and I am hoping to get some hints in the right direction. Is it Mac, Virtualbox, Fedora or Apache that is the real problem?

UPDATE: I realize there is more to it than Apache httpd not serving the files correctly - sometime, when I create a new folder on the host, the entry is shown as a bunch of question marks when doing a directory listing in the shell of the guest. It almost goes without saying that I cannot traverse into that new folder, until I have rebooted the guest.

2 Answers 2

3

Have a look at the ticket at https://www.virtualbox.org/ticket/819, there they suggest what you already found which is the Apache's EnableSendfile directive. Turning this directive Off seems to solve the problem on our servers.

1
  • 11 years later, they finally fixed it. VirtualBox 6.0.6 apparently
    – Hashbrown
    Apr 10, 2019 at 6:41
0

Some searching for "apache mmap" reveals that Apache will use mmap(2) to access files when the files exceed a certain size (which appears to default to 1 byte on non-SunOS systems). This problem could be caused by a bug in VirtualBox's support for mmap'ed access to shared folders.

2
  • I tried to disable mmap: EnableMMAP Off in the apache conf, but that didn't help. Your answer was helpful nevertheless, since a related search found the suggestion to disable sendfile as well: EnableSendfile Off and that actually did the trick with respect to Apache! Thanks!
    – jgivoni
    Apr 27, 2012 at 19:43
  • Though you pointed me in the right direction I am not sure I can accept yours as an answer, as it would be misleading to other users. What is common practice in such case?
    – jgivoni
    Apr 27, 2012 at 19:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .