From fa24dc82376faedded652d32bba80431b3637e9d Mon Sep 17 00:00:00 2001 From: Ryan Gerstenkorn Date: Mon, 30 Nov 2020 01:50:26 -0600 Subject: [PATCH] Add example config to disable default share When you use the default share the guest has access to the Vagrantfile on the host. Disabling the default share and using sharing another subfolder is an easy way to work around this. --- templates/commands/init/Vagrantfile.erb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/commands/init/Vagrantfile.erb b/templates/commands/init/Vagrantfile.erb index 5b9bff115..a9b33125d 100644 --- a/templates/commands/init/Vagrantfile.erb +++ b/templates/commands/init/Vagrantfile.erb @@ -54,6 +54,13 @@ Vagrant.configure("2") do |config| # argument is a set of non-required options. # config.vm.synced_folder "../data", "/vagrant_data" + # Disable the default share of the current code directory. Doing this + # provides improved isolation between the vagrant box and your host + # by making sure your Vagrantfile isn't accessable to the vagrant box. + # If you use this you may want to enable additional shared subfolders as + # shown above. + # config.vm.synced_folder ".", "/vagrant", disabled: true + # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. # Example for VirtualBox: