无法在Vagrant中同步主目录

时间:2017-07-20 17:10:01

标签: vagrant vagrantfile vagrant-provision

这是我试过的代码

config.vm.synced_folder ENV['HOME'], "/home/vagrant/myHome", :mount_options => ["dmode=777,fmode=777"]


 config.vm.synced_folder "~", "/home/vagrant/myHome", :mount_options => ["dmode=777,fmode=777"]

1 个答案:

答案 0 :(得分:1)

您应该可以直接使用ruby获取用户的主目录 - Dir.home

config.vm.synced_folder "#{Dir.home}", "/home/vagrant/myHome" ...

应该获取当前用户的目录(也应该在Windows上运行)