Oracle VM VirtualBox: Ticket #7325: Make virtual disk look like real diskhttps://www.virtualbox.org/ticket/7325
<p>
I have a bootloader program which I suspect hard-codes the ID of the hard drive its booting from.
</p>
<p>
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.
</p>
<p>
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.
</p>
<p>
How can I ensure that the virtual hard disk has a matching set of drive identifiers to the real physical hard disk.
</p>
<p>
Note I can't choose the identifiers, but I need to set the virtual ones to match the real ones.
</p>
en-usOracle VM VirtualBox/graphics/vbox_logo2_gradient.pnghttps://www.virtualbox.org/ticket/7325
Trac 0.12aeichnerThu, 19 Aug 2010 19:33:45 GMTstatus changed; resolution sethttps://www.virtualbox.org/ticket/7325#comment:1
https://www.virtualbox.org/ticket/7325#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>invalid</em>
</li>
</ul>
<p>
It is possible to configure the reported VPD (Vital product data) of the hard disk. See here <a class="ext-link" href="http://www.virtualbox.org/manual/ch09.html#changevpd"><span class="icon"> </span>http://www.virtualbox.org/manual/ch09.html#changevpd</a> for further instructions.
Please ask such questions in the forum the next time first instead of opening a ticket.
</p>
TicketcefnTue, 07 Sep 2010 14:53:20 GMThttps://www.virtualbox.org/ticket/7325#comment:2
https://www.virtualbox.org/ticket/7325#comment:2
<p>
Raising this as a ticket is really bad practice, sorry. I think I just ended up posting in the wrong bit of the website.
</p>
<p>
Following your advice, and as an answer to my own question, in my Ubuntu Lucid host OS I used...
</p>
<p>
hdparm -I /dev/sda
</p>
<p>
...to report the three important bits of information 'Serial' 'Model' and 'Firmware' I needed from my machine, then followed the instructions you provided at...
</p>
<p>
<a class="ext-link" href="http://www.virtualbox.org/manual/ch09.html#changevpd"><span class="icon"> </span>http://www.virtualbox.org/manual/ch09.html#changevpd</a>
</p>
<p>
...but modified to match my use of piix4ide instead of sata to execute as follows...
</p>
<p>
#!/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"
</p>
<p>
Confirmed by...
</p>
<p>
VBoxManage getextradata "VMName" enumerate
</p>
<p>
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.
</p>
<p>
I'll take this question to the forums as suggested.
</p>
TicketcefnTue, 07 Sep 2010 14:55:31 GMThttps://www.virtualbox.org/ticket/7325#comment:3
https://www.virtualbox.org/ticket/7325#comment:3
<p>
Here's a version of the script I used without the Wiki formatting messing it all up.
</p>
<pre class="wiki">#!/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"
</pre>
Ticket