Skip to content

[Bug]: virtual fact not working on Linux on Proxmox #130

Description

@matejzero

Is this a critical security issue?

  • This is not a security issue.

Describe the Bug

When using Linux on Proxmox hosts, facter reports VMs as physical.

Example for the manufacture under proxmoxr: QEMU

# facter dmi
{
  bios => {
    release_date => "04/01/2014",
    vendor => "SeaBIOS",
    version => "rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org"
  },
  chassis => {
    type => "Other"
  },
  manufacturer => "QEMU",
  product => {
    name => "Standard PC (i440FX + PIIX, 1996)",
    uuid => "4806f36a-e9dc-4cb7-a107-4945edb2733d",
    version => "pc-i440fx-10.1"
  }
}

Similar issues on Windows in BSD:

Expected Behavior

Linux on Proxmox should return virtual = kvm

Steps to Reproduce

Use proxmox / kvm as a hypervisor
use linux as your guest OS
fact returns physical

Environment

Facter: 5.6.1
OS: AlmaLinux 10
Proxmox: 9.1.1

Additional Context

I can try and make a PR, but I'm no ruby guy so I might need some guidance.

I check the code really quick. Should manufacturer check be done in

def kvm?
product_name = discover_hypervisor
bios_vendor = Facter::Resolvers::Linux::DmiBios.resolve(:bios_vendor)
@log.debug("Detected bios vendor: #{bios_vendor}")
Facter::Resolvers::VirtWhat.resolve(:vm) == 'kvm' ||
Facter::Resolvers::Lspci.resolve(:vm) == 'kvm' ||
bios_vendor&.include?('Amazon EC2') ||
bios_vendor&.include?('Google') ||
product_name&.include?('OpenStack')
end
like it is for windows version: https://github.com/Hedius/openfact/blob/8e7c3e146aba26ec0002ec9d62d69dea34e1058d/lib/facter/resolvers/windows/virtualization.rb#L52

Relevant log output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions