diff --git a/lib/vagrant-lxc/provider.rb b/lib/vagrant-lxc/provider.rb index ab56279..dead6ab 100644 --- a/lib/vagrant-lxc/provider.rb +++ b/lib/vagrant-lxc/provider.rb @@ -36,7 +36,7 @@ module Vagrant def ensure_lxc_installed! begin - sudo_wrapper.run("/usr/bin/which", "lxc-create") + sudo_wrapper.run("which", "lxc-create") rescue Vagrant::LXC::Errors::ExecuteError raise Errors::LxcNotInstalled end diff --git a/lib/vagrant-lxc/sudo_wrapper.rb b/lib/vagrant-lxc/sudo_wrapper.rb index 406c0f0..f344d9f 100644 --- a/lib/vagrant-lxc/sudo_wrapper.rb +++ b/lib/vagrant-lxc/sudo_wrapper.rb @@ -14,7 +14,7 @@ module Vagrant def run(*command) options = command.last.is_a?(Hash) ? command.last : {} command.unshift @wrapper_path if @wrapper_path && !options[:no_wrapper] - execute *(['sudo'] + command) + execute *(['sudo', '/usr/bin/env'] + command) end private