From f7e5a9d199613a3d5388d12b4729fe2f801861eb Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Fri, 11 Nov 2022 10:32:32 -0800 Subject: [PATCH] Force LANG when executing commands This forces the LANG enviroment variable to be set to `"C"` when executing VBoxManage commands. Doing this prevents localization of output which causes failures of the VirtualBox driver when scanning for information. --- plugins/providers/virtualbox/driver/base.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/providers/virtualbox/driver/base.rb b/plugins/providers/virtualbox/driver/base.rb index c2f79e40b..57602b483 100644 --- a/plugins/providers/virtualbox/driver/base.rb +++ b/plugins/providers/virtualbox/driver/base.rb @@ -460,7 +460,9 @@ module VagrantPlugins end # Append in the options for subprocess - command << { notify: [:stdout, :stderr] } + # NOTE: We include the LANG env var set to C to prevent command output + # from being localized + command << { notify: [:stdout, :stderr], env: {LANG: "C"}} Vagrant::Util::Busy.busy(int_callback) do Vagrant::Util::Subprocess.execute(@vboxmanage_path, *command, &block)