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

标签 vagrant shared-directory vagrant-windows synced-folder

我有这个 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

到目前为止我使用的没有问题(在 Ubuntu 和 Windows 上)。在 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 versions on your host (5.1.16) and guest (4.3.36) do not match. * Stopping VirtualBox Additions



然后看起来 GuestAdditions 被删除并安装了 5.1.16 版本,步骤以:

vboxadd.sh: Building Guest Additions kernel modules. vboxadd.sh: Starting the VirtualBox Guest Additions. Could not find the X.Org or XFree86 Window System, skipping.



在此之后,我仍然得到:

Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 4.3.36 VBoxService inside the vm claims: 5.1.16 Going on, assuming VBoxService is correct... Got different reports about installed GuestAdditions version: Virtualbox on your host claims: 4.3.36 VBoxService inside the vm claims: 5.1.16 Going on, assuming VBoxService is correct...



这是一个错误还是我做错了什么?

最佳答案

看起来这是在 5.1.18 中修复的。更新到最新版本为我解决了这个问题。

Change Log (Version 5.1.18) :

  • Shared Folders: fixed case insensitive filename access (5.1.16 regression; Windows guests only; bug #16549)
  • Shared Folders: fixed access to long pathes (5.1.16 regression; Windows guests only; bugs #14651, #16564)

关于Vagrant 无法挂载共享文件夹 - 没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42789040/

相关文章:

python - 如果我使用 virtualenv,为什么还要使用 vagrant?

vagrant - Puppet 语法错误位于 '|'

javascript - 如何使用 JavaScript 访问共享/网络文件夹?

node.js - Vagrant 和 NPM 安装在共享文件夹上

node.js - 运行 Gulp 时为 "Unhandled stream error in pipe"和 "ENOTDIR: not a directory, open"

pip - 如何将 Vagrant 中的 CKAN 安装链接到主机操作系统中的克隆存储库?

chef-infra - 如何将 Berkshelf 与 Chef-solo 一起使用?

angular - ENOENT : no such file or directory, 重命名

ubuntu - GuzzleHttp\Exception\ConnectException : cURL error 6: Could not resolve host

linux - Vagrant provision 在没有明显原因的情况下无法执行下一个脚本