Page 2 of 2

Re: VBox 6.1.34 and Windows XP

Posted: 12. May 2022, 08:27
by MietekN
"geometry" tries to change the parameters but makes no changes:

Code: Select all

vbox-img info --filename "d:\VPC\Windows XP\Windows XP.vhd"
--- Dumping VD Disk, Images=1
Dumping VD image "d:\VPC\Windows XP\Windows XP.vhd" (Backend=VHD)
Header: Geometry PCHS=33288/16/63 LCHS=0/0/0 cbSector=512
Header: uuidCreation={4ce9fbcd-96d4-4a67-a2b6-ef9b4e051622}
Header: uuidParent={00000000-0000-0000-0000-000000000000}

vbox-img geometry --filename "d:\VPC\Windows XP\Windows XP.vhd"  --cylinders 1024 --heads 255 --sectors 63
Old image LCHS: 0/0/0
New image LCHS: 1024/255/63

vbox-img info --filename "d:\VPC\Windows XP\Windows XP.vhd"
--- Dumping VD Disk, Images=1
Dumping VD image "d:\VPC\Windows XP\Windows XP.vhd" (Backend=VHD)
Header: Geometry PCHS=33288/16/63 LCHS=0/0/0 cbSector=512
Header: uuidCreation={4ce9fbcd-96d4-4a67-a2b6-ef9b4e051622}
Header: uuidParent={00000000-0000-0000-0000-000000000000}

Re: VBox 6.1.34 and Windows XP

Posted: 12. May 2022, 10:26
by fth0
MietekN wrote:"geometry" tries to change the parameters but makes no changes
I tried it myself and got the same result. It doesn't persist on VHD images, but it does persist on VDI images. So, if you have no special reason to use the VHD format, you could convert the virtual hard disk image:

Code: Select all

cd "C:\Program Files\Oracle\VirtualBox"
vbox-img convert --srcfilename "VHD file" --dstfilename "VDI file"
vbox-img geometry --filename "VDI file" --cylinders 1024 --heads 255 --sectors 63
vbox-img info --filename "VDI file"
Note that you'll need additional host disk space for the converted image (at least temporarily). Afterwards, replace the virtual hard disk in the VM configuration.

Please let us know if this works for you. If not, I'll suggest another possible solution.

Re: VBox 6.1.34 and Windows XP

Posted: 12. May 2022, 10:56
by MietekN
I solved the problem by creating a new VHD of the same size and copying all the content with gparted. After creating the MBR on the new disk (fixmbr), the system works correctly.

Code: Select all

vbox-img info --filename "d:\VPC\Windows XP\Windows XP.vhd"
--- Dumping VD Disk, Images=1
Dumping VD image "d:\VPC\Windows XP\Windows XP.vhd" (Backend=VHD)
Header: Geometry PCHS=33288/16/63 LCHS=0/0/0 cbSector=512
Header: uuidCreation={74ade3e7-2f3c-499d-ab42-a01242ca249e}
Header: uuidParent={00000000-0000-0000-0000-000000000000}
Values are the same but works.

Re: VBox 6.1.34 and Windows XP

Posted: 12. May 2022, 11:52
by fth0
Thanks for sharing the info. The new MBR now has the expected End-CHS values 1023/254/63, so that the VirtualBox auto-detection (triggered by LCHS=0/0/0) works correctly. This is a viable alternative to disabling the auto-detection as suggested by me. Kudos for finding the solution. :)

Re: VBox 6.1.34 and Windows XP

Posted: 8. Jul 2022, 22:29
by klaus
Just investigated... the LCHS change with VHD images gets lost because the VHD format has no place for storing LCHS geometry. Just the PCHS geometry which is mostly useless.