使用联结文件夹时无法读取符号链接错误

时间:2016-06-16 08:15:53

标签: ubuntu permissions vagrant lamp vagrant-windows

我在Windows 10上。我有一个流浪盒,有以下vagrantfile配置:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.hostmanager.enabled = true
  config.hostmanager.manage_host = true
  config.hostmanager.ignore_private_ip = false
  config.hostmanager.include_offline = true

  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "ubuntu/trusty64"

  # Create a private network, which allows host-only access to the machine using a specific IP.
  config.vm.network "private_network", ip: "192.168.33.22"
  config.vm.hostname = "test.local"

  # Share an additional folder to the guest VM. The first argument is the path on the host to the actual folder.
  # The second argument is the path on the guest to mount the folder.
  config.vm.synced_folder "./", "/var/www/html", type: "virtualbox" 

  # Define the bootstrap file: A (shell) script that runs after first setup of your box (= provisioning)
  config.vm.provision :shell, path: "bootstrap.sh"

end

由此:

config.vm.synced_folder "./", "/var/www/html", type: "virtualbox" 

当然主流行文件文件夹中有public_html文件夹。 结构如下:

enter image description here

默认情况下这是有效的,但是我想在 e:\ vagrant \ lamp \ public_html 文件夹中建立不同文件夹的联结,但我得到了一个协议错误。

我运行以下命令来创建联结:

mklink /J e:\vagrant\lamp\public_html\ c:\xxx\xyz\public_html\

当然在windows中它可以工作,如果我打开public_html我得到了联结的内容,但VM机器无法访问它。

这是我在尝试通过SSH访问时看到的内容:

enter image description here

  

无法读取符号链接public_html:协议错误

我想知道,有没有办法访问流浪者盒子里的联合同步文件夹?这是一个权限问题,还是更多?

感谢您的帮助:)

1 个答案:

答案 0 :(得分:0)

与此同时,我找到了一个可能的解决方案。将同步文件夹类型更改为SMB似乎可以解决问题:

config.vm.synced_folder "./", "/var/www/html", type: "smb", mount_options: ["vers=3.02", "mfsymlinks"]

到目前为止它看起来不错,但我也对其他解决方案持开放态度。