0

我最初认为该vagrant-winnfsd插件会处理 Windows 上的 NFS 存储(这意味着我不必使用 haneWIN)但这是不行的,因为我收到的错误是mount.nfs: requested NFS version or transport protocol is not supported.

重新激活 haneWIN 后,我现在收到此错误:mount.nfs: mounting 172.28.128.1:/D/git-repositories/+vm failed, reason given by server: No such file or directory.

我得到的印象是 [URL]:[mount] 格式不正确,因为在另一个 VM 上,我在 fstab 中手动设置了我的挂载,如下所示: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.

172.28.128.1:/websites考虑到以下配置,Vagrant 的尝试是否应该看起来不像?


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

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


流浪文件摘录:

# 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.
#
# Do not share root directory of vagrant
config.vm.synced_folder '.', '/vagrant', disabled: true
# Share ruby repository directories
config.vm.synced_folder 'D:/git-repositories/+vm',
                        '/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
                        ]
4

1 回答 1

3

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

请记住, Vagrantfile 在 drive letter 上I:\

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

流浪文件摘录:

# 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 总是将驱动器号放在指定路径的前面(可能是因为它正在检查该路径是否存在于本地文件系统上)

于 2016-06-07T17:30:34.533 回答