流浪错误: NFS 报告您的导出文件无效

我正在尝试使用这些 指示来建立语篇开发环境。然而,当我运行 Vagrant 时,我得到了一个错误:

NFS 报告您的导出文件无效 在对文件进行任何更改之前,请进行此检查。请更正 执行「流浪重装」 :

无法打开/etc/export

我检查了一下,没有 etc/export 文件夹,所以我创建了一个并运行了 vagrant reload:

应用程序/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/plugins/hosts/bsd/host.rb: 146: in < code > read’: 是一个目录-/etc/export (Errno: : EISDIR) 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/plugins/hosts/bsd/host.rb: 146: in nfs _ prune’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/plugins/sync _ files/nfs/synces _ file. rb: 68: in < code > clean up’ 从/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/lib/vasrant/action/builtin/sync _ file _ clean up. rb: 24: in block in call’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/lib/vasrant/action/builtin/sync _ file _ clean up. rb: 22: in < code > each _ key’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/lib/vasrant/action/builtin/sync _ file _ clean up. rb: 22: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/plugins/ 提供者/viralbox/action/準備 _ nfs _ valid_ ids. rb: 12: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 从/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/lib/vasrant/action/builtin/handle _ forward _ port _ 碰撞. rb: 118: in call’. rb: 118: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/嵌入式/gems/gems/Vagrant-1.4.1/plugins/provider/viralbox/action/ready _ forward _ port _ touch _ params. rb: 30: in call’. rb: 30: in call’从/Applications/Vagrant/嵌入式/gems/gems/Vagrant-1.4.1.1/插件/提供者/viralbox/ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/lib/vasrant/action/builtin/env _ set. rb: 19: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/builtin/provision. rb: 52: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/plugins/provider/viralbox/action/clear _ forward _ ports. rb: 13: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/plugins/provider/viralbox/action/set _ name. rb: 19: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/plugins/ 提供者/viralbox/action/clean _ machine _ file. rb: 17: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/plugins/vers/viralbox/action/check _ access. rb: 18: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/insert/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 95: in block in finalize _ action’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/builder.rb: 116: in < code > call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in block in run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/util/busy.rb: 19: in < code > busy.rb: < code > busy.rb: 19: in < code > busy.rb: 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/builtin/call.rb: 51: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 95: in < code > block in finalize _ action’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/builder.rb: 116: in call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in < code > block in run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/util/busy.rb: 19: in busy.rb: 19: in busy.rb: 19: in busy.rb: 19: 从/应用程序/流浪者/嵌入式/gems/宝石/流浪者 从/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in < code > run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/builtin/call.rb: 51: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/insert/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 95: in block in finalize _ action’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/builder.rb: 116: in < code > call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in block in run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/util/busy.rb: 19: in < code > busy.rb: < code > busy.rb: 19: in < code > busy.rb: 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/builtin/call.rb: 51: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/ 內嵌/gem/gem/vasrant-1.4.1/lib/vasrant/action/builtin/config _ valid. rb: 25: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/plugins/vers/viralbox/action/check _ viralbox. rb: 17: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/builtin/call.rb: 57: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/plugins/vers/viralbox/action/check _ viralbox. rb: 17: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/ 內嵌/gem/gem/vasrant-1.4.1/lib/vasrant/action/builtin/config _ valid. rb: 25: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 95: in < code > block in finalize _ action’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/warden.rb: 34: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/builder.rb: 116: in call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in < code > block in run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/util/busy.rb: 19: in busy.rb: 19: in busy.rb: 19: in busy.rb: 19: 从/应用程序/流浪者/嵌入式/gems/宝石/流浪者 从/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in < code > run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/builtin/call.rb: 51: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/plugins/vers/viralbox/action/check _ viralbox. rb: 17: in call’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/warden.rb: 34: in < code > call’ 来自/Applications/流浪者/嵌入式/gems/gems/流浪者-1.4.1/lib/流浪者/action/builder.rb: 116: in call’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in < code > block in run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/util/busy.rb: 19: in busy.rb: 19: in busy.rb: 19: in busy.rb: 19: 从/应用程序/流浪者/嵌入式/gems/宝石/流浪者 从/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/action/runner.rb: 69: in < code > run’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/machine.rb: 147: in action’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/plugins/command/reload/command.rb: 37: in < code > block in execute’ 从/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/plugin/v2/command.rb: 193: in block in with _ target _ vms’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/plugin/v2/command.rb: 191: in < code > each’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/plugin/v2/command.rb: 191: in with _ target _ vms’ 来自/Applications/Vagrant/ 嵌入/gem/gems/vasrant-1.4.1/plugins/command/reload/command.rb: 36: in < code > execute’ 来自/Applications/Vagrant/ 內嵌/gem/gems/vasrant-1.4.1/lib/vasrant/cli.rb: 38: in execute’ 来自/Applications/Vagrant/嵌入式/gems/gems/vasrant-1.4.1/lib/vasrant/Environment. rb: 484: in < code > cli’ 应用程序/流浪者/嵌入式/gems/gems/流浪者-1.4.1/bin/流浪者: 127: in 来自/Applications/Vagrant/bin/. ./ 嵌入/gem/bin/vasrant: 23: in < code > load’ 来自/Applications/Vagrant/bin/. ./ 嵌入/gem/bin/vasrant: 23: in ’

