gpt4 book ai didi

macos - 无法使用 nfs 挂载 vagrant 同步文件夹

转载 作者:行者123 更新时间:2023-12-02 02:57:29 24 4
gpt4 key购买 nike

我成功地在 ubuntu vagrant box 中设置了我的 Symfony2 项目。但通过其网络服务器加载网站大约需要 20 秒。经过一番研究,我想出了使用 nfs 作为同步文件夹。这是我在 Vagrantfile 中的设置:

config.vm.network "private_network", ip: "192.168.56.101"
config.vm.synced_folder ".", "/vagrant", :nfs => true, :mount_options => ["dmode=777","fmode=777"]

启动 vagrant box 后出现以下错误

==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o 'dmode=777,fmode=777' 192.168.56.1:'/Users/marcschenk/Projects/teleboy.ch' /vagrant

Stdout from the command:

Stderr from the command:

stdin: is not a tty
mount.nfs: an incorrect mount option was specified

虚拟机似乎可以工作,但同步文件夹显然是空的。我做错了什么?

我的设置:

  • Vagrant 1.6.5 和 Virtualbox 4.3.18
  • 主机:OS X 10.10
  • 访客:Ubuntu 12.04

最佳答案

在这里找到了问题的解决方案https://github.com/mitchellh/vagrant/issues/2546

vagrant 版本 1.3 到 1.6 的正确语法是:

config.vm.synced_folder ".", "/vagrant", :nfs => { :mount_options => ["dmode=777","fmode=777"] }

关于macos - 无法使用 nfs 挂载 vagrant 同步文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26700249/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com