New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd-detect-virt falsely detects "Microsoft" virtualisation #21468
Comments
Yep that's not quite right. @fbq please reopen, I guess your first version that checked for /dev/vmbus is a better alternative? |
I'd much prefer if we go by comparing strings, instead of relying on driver support. (i mean, it could be the kernel has vmbus support disabled, we still should be able to detect a microsoft virtualization) Can't we make the strings check more precise? i.e. obviously "Microsoft" is very generic a check. But making the string check more precise should get us there, no? What are the strings reported by Surface and the VM environment? |
I don't think vmbus can be disabled individually? It's enabled by building support for hyperv guest |
still, checking for devices sucks, since they might come late, think udev and so on. Also it requires special code and stuff. I much prefer identifying by strings. (And who knows, maybe some other VM env implements /dev/vmbus one day too? At least Synology NAS devices support "hyperv-enlightened" VMs that are actually backed by kvm) |
Sure, if there's an alternative it would be much better |
Checking for I just checked other fields in DMI, it turned out that we have string "Hyper-V" in the following fields
In my environment. We can detect whether it's a Hyper-V VM by checking whether |
Your PR already got merged. Please send a new follow-up PR! |
Use product_version instead of product_name in DMI table and the string "Hyper-V" to avoid misdetection. Fixes: systemd#21468 Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Use product_version instead of product_name in DMI table and the string "Hyper-V" to avoid misdetection. Fixes: #21468 Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Use product_version instead of product_name in DMI table and the string "Hyper-V" to avoid misdetection. Fixes: systemd#21468 Signed-off-by: Boqun Feng <boqun.feng@gmail.com> (cherry picked from commit 76eec06)
Version: 249.7
Downstream bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000396
systemd-detect-virt checks /sys/class/dmi/id/sys_vendor as part of its
attempt to detect if the system is virtualised. I am using a Surface
Laptop so sys_vendor returns "Microsoft Corporation" which (as far as I
can tell) the program assumes indicates the presence of hyper-v rather
than Microsoft produced hardware. One of the consequences is that
systemd units that won't run in a VM fail, such as thermald.
Afaics, this is a result of PR #20998
506bbc8
@fbq ^
The text was updated successfully, but these errors were encountered: