Sometimes you want to test how an operating system will behave if you act like you're using a different computer model than you really are. For those cases, libvirtd with KVM comes in handy. We can change the model of our computer (the one returned by wmic csproduct get name
, specifically) very easily. This can be used with machines created in virt-manager, but the application itself does not provide this configuration for us.
First, open up your configuration with the following command:
virsh edit [VM name]
Now we only need to add a few lines of configuration to the file. Inside the <os>
tag, add the following:
<smbios mode='sysinfo'/>
Now to change the model of the PC, we'll want to add a <sysinfo>
entry. This goes inside the <domain>
tags, so the second-to-top level of the configuration file:
<sysinfo type='smbios'>
<system>
<entry name='product'>I built this computer</entry>
</system>
</sysinfo>
Close the file to have virsh
verify your changes, then boot your VM. Enjoy your custom computer model!
This file references the domain format documentation for libvirt, there are many more sysinfo fields that you can fill in: https://libvirt.org/formatdomain.html#elementsSysinfo