Vagrant在Ubuntu 14.04上挂载NFS时卡住了。

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...

List of software updates on 22.10.2015

List of software updates on 21.10.2015

3个回答

5

尝试重新启动nfs服务(对于我在Arch中,使用sudo systemctl restart nfs-server.service命令),或者从/etc/exports文件中删除与Vagrant相关的条目(它们被#VAGRANT-BEGIN: ... #VAGRANT-END:注释包围),然后重新启动服务。


3
如果您的主机是Ubuntu,请执行service nfs-server restart来重启NFS服务器。 - Tom

1

0

对于仍在寻找问题的其他人和使用18.04版本的用户,我在我的案例中找到了问题所在。

看起来在我的情况下,即使已经安装nfs-kernel-server和nfs-common,但nfs-server包依然缺失,我安装了nfs-server后,vagrant up就可以正常工作了。Vagrant 2.0.3和Virtualbox build 5.2.18_Ubuntu r123745。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接