From 779e54eef504113f82fe4e7912ddc7e63c08fd56 Mon Sep 17 00:00:00 2001 From: "Dr. Zarkov" Date: Fri, 26 Sep 2014 14:05:54 +0200 Subject: [PATCH] A more reliable way to detect Ubuntu The default /etc/issue might have been changed by the administrator and not contain the string 'Ubuntu' anymore. --- plugins/guests/ubuntu/guest.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/guests/ubuntu/guest.rb b/plugins/guests/ubuntu/guest.rb index 9e9a9a9ad..9295ede22 100644 --- a/plugins/guests/ubuntu/guest.rb +++ b/plugins/guests/ubuntu/guest.rb @@ -4,7 +4,7 @@ module VagrantPlugins module GuestUbuntu class Guest < Vagrant.plugin("2", :guest) def detect?(machine) - machine.communicate.test("cat /etc/issue | grep 'Ubuntu'") + machine.communicate.test("[ -x /usr/bin/lsb_release ] && /usr/bin/lsb_release -i 2>/dev/null | grep Ubuntu") end end end