Vagrant无法挂载共享文件夹-没有这样的文件或目录。

4

我有这个Vagrantfile

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty32"
  config.vm.hostname = "app.local"
  config.vm.network :private_network, ip: "192.168.20.20"

  config.vm.synced_folder ".", "/vagrant", :mount_options => ['dmode=774','fmode=775']

  config.vm.provider :virtualbox do |vb|
    vb.name = "MyBox"
    vb.memory = 512
    vb.cpus = 2
  end

  config.vm.provision :shell, path: "install.sh"
end

迄今为止我一直使用这个工具(在 UbuntuWindows 上)没有出现任何问题。在 Windows 10 上,我已经升级了 Oracle VM Virtual Box (5.1.16) 和 Vagrant (1.9.2),现在在尝试安装盒子时出现了以下错误:

Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the guest. This is not a bug in Vagrant and is usually caused by a faulty Vagrant box. For context, the command attempted was:

 mount -t vboxsf -o dmode=774,fmode=775,uid=1000,gid=1000 vagrant /vagrant

 The error output from the command was:
 : No such file or directory
我还看到了这个: > 主机上的GuestAdditions版本(5.1.16)和客户端(4.3.36)不匹配。 > * 停止VirtualBox Additions
然后似乎移除了GuestAdditions并安装了5.1.16版本,步骤结束为: > vboxadd.sh:正在构建Guest Additions内核模块。vboxadd.sh:启动VirtualBox Guest Additions。无法找到X.Org或XFree86窗口系统,跳过。
之后,我仍然得到以下信息: > 关于已安装的GuestAdditions版本,收到了不同的报告:
> 您的主机上的Virtualbox声称:4.3.36,虚拟机内的VBoxService声称:5.1.16。继续进行,假设VBoxService是正确的...
关于已安装的GuestAdditions版本,收到了不同的报告:
您的主机上的Virtualbox声称:4.3.36,虚拟机内的VBoxService声称:5.1.16。继续进行,假设VBoxService是正确的...
这是一个错误还是我做错了什么?

似乎Virtualbox 5.1.16中存在一个错误(也许只有在Windows 10上?)。 http://stackoverflow.com/questions/42796016/vagrant-unable-to-mount-shared-folders - Fender
@Fender,没错。不得不回到使用5.1.14。 - ali
1个回答

1

看起来这个问题在5.1.18中已经得到解决。更新到最新版本后,问题就被解决了。

变更日志(版本5.1.18):

  • 共享文件夹:修复了不区分大小写的文件名访问(5.1.16回归;仅限Windows客户机;错误#16549)
  • 共享文件夹:修复了对长路径的访问(5.1.16回归;仅限Windows客户机;错误#14651、#16564)

确实,长路径问题已经得到解决,终于。 - ali

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