【问题标题】:Vagrant NFS woes流浪 NFS 困境
【发布时间】:2014-12-16 08:39:36
【问题描述】:

给定以下 Vagrntfile:

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.provider "virtualbox" do |vb|
    vb.gui = true
    vb.memory = 4000
    vb.cpus = 2
  end

## hold of on these - not sure why but they don't seem to work

  config.vm.network :private_network, ip: "192.168.0.103"
  config.vm.synced_folder ".", "/vagrant/", type: "nfs"

  ## forward web
  config.vm.network "forwarded_port", guest: 8080, host: 8080

  ## forward API
  config.vm.network "forwarded_port", guest: 1337, host: 1337

  ## forward SignalR
  config.vm.network "forwarded_port", guest: 1338, host: 1338

  config.vm.box_download_insecure = true

  config.vm.box = "box-cutter/ubuntu1404-desktop"


end

为什么哦,为什么我不断收到:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o 'vers=3,udp' 192.168.0.1:'/Users/wayne/sonatribe' /vagrant

Stdout from the command:



Stderr from the command:

stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.0.1:/Users/wayne/sonatribe

求助!!!

[更新]

将 NFS 行更改为后的输出

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

产生以下结果:

==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Installing NFS client...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> 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 'vers=3,udp' 192.168.0.1:'/Users/wayne/sonatribe' /vagrant

Stdout from the command:



Stderr from the command:

stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.0.1:/Users/wayne/sonatribe

[更新 2] 我定制的底盒是:

config.vm.box = "XUbuntu" config.vm.box_url = "https://www.dropbox.com/s/86m4h2r70mowtse/package.box?dl=0&raw=1

这只是安装了 NVM、node、emberjs 的 XUbuntu

我将尝试根据https://coderwall.com/p/uaohzg/use-nfs-to-speed-up-your-vagrant 安装 NFS 来重建基础盒

【问题讨论】:

    标签: vagrant vagrantfile


    【解决方案1】:

    删除此行并重试。

    config.vm.synced_folder ".", "/vagrant/", type: "nfs"
    

    Vagrant 自动将当前文件夹挂载到 vagrant box 的 /vagrant

    如果你必须挂载为 NFS,那么这个怎么样?

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

    我在 Vagrant 中使用 NFS 设置进行了测试,但使用了不同的框图像。这是我的测试箱:

      config.vm.box = "precise64"
      config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box "
    

    也许问题出在那个盒子图片box-cutter/ubuntu1404-desktop

    【讨论】:

    • 它需要是 NFS,因为我们使用的是 ember cli,它会阻塞默认文件共享策略以及它添加的手表数量
    • 我的 MB 电池快没电了 :p 今天晚上我会好好表现一下 - 谢谢
    • 在我尝试配置它之前,我是否需要在基础盒中安装任何东西才能使其正常工作?
    • 我试过其他的盒子图片,用nfs没问题,请问"box-cutter/ubuntu1404-desktop"盒子好不好?
    • Hmmmm - 我现在想知道是否需要在基础盒上安装 NFS...我正在使用的基础在我的编辑中 - 我省略了它,因为它是一个大基础盒,有些人会已经有 box-cutter/ubuntu1404-desktop...
    猜你喜欢
    • 2018-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多