Virtualbox Configuration

DMI Specific configuration

Recover most of the information needed for this modifications via commands below.

dmidecode -t0
dmidecode -t1
dmidecode -t2
dmidecode -t3
dmidecode -t4
dmidecode -t11 

Add custom DSDT tables.

VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/acpi/0/Config/CustomTable0" "DSDT.bin"

Add custom hard drive information.

VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" ""
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" ""
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" ""

Add custom system information.

VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersion" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSKU" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemFamily" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemUuid" "string:"

Add custom board information.

VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardVendor" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardProduct" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardVersion" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardSerial" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardAssetTag" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardLocInChass" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardBoardType" 10 

Add custom BIOS information.

VBoxManage setextradata "WindowsLab"  "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "string:"
VBoxManage setextradata "WindowsLab"  "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "string:"
VBoxManage setextradata "WindowsLab"  "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseDate" "string:"
VBoxManage setextradata "WindowsLab"  "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseMajor" 1
VBoxManage setextradata "WindowsLab"  "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseMinor" 9
VBoxManage setextradata "WindowsLab"  "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSFirmwareMajor" 9
VBoxManage setextradata "WindowsLab"  "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSFirmwareMinor" 8

Add custom chasis information.

VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiChassisVendor" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiChassisType" 1
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiChassisVersion" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiChassisSerial" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiChassisAssetTag" "string:" 

Add custom processor information.

VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiProcManufacturer" ""
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiProcVersion" ""
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiOEMVBoxVer" "string:"
VBoxManage setextradata "WindowsLab" "VBoxInternal/Devices/pcbios/0/Config/DmiOEMVBoxRev" "string:"

Network configuration

Change MAC address.

VBoxManage modifyvm "WindowsLab" --macaddress1 <MAC>

External devices configuration.

Add custom monitor modes.

VBoxManage setextradata "WindowsLab" "CustomVideoMode1" "1920x1080x16"
VBoxManage setextradata "WindowsLab" "CustomVideoMode2" "1920x1080x24"
VBoxManage setextradata "WindowsLab" "CustomVideoMode3" "1920x1080x32"
VBoxManage setextradata "WindowsLab" "CustomVideoMode4" "1366x768x16"
VBoxManage setextradata "WindowsLab" "CustomVideoMode5" "1366x768x24"
VBoxManage setextradata "WindowsLab" "CustomVideoMode6" "1366x768x32"
VBoxManage setextradata "WindowsLab" "CustomVideoMode7" "1280x768x16"
VBoxManage setextradata "WindowsLab" "CustomVideoMode8" "1280x768x24"
VBoxManage setextradata "WindowsLab" "CustomVideoMode9" "1280x768x32"
VBoxManage setextradata "WindowsLab" "CustomVideoMode10" "1280x800x16"
VBoxManage setextradata "WindowsLab" "CustomVideoMode11" "1280x800x24"
VBoxManage setextradata "WindowsLab" "CustomVideoMode12" "1280x800x32"

CPUID

Vendor string

Set the CPU vendor string to GenuineIntel. Remeber that the vendor string has to be 12 characters.

vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/00000000/ebx 0x756e6547
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000000/ebx 0x756e6547
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/00000000/edx 0x49656e69
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000000/edx 0x49656e69
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/00000000/ecx 0x6c65746e
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000000/ecx 0x6c65746e

Converting vendor string to hex values can be done with this bash script.

# The vendor string needs to have 12 characters!
vendor='GenuineIntel'
if [ ${#vendor} -ne 12 ]; then
    exit 1
fi
ascii2hex() { echo -n 0x; od -A n --endian little -t x4 | sed 's/ //g'; }

registers=(ebx edx ecx)
for (( i=0; i<${#vendor}; i+=4 )); do
    register=${registers[$(($i/4))]}
    value=`echo -n "${vendor:$i:4}" | ascii2hex`
    for eax in 00000000 80000000; do
        key=VBoxInternal/CPUM/HostCPUID/${eax}/${register}
        echo "$vm" $key $value
    done
done

List of possible vendor strings:

  • AMDisbetter! – early engineering samples of AMD K5 processor
  • AuthenticAMD – AMD
  • CentaurHauls – Centaur (Including some VIA CPU)
  • CyrixInstead – Cyrix
  • HygonGenuine – Hygon
  • GenuineIntel – Intel
  • TransmetaCPU – Transmeta
  • GenuineTMx86 – Transmeta
  • Geode by NSC – National Semiconductor
  • NexGenDriven – NexGen
  • RiseRiseRise – Rise
  • SiS SiS SiS – SiS
  • UMC UMC UMC – UMC
  • VIA VIA VIA – VIA
  • Vortex86 SoC – Vortex

Brand string

Set the CPU brand string to Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz. Remeber that the brand string has to be 47 characters.

vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000002/edx 0x20202020
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000002/ecx 0x49202020
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000002/ebx 0x6c65746e
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000002/eax 0x20295228
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000003/edx 0x65726f43
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000003/ecx 0x294d5428
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000003/ebx 0x2d356920
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000003/eax 0x30353238
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000004/edx 0x50432055
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000004/ecx 0x20402055
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000004/ebx 0x30362e31
vboxmanage setextradata "WindowsLab" VBoxInternal/CPUM/HostCPUID/80000004/eax 0x007a4847

Converting brand string to hex values can be done with this bash script.

# The brand string needs to have 47 characters!
# The null terminator is added automatically
brand="       Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz"
if [ ${#brand} -ne 47 ]; then
    exit 1
fi
ascii2hex() { echo -n 0x; od -A n --endian little -t x4 | sed 's/ //g'; }

eax_values=(80000002 80000003 80000004)
registers=(edx ecx ebx eax)
for (( i=0; i<${#brand}; i+=4 )); do
    eax=${eax_values[$((${i} / 4 / 4))]}
    register=${registers[$((${i} / 4 % 4 ))]}
    value=`echo -n "${brand:$i:4}" | ascii2hex`
    echo $register $value
done

Experimental

Prevent detection by CPUID check.

VBoxManage modifyvm "WindowsLab" --paravirtprovider legacy

Enable TSI. Did not use in my setup.

VBoxManage setextradata "$1" "VBoxInternal/TM/TSCTiedToExecution" 1

Resources: VirtualBox Manual