From 0b9b6c53a9ff72cfd2630f9adb832e15bccb0e55 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Sat, 26 Oct 2013 14:15:10 -0700 Subject: [PATCH] Detect virtualbox guests via dmidecode so guest additions aren't required --- lib/ohai/plugins/linux/virtualization.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ohai/plugins/linux/virtualization.rb b/lib/ohai/plugins/linux/virtualization.rb index 95b57ef4b..c6fa9492d 100644 --- a/lib/ohai/plugins/linux/virtualization.rb +++ b/lib/ohai/plugins/linux/virtualization.rb @@ -56,9 +56,6 @@ elsif modules =~ /^vboxdrv/ virtualization[:system] = "vbox" virtualization[:role] = "host" - elsif modules =~ /^vboxguest/ - virtualization[:system] = "vbox" - virtualization[:role] = "guest" end end @@ -103,6 +100,11 @@ virtualization[:system] = "xen" virtualization[:role] = "guest" end + when /Manufacturer: Oracle Corporation/ + if so.stdout =~ /Product Name: VirtualBox/ + virtualization[:system] = "vbox" + virtualization[:role] = "guest" + end else nil end