流浪汉 'permission denied' Windows

Vagrant 'permission denied' on Windows

我在 Windows 通过 Vagrant 访问文件时遇到问题。我已经在 OS X 上使用它很长一段时间了,我的 Vagrantfile 设置正确,每次都能正常工作。

我已经向我的同事发送了相同的 Vagrant 文件,他在 Windows 上并在尝试通过浏览器访问文件时收到 'Permission Denied'。

需要说明的是,在浏览器中访问 'dev.local' 时服务器会返回权限错误,而不是 Vagrant 本身...这将是 Windows 上或内部的配置错误虚拟机。

VM 为美分OS 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

任何 Windows Vagrant 用户都可以阐明这一点吗?

VBGuestAdditions 已过时。权限错误是由于无法同步到我的本地文件夹(其中包含 index.php)导致的,因此它使用的是不包含任何内容的服务器 /home 文件夹,并且由于查看目录结构被禁用,它返回了权限错误。

我安装了 4.X.X,并且 VirtualBox 已打开 5.X.X 这是修复方法:

运行 命令:vagrant plugin install vagrant-vbguest

运行 vagrant up 由于插件无法复制文件,可能仍会引发错误。

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

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

将 5.X.X 替换为您的 VirtualBox 版本。

注销和 运行 vagrant reload

跳个快乐的舞