Windows上的Vagrant'权限被拒绝'

Goo*_*tes 0 windows centos vagrant

我在Windows上通过Vagrant访问文件时遇到问题.我已经在OS X上使用它已经有一段时间了,我的Vagrantfile设置正确,每次都有效.

我已经向我的同事发送了相同的Vagrant文​​件,他在Windows上并且在尝试通过浏览器访问文件时收到"权限被拒绝".

为了清楚起见,服务器在访问浏览器中的"dev.local"而不是Vagrant本身时返回权限错误...这将是Windows上或VM内的配置错误.

VM是CentOS 6.5

Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "chef/centos-6.5"
  config.vm.network "private_network", ip: "192.168.33.21"
  config.vm.network :forwarded_port, guest: 80, host: 8080
  config.vm.provision :shell, :path => "install.sh"
  config.vm.hostname = "dev.local"
  config.vm.synced_folder ".", "/home", id: "vagrant", :nfs => false, :mount_options => ["dmode=777","fmode=777"]
  config.ssh.insert_key = false
  config.ssh.username = "vagrant"
  config.ssh.password = "vagrant"
end
Run Code Online (Sandbox Code Playgroud)

任何Windows Vagrant用户都可以对此有所了解吗?

Goo*_*tes 7

这是VBGuestAdditions过时了.权限错误是由于无法同步到我的本地文件夹(包含index.php)引起的,所以它使用的server/home文件夹中没有任何内容,因为查看目录结构已禁用,它返回了权限错误.

我安装了4.XX,VirtualBox在5.XX上这是修复:

运行命令: vagrant plugin install vagrant-vbguest

由于vagrant up插件无法复制文件,可能仍会抛出错误的运行.

vagrant ssh 进入框并运行以下命令:

sudo ln -s /opt/VBoxGuestAdditions-5.X.X/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

将5.XX替换为VirtualBox的版本.

注销并运行 vagrant reload

做一个快乐的舞蹈