title: how to unlock a vagrant machine while it is being provisioned
body: <p>Our vagrant box takes ~1h to provision thus when <code>vagrant up</code> is run for the first time, at the very end of provisioning process I would like to package the box to an image in a local folder so it can be used as a base box next time it needs to be rebuilt. I'm using vagrant-triggers plugin to place the code right at the end of :up process.</p>
  
  <p>Relevant (shortened) Vagrantfile:</p>
  
  <pre><code>pre_built_box_file_name = 'image.vagrant'
  pre_built_box_path      = 'file://' + File.join(Dir.pwd, pre_built_box_file_name)
  pre_built_box_exists    = File.file?(pre_built_box_path)
  Vagrant.configure(2) do |config|
    config.vm.box     = 'ubuntu/trusty64'
    config.vm.box_url = pre_built_box_path if pre_built_box_exists
    config.trigger.after :up do
      if not pre_built_box_exists
        system("echo 'Building gett vagrant image for re-use...'; vagrant halt; vagrant package --output #{pre_built_box_file_name}; vagrant up;")
      end
    end
  end
  </code></pre>
  
  <p>The problem is that vagrant locks the machine while the current (<code>vagrant up</code>) process is running:</p>
  
  <pre><code>An action 'halt' was attempted on the machine 'gett',
  but another process is already executing an action on the machine.
  Vagrant locks each machine for access by only one process at a time.
  Please wait until the other Vagrant process finishes modifying this
  machine, then try again.
  </code></pre>
  
  <p>I understand the dangers of two processes provisioning or modifying the machine at one given time, but this is a special case where I'm certain the provisioning has completed.</p>
  
  <p>How can I manually "unlock" vagrant machine during provisioning so I can run <code>vagrant halt; vagrant package; vagrant up;</code> from within <code>config.trigger.after :up</code>?</p>
  
  <p>Or is there at least a way to start <code>vagrant up</code> without locking the machine?</p>