Vagrant - 无法从辅助驱动器同步文件夹

时间:2014-12-05 20:21:10

标签: windows ubuntu vagrant virtualbox

每当我运行vagrant up时,我都会遇到同样的错误:

$ vagrant up
Bringing machine 'www' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The host path of the shared folder is missing: /d/project

以下是我Vagrantfile中的相关设置:

config.vm.synced_folder "D:\\cq", "/var/www/project",
    owner: "www-data", group: "www-data"

我的目录设置有点奇怪,所以也许问题就在那里。我列出了我能想到的任何可能导致vagrant up失败的内容。

  • 我的项目位于D:\驱动器(不是主C:\驱动器)。
  • 源目录(java项目)包含在目标目录中。我想同步目标目录(包括子目录源)
  • 主机为Win7,每this article
  • 框为ubuntu/trusty64

我刚刚开始使用Vagrant,所以我确定我错过了一些显而易见的东西,但我的研究并没有发现任何有用的东西。我试过添加......

config.vm.provider :virtualbox do |vb|
    vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
end

...每https://github.com/fideloper/Vaprobash/issues/183,但无济于事。如果我还有其他任何可以解决此问题的方法,请告诉我们!

1 个答案:

答案 0 :(得分:1)

我复制了你的错误,它似乎与字符串格式有关。在Windows中,我使用的vagrant文​​件是这样的:

config.vm.synced_folder "d:/tmp", "/var/www/html"

尝试将路径更改为正斜杠并仅使用一个。另外我注意到错误消息在 / d / project 中查看,我应该理解的是 D:\ project 。该文件夹需要存在于您的驱动器中。

相关问题