Vagrant Windows synced_folder - 没有这样的文件或目录

时间:2016-06-07 13:45:28

标签: vagrant nfs vagrantfile vagrant-windows

我最初认为vagrant-winnfsd插件会处理Windows上的NFS存储(意味着我不必使用haneWIN),但这是不行的,因为我收到的错误是{{1} }。

重新激活haneWIN后,我现在收到此错误:mount.nfs: requested NFS version or transport protocol is not supported

我认为[URL]:[mount]格式不正确,因为在另一台虚拟机上我使用以下代码在fstab中手动设置我的装载:mount.nfs: mounting 172.28.128.1:/D/git-repositories/+vm failed, reason given by server: No such file or directory

在给定以下配置的情况下,Vagrant的尝试是否应该看起来像192.168.11.2:/websites /home/vagrant/rails nfs nfsvers=3,vers=3,rsize=8192,wsize=8192,timeo=14,auto,intr,udp,nolock,exec,rw,user

主机操作系统: Windows 7 x64 ,LAN IP:192.168.11.2
客户操作系统: Ubuntu / trusty64
虚拟器: Virtualbox 5.0.20 r106931
相关插件: vagrant-winnfsd
主机操作系统NFS服务器: haneWIN NFS服务器

NFS服务器导出: 172.28.128.1:/websites

Vagrantfile 摘录:

D:\git-repositories\+vm -name:websites

1 个答案:

答案 0 :(得分:3)

我怀疑是对的。 vagrant-winnfsd不允许您在IP地址后明确设置路径 - 它始终包含前面的驱动器号。我的解决方案是设置haneWIN NFS服务器导出名称以匹配Vagrantfile正在使用的驱动器号。

请记住,Vagrantfile位于驱动器号I:\上。

NFS服务器导出: D:\git-repositories\+vm -name:I

Vagrantfile 摘录:

# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network :private_network, type: :dhcp, auto_config: false

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
config.vm.network :public_network,
                  ip: '192.168.11.14',
                  bridge: 'Realtek PCIe GBE Family Controller'

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
#
# Share ruby repository directories
config.vm.synced_folder '.',
                        '/home/vagrant/apps',
                        nfs: true,
                        mount_options: [
                          'nfsvers=3',
                          'vers=3',
                          'actimeo=1',
                          'rsize=8192',
                          'wsize=8192',
                          'timeo=14',
                          :nolock,
                          :udp,
                          :intr,
                          :user,
                          :auto,
                          :exec,
                          :rw
                        ]

最终的问题是这些事实中的任何一个都不能与另一个相提并论:

1)haneWIN的导出不能使用正斜杠,这是winnfsd使用的 2)winnfsd总是将驱动器号放在指定路径的前面(可能是因为它检查了本地文件系统上存在路径)