From 4625d77072d2076e1b0d959f552d74a70a0734a9 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 1 May 2013 21:00:22 -0300 Subject: [PATCH] More reliable Ubuntu and Debian guest detection When dealing with lxc containers, '/proc/version' will have information about the host machine kernel that can possibly have information about an Ubuntu / Debian host, messing up with guest container detection. --- plugins/guests/debian/guest.rb | 2 +- plugins/guests/ubuntu/guest.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/guests/debian/guest.rb b/plugins/guests/debian/guest.rb index ec6b6a9a1..a7f3d65de 100644 --- a/plugins/guests/debian/guest.rb +++ b/plugins/guests/debian/guest.rb @@ -2,7 +2,7 @@ module VagrantPlugins module GuestDebian class Guest < Vagrant.plugin("2", :guest) def detect?(machine) - machine.communicate.test("cat /proc/version | grep 'Debian'") + machine.communicate.test("cat /etc/issue | grep 'Debian'") end end end diff --git a/plugins/guests/ubuntu/guest.rb b/plugins/guests/ubuntu/guest.rb index 35e3d30c9..ce6ab801a 100644 --- a/plugins/guests/ubuntu/guest.rb +++ b/plugins/guests/ubuntu/guest.rb @@ -6,7 +6,7 @@ module VagrantPlugins module GuestUbuntu class Guest < VagrantPlugins::GuestDebian::Guest def detect?(machine) - machine.communicate.test("cat /proc/version | grep 'Ubuntu'") + machine.communicate.test("cat /etc/issue | grep 'Ubuntu'") end def mount_shared_folder(name, guestpath, options)