From 911a44523c7df3fa457de06e00a8548f22a555d9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 7 Jul 2011 23:49:29 -0700 Subject: [PATCH] Create shared folders in VM customize block to reduce VirtualBox lock time. --- lib/vagrant/action/vm/share_folders.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/vagrant/action/vm/share_folders.rb b/lib/vagrant/action/vm/share_folders.rb index 8296250dc..ee24172cc 100644 --- a/lib/vagrant/action/vm/share_folders.rb +++ b/lib/vagrant/action/vm/share_folders.rb @@ -33,16 +33,16 @@ module Vagrant end def create_metadata - @env.ui.info I18n.t("vagrant.actions.vm.share_folders.creating") + @env["config"].vm.customize do |vm| + @env.ui.info I18n.t("vagrant.actions.vm.share_folders.creating") - shared_folders.each do |name, data| - folder = VirtualBox::SharedFolder.new - folder.name = name - folder.host_path = File.expand_path(data[:hostpath], @env.env.root_path) - @env["vm"].vm.shared_folders << folder + shared_folders.each do |name, data| + folder = VirtualBox::SharedFolder.new + folder.name = name + folder.host_path = File.expand_path(data[:hostpath], @env.env.root_path) + vm.shared_folders << folder + end end - - @env["vm"].vm.save end def mount_shared_folders