我使用的是 Mac (OS X 10.6.8)。我该怎么补救?我试图搜索原始的错误消息,但是只找到了几个包含抛出错误消息的 Vagrant 源代码的存储库。

51276 次浏览

Try using the known good versions of VirtualBox and Vagrant noted in Discourse as Your First Rails App:

I was having the same issue on Mac (OS X 10.9 (Mavericks)), but rolling back to these versions seemed to fix it for me.

I ran into this issue with Vagrant 1.4.1 and VirtualBox 4.3.6 on OS X 10.9 Mavericks (13A603). I was able to fix it with a simple command to create the missing /etc/exports file. Run this on OS X, not guest, as pointed out in comments below.

$ sudo touch /etc/exports

I was then able to successfully run vagrant up. I did run into another error where the Guest Additions weren't up to date, but I fixed that issue by installing the vagrant-vbguest plugin.

$ vagrant plugin install vagrant-vbguest

and then a quick vagrant reload and I was up and running!

I didn't want to go through the hassle of downgrading. This is what I did (still took a while, but less hassle than downgrading IMHO):

  1. In the VM Vagrantfile, for any synced folder, disabled NFS

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

  2. Removed /etc/exports

    sudo mv /etc/exports ~/Desktop/exports

  3. Rewrite /etc/exports

    vagrant up

  4. Re-enable NFS if you want/need it enabled on your VM

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

I had some previous images/boxes installed in my VirtualBox installation, so there were a few invalid entries in /etc/exports already. So I had to clean up that file and restart my Vagrant box.

NFS is reporting that your exports file is invalid. Vagrant does
this check before making any changes to the file. Please correct
the issues below and execute "vagrant reload":

Here's what I did on my host machine:

sudo rm /etc/exports
sudo touch /etc/exports


vagrant halt
vagrant up --provision

On Ubuntu 12 host/Ubuntu 12 guest the following worked for me with Discourse:

nfs_setting = RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", type: "nfs", nfs_udp: "true", nfs_version: "4", :nfs => nfs_setting

Note: I also had to add a host IP address determined by Vagrant and guest IP address determined by Vagrant to firewall exceptions.

For me, this error started appearing for a working Vagrant environment.

I had renamed the directory Vagrant was running from. To fix it, I ran 'sudo vi /etc/exports' and fixed the pathname so it pointed to my current directory.

The same thing happened to me. I copied over my Vagrantfile from another project and forgot to change the NFS settings. This caused the current VM to mount the parent folder of the VM that I copied the original Vagrantfile from. So I did this:

vagrant halt
vagrant up

Still got the same error. So I tracked down my exports file located at /etc/exports which looks like this:

# VAGRANT-BEGIN: 501 64e10d4d-342e-4f55-b69a-97edda35742f
"/Users/[username]/vagrant" 192.168.11.12 -alldirs -mapall=501:20
# VAGRANT-END: 501 64e10d4d-342e-4f55-b69a-97edda35742f
# VAGRANT-BEGIN: 501 b3c6e7fe-95d4-48db-8876-c89d3e07af8d
"/Users/[username]/Sites/molitech-oms" 192.168.11.124 -alldirs -mapall=501:20
# VAGRANT-END: 501 b3c6e7fe-95d4-48db-8876-c89d3e07af8d
# VAGRANT-BEGIN: 501 3e2aabfd-ce63-441b-85a2-1b51e8beb863
"/Users/[username]/Sites/app" 192.168.11.125 -alldirs -mapall=501:20
# VAGRANT-END: 501 3e2aabfd-ce63-441b-85a2-1b51e8beb863
# VAGRANT-BEGIN: 501 ff92e353-9f6d-48ee-9d76-e29b33f1dd60
"/Users/[username]/Sites" 192.168.11.126 -alldirs -mapall=501:20
# VAGRANT-END: 501 ff92e353-9f6d-48ee-9d76-e29b33f1dd60

The last two paths are the same. So I deleted the last three lines and ran:

vagrant halt && vagrant up

Now everything seems to be working fine.

OSX 10.11.1 Vagrant 1.7.4

Just run following commands:

sudo rm /etc/exports
sudo touch /etc/exports
vagrant reload

Do NOT use vagrant up --provision if you are not sure that it won't overwrite current status of your project.

i ran vagrant box list this showed me that there were 4 vagrant boxes (must have accidentally created them at some point - i usually only use one. So then I ran vagrant box prune , which deleted my unused boxes. then vagrant up started working again!