流浪汉NFS的困境

时间:2014-12-16 08:39:37

标签: vagrant vagrantfile

给出以下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

HELP !!!

[UPDATE]

将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,节点,安装了emberjs的XUbuntu

我将尝试使用https://coderwall.com/p/uaohzg/use-nfs-to-speed-up-your-vagrant

安装NFS来重建基本框

1 个答案:

答案 0 :(得分:1)

删除此行,然后重试。

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

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