无法在 Vagrant 中同步主目录

Unable to sync home directory in Vagrant

这是我试过的代码

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"]

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

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

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