Force English output for VBoxManage. Fixes #2266

pull/2286/head
grossmj 8 months ago
parent 702fea89fb
commit ad47ffbe29

@ -109,9 +109,16 @@ class VirtualBox(BaseManager):
command = [vboxmanage_path, "--nologo", subcommand]
command.extend(args)
command_string = " ".join(command)
env = os.environ.copy()
env["LANG"] = "en" # force english output because we rely on it to parse the output
log.info("Executing VBoxManage with command: {}".format(command_string))
try:
process = await asyncio.create_subprocess_exec(*command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
process = await asyncio.create_subprocess_exec(
*command,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
env=env
)
except (OSError, subprocess.SubprocessError) as e:
raise VirtualBoxError("Could not execute VBoxManage: {}".format(e))

Loading…
Cancel
Save