Page 1 of 1
how to get the hard disk's SN via the VBoxManage
Posted: 2. Jul 2009, 04:15
by xinbadaz
hi all,
i have some problem on setting the virtual hard disk's serial numer, the VBox pops up a error after i changed the hard disk's serial number via the VBoxManage and it can can't boot up.

- bootup_error.GIF (10.05 KiB) Viewed 13999 times
the hard disk setting is as below:

- hardDisk_setting.GIF (21.98 KiB) Viewed 14006 times
here also post the screen shot of the VBoxManage commands that i used:

- VBoxManageCommand.GIF (20.26 KiB) Viewed 14000 times
after i runed the setextradata command, i found the VBoxManage added a row to the xxx.xml, i highlight it in
red:
<ExtraData>
<ExtraDataItem name="GUI/LastCloseAction" value="powerOff"/>
<ExtraDataItem name="GUI/LastWindowPostion" value="320,236,720,442"/>
<ExtraDataItem name="GUI/Fullscreen" value="off"/>
<ExtraDataItem name="GUI/Seamless" value="off"/>
<ExtraDataItem name="GUI/AutoresizeGuest" value="on"/>
<ExtraDataItem name="GUI/MiniToolBarAutoHide" value="on"/>
<ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/>
<ExtraDataItem name="GUI/ShowMiniToolBar" value="yes"/>
<ExtraDataItem name="VBoxInternal/Devices/pii4ide/0/Config/PrimaryMaster/SerialNumber" value="NEWSERIALNUMBER"/>
</ExtraData>
so, the above is what i did, can anybody help to find out what's the mistake i made?
thanks a lot!
P.S. xxx is my VM's name, and "NEWSERIALNUMBER" is the new serial number.
btw, the vbox can boot up if i remove the above highlighed code from the xxx.xml.
Re: how to get the hard disk's SN via the VBoxManage
Posted: 2. Jul 2009, 21:07
by TerryE
I note that you have: VBoxInternal/Devices/pii4ide/0/Config/PrimaryMaster/SerialNumber.
This field is either piix3ide or possibly piix4ide. I suggest that you try both.
BTW where did you find out about this? AFAIK, it isn't documented anywhere and can only be determined by reverse engineering the code?
Re: how to get the hard disk's SN via the VBoxManage
Posted: 3. Jul 2009, 02:39
by xinbadaz
Hi TerryE,
Thanks for your reply, but the VM still can not boot up with piix3ide or piix4ide.
Below is the screenshot, any other way to change the harddisk's serial number?

- VBoxManageCommand2.GIF (41.46 KiB) Viewed 13979 times
BTW, the commad is from your previous reply, and the topic is "
[Solved] How to change the virtualbox harddisk ID?"
Below is the URL:
http://forums.virtualbox.org/viewtopic. ... 880#p81331
Re: how to get the hard disk's SN via the VBoxManage
Posted: 3. Jul 2009, 11:51
by TerryE
Out of interest, I used VBoxManage to set my HD serial number and here are the relevant extradata enumerations:
and if I run a
sudo hdparm -i /dev/sda in my guest I do get the right HD identification:
/dev/sda:
Model=TERRYS-DISK , FwRev=1.0 , SerialNo=TE0aa99aa9-444488888
Config={ Fixed }
RawCHS=3900/16/63, TrkSize=0, SectSize=512, ECCbytes=0
BuffType=DualPortCache, BuffSize=256kB, MaxMultSect=128, MultSect=?128?
CurCHS=3900/16/63, CurSects=3931200, LBA=yes, LBAsects=3932160
IORDY=yes, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5 udma6
AdvancedPM=no WriteCache=enabled
Drive conforms to: unknown: ATA/ATAPI-1,2,3,4,5,6
* signifies the current active mode
Also note that this is a PIIX4 controller. The
piix3ide in this enumeration refers to the base driver and is
piix3ide for both PIIX3 and PIIX4 controller types. In fact setting the type changes the key /Devices/piix3ide/0/Config/Type which can either be
PIIX3 or
PIIX4 for this driver.
However, on rereading your OP, I do wonder if you are getting H/W serial number confused with UUIDs. The H/W serial number is nothing to do with the data content of the disk. For real HDs, it is in the firmware eprom. Some S/W licensing schemes link their activation keys to the H/W serial number of the system disk.
The
VERR_PDM_DEVICE_NOT_FOUND error is nothing to do with H/W serial numbers. It can be due to a race condition in the host driver caused by the VM responding too fast to the host driver request. See UG 11.2.2 Windows 2000 installation failures for one example. There are other cases.
So I guess we should "go back to the drawing board". What are you trying to do: what guest OS are you running, what is the context (e.g. are you trying to install? Has this VM previously worked,... All the stuff we ask for in the FPG.
Re: how to get the hard disk's SN via the VBoxManage
Posted: 6. Jul 2009, 06:02
by xinbadaz
Hi TeeryE,
Thanks for you reply.
Both the host and guest OS are windows XP SP2.
The piix3ide in the enumeration should be identical with the one in the VM's setting, right?
and i just keep the IDE Control Type in the VM's settings, don't change it (PIIX4).
Do you know why I can't get the virtual hard disk's serial number on the host, the VBoxManage just returns "No value set", but i can read it ("VBb3f79cfe-09f99f69") on the guest OS using a software, I suppose the VBoxManage should return the default serial number too.
Re: how to get the hard disk's SN via the VBoxManage
Posted: 6. Jul 2009, 11:54
by TerryE
You don't seem to have reacted to my point that what you are trying to do is nothing to
As to this SerialNumber setting, you had a typo in you extradata command before. My quoted example worked fine. Why not just quote your enumeration?
Re: how to get the hard disk's SN via the VBoxManage
Posted: 6. Nov 2009, 19:12
by marlin
Hi TerryE,
well i have tried the same as you described, some replys above.
I have tried following
> VBoxManage setextradata "<ApplianceName>" "VBoxInternal/Devices/pii3ide/0/Config/PrimaryMaster/SerialNumber" "<SERIALNUMBER>"
> VBoxManage setextradata "<ApplianceName>" "VBoxInternal/Devices/pii3ide/0/Config/PrimaryMaster/ModelNumber" "<MODELNUMBER>"
The XML-File will be set accordingly. But when i start the VM i've got the same VERR_PDM_DEVICE_NOT_FOUND
error message. It do not depends on the host OS, becuase i have tried it on Windows and Linux.
Is the a defined syntax for the SERIALNUMBER/MODELNUMBER? I have used different strings.
;? I have no idea what i have made wrong.
regards
marlin