Skip to content

Instantly share code, notes, and snippets.

@W-Floyd
Created September 1, 2018 19:01
Show Gist options
  • Select an option

  • Save W-Floyd/7ccf5e4f074939e403bed483f82a4042 to your computer and use it in GitHub Desktop.

Select an option

Save W-Floyd/7ccf5e4f074939e403bed483f82a4042 to your computer and use it in GitHub Desktop.
Simple script to make a Virtualbox VM hidden enough to install SolidWorks
#!/bin/bash
__get_random_string () {
openssl rand -hex "${1}" | cut -c "1-${1}"
}
__my_vm='W10'
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "American Megatrends Inc"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "2.1.0"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "ASUSTek Computer"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "$(__get_random_string 9)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" "$(__get_random_string 20)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" "$(__get_random_string 8)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" "SEAGATE ST3750525AS"
exit
@SanZamoyski
Copy link
Copy Markdown

Thanks!

SW18, Win8.1:

#!/bin/bash
#https://gist.github.com/W-Floyd/7ccf5e4f074939e403bed483f82a4042

__get_random_string () {

    openssl rand -hex "${1}" | cut -c "1-${1}"

}

__my_vm='Windows8.1'

#my stuff
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "Dell"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "1.23"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseDate" "1/1/2001"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardVendor" "Dell"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardProduct" "DellBo"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardVersion" "1.1"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "A23456789"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" "091118FC1221NCJ6G8GG"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" "FC2ZF50B"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" "Hitachi SSD 2.1"
#eof my stuff

VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "American Megatrends Inc"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "2.1.0"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "ASUSTek Computer"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "$(__get_random_string 9)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" "$(__get_random_string 20)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" "$(__get_random_string 8)"
VBoxManage setextradata "${__my_vm}" "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" "SEAGATE ST3750525AS"

exit 

Worked for me.

@W-Floyd
Copy link
Copy Markdown
Author

W-Floyd commented Apr 19, 2021

Nice! Thanks for sharing! 😁

@memtech3
Copy link
Copy Markdown

How has your solidworks in virtualbox experience been? With bigger and more complex parts and assemblies, the virtual machine struggles to keep up (11 minutes to rebuild a change). I've been looking into jumping ship to KVM/QEMU/libvirt. Would you happen to have any advice on that front?

@W-Floyd
Copy link
Copy Markdown
Author

W-Floyd commented Jan 24, 2022

It was never that good to be honest. I haven't used it in a VM recently, but I only did so when I didn't want to reboot for some small jobs. Would love to revisit it some day though.

@SanZamoyski
Copy link
Copy Markdown

SanZamoyski commented Jan 25, 2022 via email

@SanZamoyski
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment