4

直到今天,我的 vagrant 设置运行良好且流畅。但是发生了一些事情,我不知道是什么。

突然间,当我做 vagrant up 时,它挂在挂载 NFS 共享文件夹上。

我的猜测是,由于我的主机上的一些更新,有些东西坏了。以下是 vagrant up --debug 命令的输出以及过去 2 天的最新更新列表。

这是 vagrant 的输出:

==> default: Mounting NFS shared folders...
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute:  (sudo=false)
DEBUG ssh: Exit status: 0
DEBUG guest: Searching for cap: mount_nfs_folder
DEBUG guest: Checking in: ubuntu
DEBUG guest: Checking in: debian
DEBUG guest: Checking in: linux
DEBUG guest: Found cap: mount_nfs_folder in linux
 INFO guest: Execute capability: mount_nfs_folder [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, "192.168.56.1", {"/home/vagrant"=>{:type=>:nfs, :mount_options=>["nolock,vers=3,udp,noatime,fsc,actimeo=1"], :guestpath=>"/home/vagrant", :hostpath=>"/home/stefan/NetBeansProjects/cargoplanning", :disabled=>false, :map_uid=>1000, :map_gid=>1000, :nfs_udp=>true, :nfs_version=>3, :uuid=>"2352560104", :linux__nfs_options=>["rw", "no_subtree_check", "all_squash", "anonuid=1000", "anongid=1000", "fsid=2352560104"]}}] (ubuntu)
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute:  (sudo=false)
DEBUG ssh: Exit status: 0
DEBUG guest: Searching for cap: shell_expand_guest_path
DEBUG guest: Checking in: ubuntu
DEBUG guest: Checking in: debian
DEBUG guest: Checking in: linux
DEBUG guest: Found cap: shell_expand_guest_path in linux
 INFO guest: Execute capability: shell_expand_guest_path [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, "/home/vagrant"] (ubuntu)
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: echo; printf /home/vagrant (sudo=false)
DEBUG ssh: Exit status: 0
DEBUG ssh: stdout: 
/home/vagrant
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: mkdir -p /home/vagrant (sudo=true)
DEBUG ssh: stderr: stdin: is not a tty

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: mount -o 'nolock,vers=3,udp,noatime,fsc,actimeo=1' 192.168.56.1:'/home/stefan/NetBeansProjects/cargoplanning' /home/vagrant (sudo=true)
DEBUG ssh: stderr: stdin: is not a tty

DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...

2015 年 10 月 22 日的软件更新列表

2015 年 10 月 21 日软件更新列表

4

3 回答 3

5

尝试重新启动 nfs 服务(在 Arch 中为我使用 sudo systemctl restart nfs-server.service)或从 /etc/exports 中删除 Vagrant 条目(它们被 #VAGRANT-BEGIN: ... #VAGRANT-END: comments 包围)然后重新启动服务。

于 2016-01-21T20:26:10.807 回答
1

问题是 udp 协议。我从 VagrantFile 配置行中删除了 udp:

:mount_options => ['nolock,vers=3,udp,noatime,fsc,actimeo=1']

此外,即使速度更快,也不推荐使用 udp。https://github.com/mitchellh/vagrant/issues/2304

于 2015-10-22T14:19:34.510 回答
0

对于仍在四处张望和 18.04 的其他人,我发现了我的罪魁祸首。

即使安装了 nfs-kernel-server 和 nfs-common ,在我的情况下,nfs-server 包似乎也丢失了,我安装了 nfs-server 并且 vagrant up 没有问题。Vagrant 2.0.3 和 Virtualbox 构建 5.2.18_Ubuntu r123745

于 2019-01-01T05:08:10.387 回答