Question

I wonder if its possible to symlink the public folder in a Vagrant / Chef setup so that it points to another folder.

e.g. I have my working directory ~/home/work/site and I create a Vagrant setup at ~/home/work/vm

I would like to symlink ~/home/work/vm/public to ~/home/work/site

Is this possible or do I need to have all the files in the Vagrant folder?

Thanks

Était-ce utile?

La solution

Your question is missing the details what you are really trying to do (as making symlinks on the host has nothing to do with Vagrant), but I guess you want to access the ~/home/work/site directory from the virtual machine. In this case read the synced folder documentation. For example:

Vagrant.configure("2") do |config|
  config.vm.synced_folder "../site", "/vagrant/public"
end

Of course you can select the guest path as you want. And even disable the default mount if you want (config.vm.synced_folder ".", "/vagrant", disabled: true).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top