From 05782f1d0e1b43e48400ebc885ad4a8b077bd0d6 Mon Sep 17 00:00:00 2001 From: "Yuya.Nishida" Date: Tue, 28 Jun 2016 01:41:29 +0900 Subject: [PATCH] A more reliable way to detect Ubuntu lsb_release command is included in lsb-release package. Sometimes this is not installed; ex: Docker official Ubuntu image. /etc/os-release is included in base-files package, so this is more reliable than lsb_release. --- 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 76244cb8c..9aeb7aa8a 100644 --- a/plugins/guests/ubuntu/guest.rb +++ b/plugins/guests/ubuntu/guest.rb @@ -2,7 +2,7 @@ module VagrantPlugins module GuestUbuntu class Guest < Vagrant.plugin("2", :guest) def detect?(machine) - machine.communicate.test("[ -x /usr/bin/lsb_release ] && /usr/bin/lsb_release -i 2>/dev/null | grep Ubuntu") + machine.communicate.test("test -r /etc/os-release && . /etc/os-release && test xubuntu = x$ID") end end end