Ticket #7325 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

Make virtual disk look like real disk

Reported by: cefn Owned by:
Priority: minor Component: virtual disk
Version: VirtualBox 3.2.8 Keywords: bootloader disk id introspection config
Cc: Guest type: other
Host type: Linux


I have a bootloader program which I suspect hard-codes the ID of the hard drive its booting from.

I'm booting through virtualbox and through native boot from the same real partition, and I would like this bootloader to run without error both virtually and natively.

When it installs I think it introspects the disk for some id or another. Either the virtual machine or the real partition will refuse to boot if I ran the installer from the opposite one; it thinks its drive has gone missing.

How can I ensure that the virtual hard disk has a matching set of drive identifiers to the real physical hard disk.

Note I can't choose the identifiers, but I need to set the virtual ones to match the real ones.

Change History

comment:1 Changed 4 years ago by aeichner

  • Status changed from new to closed
  • Resolution set to invalid

It is possible to configure the reported VPD (Vital product data) of the hard disk. See here for further instructions. Please ask such questions in the forum the next time first instead of opening a ticket.

comment:2 Changed 4 years ago by cefn

Raising this as a ticket is really bad practice, sorry. I think I just ended up posting in the wrong bit of the website.

Following your advice, and as an answer to my own question, in my Ubuntu Lucid host OS I used...

hdparm -I /dev/sda report the three important bits of information 'Serial' 'Model' and 'Firmware' I needed from my machine, then followed the instructions you provided at...

...but modified to match my use of piix4ide instead of sata to execute as follows...

#!/bin/bash VBoxManage setextradata "VMName" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/SerialNumber" "091118FC1221NCJ6G8GG" VBoxManage setextradata "VMName" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/FirmwareRevision" "FC2ZF50B" VBoxManage setextradata "VMName" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/ModelNumber" "HITACHI HTD723216L9SA60"

Confirmed by...

VBoxManage getextradata "VMName" enumerate

This completed the changes of these three items in the relevant hard drive port of the VM, and it boots fine and reports the correct values. I'm still a little confused as to what the disk UUID is, and how this is set, if it's relevant, if it's likely to change between physical and virtual booting.

I'll take this question to the forums as suggested.

comment:3 Changed 4 years ago by cefn

Here's a version of the script I used without the Wiki formatting messing it all up.

VBoxManage setextradata "VMName" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/SerialNumber" "091118FC1221NCJ6G8GG"
VBoxManage setextradata "VMName" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/FirmwareRevision" "FC2ZF50B"
VBoxManage setextradata "VMName" "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/ModelNumber" "HITACHI HTD723216L9SA60"
Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use