Thu, 19 Jun 2008

# How to fix "A disk read error occurred" in Virtualbox with a Windows XP image

If you encounter the error "A disk read error occurred" when trying to boot Windows XP off a raw disk image using Virtualbox (either directly using the write-through support or indirectly by booting a 1:1 copy), most probably the BIOS of the original system reported an odd drive geometry (C/H/S — Cylinders/Heads/Sectors).

To fix this, boot the physical system, go to the grub command line, type c to invoke the command prompt, and execute geometry (hd0). Write down the cylinders, heads and sectors values reported.

Back in your host system, open the .vmdk file using a normal text editor, scroll down to the end and adjust the following lines:

ddb.geometry.biosCylinders="1023"
ddb.geometry.biosHeads="240"
ddb.geometry.biosSectors="63"

(1023/240/63 are the values reported by the Lenovo X300 Notebook BIOS.)

Now try to boot Windows in the virtualized environment. In my case it worked right on the first try. The short explanation is that the Windows boot loader seems to have hard coded values for the drive geometry.

posted at 20:35 | path: /unix | permanent link to this entry

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.