vagrant 无法挂载共享文件夹

vagrant 无法挂载共享文件夹

这是我的 Vagrantfile:

Vagrant.configure("2") do |config|
    config.vm.box = "laravel/homestead"
    config.vm.network "private_network", ip: "192.168.33.10"
    config.vm.hostname = "vagrant"

    config.vm.synced_folder ".", "/root/shared", :mount_options => ["dmode=777", "fmode=666"]
end

这是我运行它时得到的输出:

https://pastebin.com/mXiv2EPw/?e=1

具体来说,有这样的情况:

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=777,fmode=666,uid=1000,gid=1000 root_shared /root/shared

The error output from the command was:

: No such file or directory

我照做了vagrant plugin install vagrant-vbguest,得到了这个:

Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.13.0)'!

我这样做了vagrant vbguest(显然虚拟机需要运行才能vagrant vbguest运行):

[default] GuestAdditions 5.1.16 running --- OK.

我在使用 scotch/box 时也遇到了这个错误:

Vagrant.configure("2") do |config|
    config.vm.box = "scotch/box"
    config.vm.network "private_network", ip: "192.168.33.10"
    config.vm.hostname = "vagrant"

    config.vm.synced_folder ".", "/root/shared", :mount_options => ["dmode=777", "fmode=666"]
end

我正在运行 laravel/homestead v2.0.0、VirtualBox 5.1.16 r113841(Qt5.6.2)和 Vagrant 1.9.3。

有任何想法吗?

答案1

看起来最新版本的 Virtualbox (5.1.18) 已经修复了这个问题。引用https://www.virtualbox.org/wiki/Changelog

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

相关内容