---
# System prepended metadata

title: Fake Your VM as a Specified Machine
tags: [Virtual Machine, QEMU, DMI, BIOS]

---

# Fake Your VM as a Specified Machine

###### tags: `Virtual Machine` `QEMU` `BIOS` `DMI`

Softwares may have some special configuration for some special models/machines.  Checking the [DMI](https://en.wikipedia.org/wiki/Desktop_Management_Interface) is the common way to understand the model of the machine.  For example, Linux kernel checks the system's DMI for [ACPI boot quirks](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/acpi/boot.c?h=v5.15#n1374).

However, it is impossible to have all kinds of the machines on hands.  Faking a virtual machine is an economical way to have that specified model/machine.

According to [QEMU's document](https://www.qemu.org/docs/master/system/qemu-manpage.html?highlight=smbios), the **smbios** provides the way to set the virtual machine's *SMBIOS table*.  So that, the guest OS will read the table as it's DMI information.

For exampe, I would like to have a simulated virtual machine as an Acer Aspire Aspire ES1-533 laptop.
```
qemu-system-x86_64 -enable-kvm -m 4096 -smp 4 ~/Downloads/endless_disk.qcow2 -smbios type=1,manufacturer=Acer,product="Aspire ES1-533"
```
Now, we have the simulated virtual machine.  We can check the DMI information in the guest OS.
```shell=
$ sudo dmidecode -t 1
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.

Handle 0x0100, DMI type 1, 27 bytes
System Information
	Manufacturer: Acer
	Product Name: Aspire ES1-533
	Version: pc-i440fx-6.1
	Serial Number: Not Specified
	UUID: Not Settable
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified
```
The viratual machine's `Manufacturer` is `Acer` and `Product Name` is `Aspire ES1-533`!