Skip to content

Conversation

@val4oss
Copy link
Contributor

@val4oss val4oss commented Jul 31, 2025

Google Compute Engine are not only virtual but can be also physical machines. Therefore checking only the dmi is not enough to detect if it is a virtual machine. Therefore systemd-detect-virt return "google" instead of "none" in c3-highcpu-metal machine.
SMBIOS will not help us to make the difference as for EC2 machines. However, GCE use KVM hypervisor for these VM, we can use this information to detect virtualization. [0]

Issue and changes has been tested on SUSE SLE-15-SP7 images with systemd-254 for both GCE, bare-metal and VM.

[0] -
https://cloud.google.com/blog/products/gcp/7-ways-we-harden-our-kvm-hypervisor-at-google-cloud-security-in-plaintext

(cherry picked from commit fb71571)

[vlefebvre: fixes bsc#1244449]

@val4oss val4oss force-pushed the SUSE-v254-detect-virt-gce branch 2 times, most recently from d28187a to a862f26 Compare August 1, 2025 07:24
Google Compute Engine are not only virtual but can be also physical
machines. Therefore checking only the dmi is not enough to detect if it
is a virtual machine. Therefore systemd-detect-virt return "google"
instead of "none" in c3-highcpu-metal machine.
SMBIOS will not help us to make the difference as for EC2 machines.
However, GCE use KVM hypervisor for these VM, we can use this
information to detect virtualization. [0]

Issue and changes has been tested on SUSE SLE-15-SP7 images with
systemd-254 for both GCE, bare-metal and VM.

[0] -
https://cloud.google.com/blog/products/gcp/7-ways-we-harden-our-kvm-hypervisor-at-google-cloud-security-in-plaintext

(cherry picked from commit fb71571)

[vlefebvre: fixes bsc#1244449]
@val4oss val4oss force-pushed the SUSE-v254-detect-virt-gce branch from a862f26 to 1dccf18 Compare August 1, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant