From 9cd9e6e55d802553fa90e63d966b302006b45de5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 3 Dec 2013 12:07:14 -0800 Subject: [PATCH] communicators/ssh: add -E to sudo to preserve env --- plugins/communicators/ssh/communicator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index 2d35adb3c..bb0ae252c 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -285,7 +285,7 @@ module VagrantPlugins # need to wrap the shell in a `sudo` call. shell_cmd = @machine.config.ssh.shell shell_cmd = shell if shell - shell_cmd = "sudo -H #{shell_cmd}" if sudo + shell_cmd = "sudo -E -H #{shell_cmd}" if sudo # Open the channel so we can execute or command channel = connection.open_channel do |ch|