diff --git a/lib/vagrant-lxc/provider.rb b/lib/vagrant-lxc/provider.rb index 03a4463..2ad6dfe 100644 --- a/lib/vagrant-lxc/provider.rb +++ b/lib/vagrant-lxc/provider.rb @@ -26,8 +26,12 @@ module Vagrant end def ensure_lxc_installed! - unless system("which lxc-version > /dev/null") - raise Errors::LxcNotInstalled + unless system("which lxc-version > /dev/null 2>&1") + begin + sudo_wrapper.run("which", "lxc-version") + rescue Vagrant::LXC::Errors::ExecuteError + raise Errors::LxcNotInstalled + end end end