diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 07ec0ac94..e70e99d6e 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -107,7 +107,8 @@ module Vagrant @provider_config = provider_config @provider_name = provider_name @provider_options = provider_options - @ui = Vagrant::UI::Prefixed.new(@env.ui, @name) + @ui = @env.ui.is_a?(Vagrant::UI::MachineReadable) ? @env.ui.clone : Vagrant::UI::Prefixed.new(@env.ui, @name) + @ui.opts[:target] = name @ui_mutex = Mutex.new # Read the ID, which is usually in local storage @@ -188,7 +189,10 @@ module Vagrant end # Call the action - action_raw(name, callable, extra_env) + ui.machine("action", name.to_s, "start") + action_result = action_raw(name, callable, extra_env) + ui.machine("action", name.to_s, "end") + action_result end rescue Errors::EnvironmentLockedError raise Errors::MachineActionLockedError,