共享文件夹的格式会在不同版本的 Vagrant 中发生变化。请参阅法比奥的回答https://serverfault.com/questions/398414/vagrant-set-default-share-permissions
Vagrant 1.3.1 及更早版本
config.vm.share_folder "v-data", "/export", "/export",
:owner => 'vagrant',
:group => 'httpd',
:extra => 'dmode=775,fmode=775'
流浪者版本 1.3.1、1.3.2
在 Vagrant 1.3.1 及更高版本中,该extra
选项已被替换为mount_options
需要数组的选项。
config.vm.share_folder "v-data", "/export", "/export",
:owner => 'vagrant',
:group => 'httpd',
:mount_options => ['dmode=775', 'fmode=775']
流浪版本 >=1.3.3
在 vagrant 1.3.3 中,它似乎config.vm.share_folder
已被替换为config.vm.synced_folder
.
config.vm.synced_folder "v-data", "/export", "/export",
:owner => 'vagrant',
:group => 'httpd',
:mount_options => ['dmode=775', 'fmode=775']