10

For our web stack, we are moving from a Windows Server to CentOS. To facilitate development, we're utilizing Vagrant to run CentOS VMs locally. We're using Vagrant's Synced Folders feature to allow devs to use their favorite IDEs on their host machine, but we're finding that one key feature is missing from this setup: file system case sensitivity.

The synced folder inside the VM apparently takes on the properties of the host's file system, so if I'm developing from a Windows machine, or even OSX, the file system isn't case sensitive. This is a big issue, as our production servers will be pure CentOS, and its file system will be case sensitive.

Case sensitivity is one of the main reasons we wanted to have a local VM. We want to prevent "It works on my machine!"

Some workarounds we've considered or tried:

  • Use lsyncd to sync from the vagrant share to a location within the VM that is case sensitive
    • updating files on the host doesn't seem to generate the events in the VM that lsync listens to
  • Make a case-sensitive partition on the host
    • (Doesn't work for Windows)
  • Use samba
    • this may be an option, but we haven't vetted it yet.

Is there a better way? Note that we have developers using Windows, OS X, and Ubuntu, and the solution needs to work everywhere.

Scott Coldwell
  • 468
  • 5
  • 9
  • Good question, but too development-oriented for SF I feel - you may have better luck on Stack Overflow, have flagged for migration :) – Craig Watson Nov 05 '13 at 19:47
  • 1
    Honestly I think it doesn't belong on SO as the fact that this is for development is largely immaterial; the question is about filesystem case-sensitivity as it relates to vagrant guests and hosts. – phoebus Nov 06 '13 at 05:52

2 Answers2

6

I worked around the issue on OS X by creating a sparse disk image in my project folder and formatted it to be case sensitive.

After mounting the sparse image, I moved my code onto it. Then replaced the original "src" folder with a symlink/alias to the mounted image. This way the shared folder is case sensitive inside the guest OS.

Definitely not the most elegant solution but it does close the gap between deployment and development environment which is why I started using Vagrant in the first place.

Perhaps a similar workaround could work for Ubuntu and Windows too?

  • Windows doesn't have a case-sensitive filesystem at all. – Michael Hampton Nov 08 '13 at 19:17
  • Thanks Jason. I considered this, and it would work on my mac and ubuntu, but would not work for Windows. It also adds a manual step for creating a dev environment, which I had hoped to script entirely using vagrant/chef. There may not be another option, though. – Scott Coldwell Nov 08 '13 at 20:07
  • 2
    Case sensitivity is one the primary reasons I turned to Vagrant, after years of using MAMP, so I'm really disappointed that it remains an issue. I can't believe this isn't stated more clearly in Vagrant's docs. – Jason Suave Nov 09 '13 at 07:17
  • 3
    @JasonSuave The problem is actually with VirtualBox and what it uses for the mounts, not Vagrant. Vagrant is only controlling the VirtualBox mounts. You might have different experiences on VMWare... I haven't tried. – Brad Apr 24 '14 at 18:22
0

I have encountered the same issue and the way I tackled it is by getting by working directory on the VM via git clone and adding a Samba share pointing to it making it accessible on both Windows or Mac.

Thazar
  • 1