From d0bc166e7e9f381be15791ebd1d0150ba17a66c0 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 18 May 2021 00:28:59 +0200 Subject: Compliment to #461 and #459: is_vm() also outputted 'kvm'. This should fix that. --- archinstall/lib/hardware.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index 8009e708..7c164096 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -109,9 +109,12 @@ def cpu_vendor() -> Optional[str]: def is_vm() -> bool: try: - subprocess.check_call(["systemd-detect-virt"]) # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine - return True + # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine + if b"".join(SysCommand("systemd-detect-virt")).lower() != b"none": + return True except: - return False + pass + + return False # TODO: Add more identifiers -- cgit v1.2.3-70-g09d2