How can I change the BIOS serial number in VirtualBox?
VirtualBox sets the BIOS serial number of every VM instance to 0. It seems to be possible to change some BIOS settings, but I haven't seen anything that directly references the serial number.
Can anyone suggest a way to do this?
Solution 1:
http://www.virtualbox.org/manual/ch09.html#changedmi
Really has detailed answer for this.
You can set the bios serial number by doing this:
VBoxManage setextradata "VM name"
"VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "System Serial"
The error you were getting is caused by the serial not being set as a string value, if you have a pure number you should prepend it with string:
like so:
VBoxManage setextradata "VM name"
"VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "string:1234"
Note: In case your VM is configured to use EFI firmware you need to replace pcbios by efi in the keys.
Solution 2:
Not from any external settings. But you can from the code and then build it yourself:
Source file: DevPcBios.cpp
Line: 1014 READCFGSTR("DmiSystemSerial", pszDmiSystemSerial, "0");
Change "0" to whatever value you need.
EDIT: You can apparently use VBoxManage setextradata. I have used it in the past for other type of configurations (not bios related) and didn't test this particular setting. Give it a go:
VBoxManage setextradata *YourVMName* VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial "*yourserial*"
Otherwise... revert back to source code editing and building.
Best of luck.
Solution 3:
If you run that command, and get the error referenced by Roger, you need to back out the command by running the command without the last parameter (VALUE).
This removes the entry causing the error.
If you are unsure of what the last offending command was, open the ~~~.vbox (XML) file in the root of the VirtualMachines folder of the specific VM and review the EXTRADATA section.
Running the command-line call to vboxmanage is the best way to modify these. Editing the xml file does not stick 100% of the time.
Solution 4:
The accepted answer didn't update the serial number correctly for me; instead, I followed these steps to successfully update the serial number. Note the guest OS was macOS and the host was windows.
NOTE: You must close virtualbox before running this command for it to be saved.
- Open the windows command prompt as administrator
cd "C:\Program Files\Oracle\VirtualBox\"
-
VBoxManage.exe setextradata "VM NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" "SERIAL_HERE"
see source.*
Not sure why the pcbios command didn't work but efi did.
HELPFUL LINKS
- If you have trouble finding a valid serial follow the instructions here.
- If you're not sure what your vm name is run
VBoxManage.exe list vms
.
Solution 5:
Try using a serial number that contains 20 byte hexadecimal string:
VBoxManage setextradata "VM name" "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" "serial"
(Reference)