这是我试过的代码
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"]
答案 0 :(得分:1)
您应该可以直接使用ruby获取用户的主目录 - Dir.home
config.vm.synced_folder "#{Dir.home}", "/home/vagrant/myHome" ...
应该获取当前用户的目录(也应该在Windows上运行)