在 vagrant 中禁用 nfs 修剪

disable nfs pruning in vagrant

最近(不确定为什么)vagrant (1.8.1) 开始要求输入 root 密码。 但是在工作中没有给我们root权限(没有sodoer)

我正在寻找一种方法来告诉 vargant 一起停止 nfs 修剪

遗憾的是 documentation 没有说明如何修改这个特定的标志,我也不太了解 ruby code 给出了应该有一个标志但无法弄清楚将 "false" 放在那里

我打算禁用 NFS 或一起跳过该部分。所以两者都会受到欢迎。

我的出发点是我的~/.vagrant.d/Vagrantfile

Vagrant.configure('2') do |config|
    config.vagrant.host :nfs_prune => false
end

错误信息是:Pruning invalid NFS exports. Administrator privileges will be required...

PS: 不,我不在我的共享文件夹中使用 nfs

您应该可以使用 config.nfs.functional = false

来禁用

functional (bool) - Defaults to true. If false, then NFS will not be used as a synced folder type. If a synced folder specifically requests NFS, it will error.

vagrantfile 可以从多个来源加载,参见 LOAD ORDER AND MERGING

Vagrant actually loads a series of Vagrantfiles, merging the settings as it goes. This allows Vagrantfiles of varying level of specificity to override prior settings. Vagrantfiles are loaded in the order shown below. Note that if a Vagrantfile is not found at any step, Vagrant continues with the next step.

  1. Vagrantfile packaged with the box that is to be used for a given machine.
  2. Vagrantfile in your Vagrant home directory (defaults to ~/.vagrant.d). This lets you specify some defaults for your system user.
  3. Vagrantfile from the project directory. This is the Vagrantfile that you will be modifying most of the time.

正如您提到的,您已经检查了第 3 点和第 2 点,检查特定框中的 Vagrantfile(如果有)