title: Shared folder in VirtualBox for Apache
body: <p>My host machine is ArchLinux and I'm running Apache in a CentOS guest. I have the vhost configuration and all the site code in a shared folder. To be able to put the vhost configuration in a shared folder I mounted the shared folder as apache:apache.</p>
  
  <pre><code>shared    /mnt/shared    vboxsf    defaults,uid=48,gid=48  0 0
  </code></pre>
  
  <p>When I'm editing files in the host, Apache will consistently start sending old versions of the file with trailing characters. In vim, they show up as ^@, so I guess they're null characters. The number of null characters is related to the number of changes I make even if I edit the first line, null characters show up at the end. If I were to speculate, it looks like a bad diff.</p>
  
  <p>If I stop <code>httpd</code>, <code>umount</code>, remount, and start <code>httpd</code> the file looks fine. Just restarting httpd doesn't help.</p>
  
  <p>How would I go about debugging the mount? Nothing jumped out at me in <code>/var/log</code>.</p>