diff --git a/lib/vagrant/util/safe_exec.rb b/lib/vagrant/util/safe_exec.rb index 37e6a38c3..f7f5bdb81 100644 --- a/lib/vagrant/util/safe_exec.rb +++ b/lib/vagrant/util/safe_exec.rb @@ -40,7 +40,15 @@ module Vagrant Process.wait(pid) end else - Kernel.exec(command, *args) + if Vagrant::Util::Platform.windows? + @@logger.debug("Converting command and arguments to single string for exec") + @@logger.debug("Command: `#{command.inspect}` Args: `#{args.inspect}`") + full_command = "#{command} #{args.join(" ")}" + @@logger.debug("Converted command: #{full_command}") + Kernel.exec(full_command) + else + Kernel.exec(command, *args) + end end rescue *rescue_from # We retried already, raise the issue and be done diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index fdaf3564e..7efb1a436 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -25,7 +25,6 @@ module Vagrant def initialize(*command) @options = command.last.is_a?(Hash) ? command.pop : {} @command = command.dup - @command = @command.map { |s| s.encode(Encoding.default_external) } @command[0] = Which.which(@command[0]) if !File.file?(@command[0]) if !@command[0] raise Errors::CommandUnavailableWindows, file: command[0] if Platform.windows?