Skip to content

Instantly share code, notes, and snippets.

@Vdragon
Created October 10, 2016 18:52
Show Gist options
  • Save Vdragon/d3221685cfc3d5fcd8f5f6fd370af053 to your computer and use it in GitHub Desktop.
Save Vdragon/d3221685cfc3d5fcd8f5f6fd370af053 to your computer and use it in GitHub Desktop.
clone-host-rom-information.bash
#!/usr/bin/env bash
# Refer Oracle VM VirtualBox Manual "Configuring the BIOS DMI information" section
# This script is proudly improved from the "Dualboot-Windows virtualisieren › Wiki › ubuntuusers.de" article:
# https://wiki.ubuntuusers.de/Dualboot-Windows_virtualisieren/
set -o errexit
VM_NAME="直接啟動主端安裝的 Microsoft Windows" # Name der Virtuellen Maschine
MOTHERBOARD_FIRMWARE_TYPE="efi" #pcbios for pc, efi for efi
CFG_PATH="VBoxInternal/Devices/$MOTHERBOARD_FIRMWARE_TYPE/0/Config"
call__VBoxManage_setextradata__command_to_do_the_work(){
local readonly VM_NAME="$1"
local readonly CONFIG_PATH="$2"
local readonly CONFIG_VALUE="$3"
VBoxManage setextradata "$VM_NAME" $CONFIG_PATH "$CONFIG_VALUE"
return
}
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBIOSVendor "string:American Megatrends Inc." # "Vendor" aus "dmidecode -t0"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBIOSVersion "string:S550CB.202" # "Version" aus "dmidecode -t0"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBIOSReleaseDate "string:03/18/2013" # "Release Date" aus "dmidecode -t0"
#call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBIOSReleaseMajor "2" # "Bios Revision 1. Zahl" aus "dmidecode -t0"
#call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBIOSReleaseMinor "3" # "Bios Revision 2. Zahl" aus "dmidecode -t0"
#call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBIOSFirmwareMajor "2" # "Firmware Revision 1. Zahl" aus "dmidecode -t0"
#call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBIOSFirmwareMinor "3" # "Firmware Revision 2. Zahl" aus "dmidecode -t0"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiSystemVendor "string:ASUSTeK COMPUTER INC." # "Manufacturer" aus "dmidecode -t1"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiSystemProduct "string:S550CB" # "Product Name" aus "dmidecode -t1"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiSystemVersion "string:1.0" # "Version" aus "dmidecode -t1"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiSystemSerial "string:D9N0CV06139536G" # "Serial Number" aus "dmidecode -t1"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiSystemSKU "string:ASUS-NotebookSKU" # "SKU Number" aus "dmidecode -t1"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiSystemUuid "string:9CDE5F00-1413-81E3-2B8B-D850E6086180" # "UUID" aus "dmidecode -t1"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiSystemFamily "string:S" # "Family" aus "dmidecode -t1"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBoardVendor "string:ASUSTeK COMPUTER INC." # "Manufacturer" aus "dmidecode -t2"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBoardProduct "string:S550CB" # "Product Name" aus "dmidecode -t2"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBoardVersion "string:1.0" # "Version" aus "dmidecode -t2"
#call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiBoardSerial "<EMPTY>" # "Serial Number" aus "dmidecode -t2"
#call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiChassisAssetTag "<EMPTY>" # "Asset Tag" aus "dmidecode -t3"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiChassisSerial "D9N0CV06139536G" # "Serial Number" aus "dmidecode -t3"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiChassisVendor "string:ASUSTeK COMPUTER INC." # "Manufacturer" aus "dmidecode -t3"
call__VBoxManage_setextradata__command_to_do_the_work "$VM_NAME" $CFG_PATH/DmiChassisVersion "string:1.0"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment