diff --git a/plugins/guests/debian/guest.rb b/plugins/guests/debian/guest.rb index 6631bda6c..7fac75df0 100644 --- a/plugins/guests/debian/guest.rb +++ b/plugins/guests/debian/guest.rb @@ -4,7 +4,17 @@ module VagrantPlugins module GuestDebian class Guest < Vagrant.plugin("2", :guest) def detect?(machine) - machine.communicate.test("cat /etc/issue | grep 'Debian'") + machine.communicate.test <<-EOH.gsub(/^ {10}/, "") + if test -r /etc/os-release; then + source /etc/os-release && test xdebian = x$ID + elif test -x /usr/bin/lsb_release; then + /usr/bin/lsb_release -i 2>/dev/null | grep -q Debian + elif test -r /etc/issue; then + cat /etc/issue | grep 'Debian' + else + exit 1 + fi + EOH end end end