diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index 0a7f08580..7802bee2e 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -83,11 +83,12 @@ module Vagrant # If we're in the installer and the command is NOT included # in the installer (external), then remove the DYLD_IMPORT_PATH # environmental variable to run into linker issues. [GH-2219] - if Vagrant.in_installer? + if Vagrant.in_installer? && ENV["VAGRANT_ORIGINAL_DYLD_LIBRARY_PATH"] installer_dir = ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"].to_s.downcase if !@command[0].downcase.include?(installer_dir) @logger.info("Command not in the installer. Removing DYLD_LIBRARY_PATH") - process.environment["DYLD_LIBRARY_PATH"] = "" + process.environment["DYLD_LIBRARY_PATH"] = + ENV["VAGRANT_ORIGINAL_DYLD_LIBRARY_PATH"] else @logger.debug("Command in installer, not touching env vars.") end