Page 1 of 1

Disk read error occurrs while booting

Posted: 8. Nov 2012, 14:35
by John Oracle
My Windows XP VM will not boot. It displays the error message:

"A disk read error occurred
Press Ctrl+ Alt+Del to restart"

The machine was created using VMware Server, and plays fine in VMware Player. I have VMware VMs running Linux, Windows Server 2003 and 2008 R2 that I can run in VirtualBox. That is, I created machines in VirtualBox using the original VMDK files (not clones). However, the Windows XP VM is not working.

VBoxSVC.log says:
...
00:00:03.370000 Loading settings file "C:\Data\Virtual Machines\Windows XP\Windows XP.vbox" with version "1.12-windows"
00:00:25.272000 ERROR [COM]: aRC=VBOX_E_INVALID_VM_STATE (0x80bb0002) aIID={22781af3-1c96-4126-9edf-67a020e0e858} aComponent={Machine} aText={Machine is not locked for session (session state: Unlocked)}, preserve=false
00:00:25.694000 ERROR [COM]: aRC=VBOX_E_IPRT_ERROR (0x80bb0005) aIID={22781af3-1c96-4126-9edf-67a020e0e858} aComponent={SessionMachine} aText={Saved screenshot data is not available (VERR_NOT_SUPPORTED)}, preserve=false
...

Vbox.log says:
]...
00:00:03.278768 Guest Log: BIOS: ata0-0: PCHS=4161/16/63 LCHS=522/255/63 [1]
...
00:00:05.807246 Guest Log: BIOS: Booting from Hard Disk...
00:00:05.808962 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=0000000000000000 w=720 h=400 bpp=0 cbLine=0x0, flags=0x1
00:00:10.537215 Changing the VM state from 'RUNNING' to 'SUSPENDING'.

[1] I assume that PCHS = physical CHS and LCHS = logical CHS. CHS 4161/16/63 = 2,147,475,456 bytes, assuming that sector size = 512 bytes. The disk is actually 4 GB and is recognised as such in VirtualBox Manager, which I assume is because of the following lines in the .vmdk file:
# Extent description
RW 4193792 FLAT "Windows XP Professional-f001.vmdk" 0
RW 512 FLAT "Windows XP Professional-f002.vmdk" 0
RW 4192256 FLAT "Windows XP Professional-f003.vmdk" 0

How can I get the disk to boot in VirtualBox? I am trying to move from VMware to VirtualBox, but I cannot uninstall VMware until I solve this problem.

Re: Disk read error occurrs while booting

Posted: 8. Nov 2012, 16:38
by mpack
XP needs you to run MergeIDE before it can be easily migrated between different hardware platforms. Plus you should configure the guest to use an IDE disk controller.

You must also uninstall the VMware tools from inside the guest.

Also: VMs ported from VMWare typically need to have the "IO APIC" feature enabled.

Re: Disk read error occurrs while booting

Posted: 10. Nov 2012, 12:13
by John Oracle
I uninstalled VMware tools, ran MergeIDE, and enabled IO APIC. My VirtualBox and VMware machines are both using IDE. I still got the same error. By the way, it is not a BSOD and I don't get the opportunity to try safe mode. The error happens before that. When I have some time I will try booting from a Windows XP CD.

Re: Disk read error occurrs while booting

Posted: 10. Nov 2012, 12:55
by mpack
Did the VMWare VM use snapshots? If yes then those will need to be merged before you do anything else. You could also try export/import as an appliance, though I've never used it myself.

Re: Disk read error occurrs while booting

Posted: 10. Nov 2012, 17:55
by John Oracle
I did not use snapshots as part of my everyday work/testing/studies, but how can I tell?

By the way, I booted from an XP CD into a Recovery Console. My drive seems OK in the VirtualBox VM. Maybe if I go ahead and repair Windows it will "just work" and not mess up my programs, but I feel that there must be an easier way.

Re: Disk read error occurrs while booting

Posted: 10. Nov 2012, 20:51
by mpack
"Repair" in this context, is snake oil. Forget it. Even in the physical world that will not fix "Disk read errors".

The simplest solution is to run Disk2VHD inside the VMWare VM, imaging the entire system drive, writing the VHD to a shared folder or USB drive. Removing the VMware tools and running MergeIDE should be done first. Build a VirtualBox VM around the VHD.

Re: Disk read error occurrs while booting

Posted: 11. Nov 2012, 00:20
by John Oracle
I really do not think that that will work. Nothing is actually wrong with my disk. I can run the machine in VMware player. I mean not just boot; I can connect to the Internet and shared folders on the host (MS Networking not VMware shared folders), run MS Office apps, you name it.

As for building a VirtualBox VM around the disk, that is exactly what I did. The VMware machine and the VirtualBox machine are using the *same* disk located at \path\to\disk\not\copied\nor\cloned.vmdk. I have two Windows Server 2003 VMs and a Windows 2008 R2 VM that were originally created in VMware that I am now running in VirtualBox using this exact approach.

Now, if my problem is the one described in the "Hard Disk Support" at How to migrate existing Windows installations to VirtualBox, which MergeIDE is supposed to solve but didn't, then repairing Windows may help. Still, I will try your suggestion first.

Re: [SOLVED] Disk read error occurrs while booting

Posted: 11. Nov 2012, 11:44
by John Oracle
It worked. Thank you very much. That tip about Disk2VHD really should be in the "How to migrate ..." article in the VirtualBox wiki.

For the benefit of anyone trying to boot from a Windows XP VMware disk in a VirtualBox VM, the following instructions worked for me.

1) Run the VMware machine and uninstall VMware Tools and run MergeIDE.
2) Run Disk2VHD with "Prepare for use in Virtual PC" selected. Save the resulting VHD where you can access it on the host.
3) Boot from the VHD in your VirtualBox VM.
4) You will see a new entry to the Windows boot menu entitled "Disk2vhd Microsoft Windows XP Professional" as the first item. For what it is worth, in boot.ini the new entry is a copy of the old one with the extra parameters:
/KERNEL=ntkrnlpa.exe /HAL=halacpi.dll
5) Boot from the Disk2vhd item (to be safe; either boot menu item works for me now, but maybe it is necessary to select the Disk2vhd item the first time).

Thanks again.

Re: Disk read error occurrs while booting

Posted: 11. Nov 2012, 12:58
by mpack
Ok, however mostly for future readers: This success proves that you must indeed have been using snapshots in the original VM (rather: differencing disks of any kind), as that is the only thing really fixed by switching to a different imaging technique. The internally made VHD image would of course have been of the current disk state regardless of whether the VMDK you previously tried to use was the base or a child in the chain (I suspect the latter, hence it was missing its boot sector etc). "Repair" would certainly not have worked.

Disk2VHD is very convenient, however VHD itself is an unreliable format, prone to data loss catastophes. Now that you have a working disk I suggest that you clone the VHD using CloneVDI. This will give you a VDI, which is VirtualBox's native format and much more reliable.

I don't think that "Prepare for use in Virtual PC" thing was necessary (though thanks for drawing my attention to a new Disk2VHD feature), but as long as it doesn't involve installing the VPC tools then the advice shouldn't be harmful.

Re: Disk read error occurrs while booting

Posted: 11. Nov 2012, 17:27
by John Oracle
Converting the VHD was going to be my next step, but I needed to take a break from this problem.