How to set customized BIOS strings to HVM VMs

How to set customized BIOS strings to HVM VMs

book

Article ID: CTX230618

calendar_today

Updated On:

Description

This article describes the method to set customized BIOS strings to HVM VMs through xe CLI of XenServer 7.3 and later, as well as how to get customized BIOS strings on these VMs.
 


Instructions

XenServer administrators can now use the xe CLI or the API to specify user-defined BIOS strings (for example, asset tags) on a HVM VM. This allows VM to behave more as a real machine. It also enables XenServer administrators to track assets more easily and leads to smoother management and licensing.
XenServer 7.3 and later support BIOS strings in compliance to SMBIOS 2.4 specification, you can refer to System Management BIOS for more details. The supported user-defined BIOS strings are:
BIOS String NameSMBIOS Structure
bios-vender
BIOS Information (Type 0)
bios-version
BIOS Information (Type 0)
system-manufacturer
System Information (Type 1)
system-product-name
System Information (Type 1)
system-version
System Information (Type 1)
system-serial-number
System Information (Type 1)
enclosure-asset-tag
System Enclosure or Chassis (Type 3)
Note:
  1. BIOS strings can only be set before the VM is booted for the first time, and can only be set in a single xe CLI or the API, not supported from XenCenter.
  2. Once set, BIOS strings can’t be changed.
  3. Valid values allowed to each BIOS strings are printable ANSII characters and the allowed maximum length is 512 characters. Invalid values in BIOS may lead to VM boot/media installation failures.
  4. The following VMs are not eligible for user-defined BIOS strings:
    • VMs that copied BIOS strings from host
    • VMs booting in UEFI
    • PV VMs (BIOS only exists with HVM VMs)
How to set user-defined BIOS strings via xe CLI
To install the media in HVM VM with customized BIOS, follow the procedure below:
  1. Run the vm-install command (without copy-bios-strings-from):
xe vm-install template=<template name> sr-name-label=<name of sr> new-name-label=<name for new VM>
This returns the UUID of the newly created VM.
For example:
[root@xrtuk-11-08 ~]# xe vm-install template=Windows\ 7\ \(64-bit\) sr-name-label=Local\ storage new-name-label=Win7
c9f2646f-8770-1b8d-de90-6c4a9bbf22bd
 
You can also create the new VM from XenCenter, make sure “Copy host BIOS strings to VM” and “Start the new VM automatically” is unchecked during the VM creation:

  1. To set user-defined BIOS strings, run the following command before starting the VM for the first time.
  • To set enclosure asset tag: 
xe vm-param-set uuid=<VM_UUID> bios-strings:enclosure-asset-tag=<VALUE>
  • You can also set multiple BIOS strings:
xe vm-param-set uuid=<VM_UUID> bios-strings:bios-vendor=<VALUE> \
bios-strings:bios-version=<VALUE> bios-strings:system-manufacturer=<VALUE> \
bios-strings:system-product-name=<VALUE> bios-strings:system-version=<VALUE> \
bios-strings:system-serial-number=<VALUE> bios-strings:enclosure-assettag=<VALUE>
For example:
xe vm-param-set uuid=c9f2646f-8770-1b8d-de90-6c4a9bbf22bd \
bios-strings:bios-vendor=vendor \
bios-strings:bios-version=2.4 \
bios-strings:system-manufacturer=DELL \
bios-strings:system-product-name=guest1 \
bios-strings:system-version=1.0 \
bios-strings:enclosure-asset-tag=abk58hr           
Note:
  • Once the user-defined BIOS strings are set, they cannot be modified.
  • You can decide on the number of parameters you wish to provide to set the user-defined BIOS strings. For the parameters not set, XenServer will set default values on VM’s first boot.
Warning:
It is your responsibility to:
  • Comply with any EULAs and standards for the values being set in VM's BIOS.
  • Ensure that the values you provide for the parameters are working parameters. Providing incorrect parameters can lead to boot/media installation failure. In case the BIOS string you set was wrong and caused VM unable to boot, the only way would be creating a new VM and provide correct values for BIOS to it.  
 
How to check user-defined BIOS strings on VMs
After you set the user-defined BIOS strings via command xe vm-param-set, you can check the customized BIOS string from VM parameter bios-strings. For example:
[root@xrtuk-11-08 ~]# xe vm-list uuid=c9f2646f-8770-1b8d-de90-6c4a9bbf22bd params=bios-strings
bios-strings (MRO)    : bios-vendor: vendor; bios-version: 2.4; system-manufacturer: DELL; system-product-name: guest1; system-version: 1.0; system-serial-number: ; enclosure-asset-tag: abk58hr; hp-rombios: ; oem-1: Xen; oem-2: MS_VM_CERT/SHA1/bdbeb6e0a816d43fa6d3fe8aaef04c2bad9d3e3d
You can also get the BIOS strings from inside the HVM VM:
  • For Linux HVM guests, run command “dmidecode”;
  • For Windows HVM guests, you can get the BIOS information from wmic utility, as well as registry key:
    • Take Winodws 7 64 bit HVM guest as an example, you can get BIOS strings from registry key under HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\BIOS:
  • You can also get BIOS information from wmic command, for example, run following command on windows CMD to get asset tag:

CMD> wmic SystemEnclosure get SMBIOSAssetTag

Or get BIOS strings from:
CMD> wmc bios

Issue/Introduction

This article describes the method to set customized BIOS strings to HVM VMs through xe CLI, as well as how to get customized BIOS strings on these VMs.