mitchellh/vagrant — pull request #5013 by maxlinc (2014-12-17 20:10:43+00:00)
Title: Allow filtering/reprioritization of synced folder preferences

Currently Vagrant selects the default synced folder type based on hardcoded priorities. It will select the highest-priority "usable" plugin. Usable doesn't necessary mean working, it usually just checks that pre-requisite software is either installed or can be installed automatically. It might still be unusable in practice because of security policies or the need for additional configuration.

I've also found that the order is not always deterministic. Currently rsync and nfs have equal priority. I've seen some users report that NFS is selected, and others report that rsync is selected, when both are "usable" on their system. The `config.nfs.functional = false` property can let you disable nfs to ensure rsync is selected, but there currently isn't a way to disable rsync and force NFS to be selected (other than customizing the settings of *each* shared folder, which requires knowing the synced folders setup by provisioners and other plugins).

This PR adds a property that both filters and reprioritizes the available synced folder types before selecting a default type. This way you can force a specific selection:
```ruby
config.vm.allowed_synced_folder_types = :rsync
```

Allow Vagrant to choose from a subset of available types:
```ruby
# Will use rsync if it's usable, nfs if it isn't
config.vm.allowed_synced_folder_types = [:rsync, :nfs]
```

And swap the preferences:
```ruby
# Will use nfs if it's usable, rsync if it isn't
config.vm.allowed_synced_folder_types = [:nfs, :rsync]
```

In addition to giving the user more control of the priorities so they can easily choose nfs vs rsync, this is currently the only way to select a very low-priority synced folder type like [WinRM](https://github.com/mitchellh/vagrant/pull/4983) over higher-priority and nearly always "usable" types like rsync.