From 64deb1ab9c9493263b7b322aa1fbd934061adbbe Mon Sep 17 00:00:00 2001 From: Joe Gillotti Date: Fri, 2 Jul 2021 22:22:55 +0000 Subject: [PATCH] Properly detect running as a Parallels guest --- src/Linfo/OS/Linux.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Linfo/OS/Linux.php b/src/Linfo/OS/Linux.php index 0a973bf5..6cc7ae03 100644 --- a/src/Linfo/OS/Linux.php +++ b/src/Linfo/OS/Linux.php @@ -1604,12 +1604,19 @@ public function getVirtualization() return array('type' => 'guest', 'method' => 'OpenVZ'); } + $bios_vendor = Common::getContents('/sys/devices/virtual/dmi/id/bios_vendor'); + // Veertu guest? - if (Common::getContents('/sys/devices/virtual/dmi/id/bios_vendor') == 'Veertu') { + if ($bios_vendor == 'Veertu') { return array('type' => 'guest', 'method' => 'Veertu'); } - // LXC guest? + // Parallels guest? + if (strpos($bios_vendor, 'Parallels') === 0) { + return array('type' => 'guest', 'method' => 'Parallels'); + } + + // LXC guest? if (strpos(Common::getContents('/proc/mounts'), 'lxcfs /proc/') !== false) { return array('type' => 'guest', 'method' => 'LXC'); }