Error Reading from VHD

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Abe6393
Posts: 6
Joined: 18. May 2015, 06:01

Error Reading from VHD

Post by Abe6393 »

Hi! I've played with VM a little bit still a bit new to it but I understand the idea. Technical experience with it is barely any other then setting up a standard VM. I like to try and google my problems away but this time I can't. :/

I copied my old Win7 install into a VHD using Systeminternal's Dish2vhd. From what I have googled and can kind of understand is I think it's reading as a VDMK which according to help info is unsupported. I have checked and the drive is VHD. The drive was working on my old Windows 7 install but not now. I heard of something called UUID causing problems and that you need to copy the drive but it doesn't make sense if this is the first time on a new install of VM and Host OS. Also if this is the problem can someone point me to how to copy this? I see under File there is a Virtual Media Manager but there doesn't seem to be a way to point to my Win7 VHD. I have seen someone mention using HxD Disk Hex Editor to read/see/fix the problem. I got a copy but unfortunately no idea what I'm looking at. I can't read Hex. :(

I am running VirutalBox v4.3.10 r93012 on HOST OS Win7 Ulti (64-Bit) with i5 2500K and 32GB RAM

ERROR PROBLEM/CODE/INFO
Failed to open the hard disk file DZYFER-DESKTOP.VHD.
Could not open the medium 'DZYFER-DESKTOP.VHD'.
Failed to open image "DZYFER-DESKTOP.VHD" (VERR_SHARING_VIOLATION).
VD error VERR_SHARING_VIOLATION repairing corrupted image file 'DZYFER-DESKTOP.VHD' (VERR_SHARING_VIOLATION).

Result Code E_FAIL (0x80004005)
Component Medium
Interface IMedium {05f2bbb6-a3a6-4fb9-9b49-6d0dda7142ac}
Callee IVirtualBox {fafa4e17-1ee2-4905-a10e-fe7c18bf5554}
Callee RC VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Error Reading from VHD

Post by mpack »

Hmm. Quite a lot of misinformation in there.

Disk2VHD creates a VHD, not a VMDK. In any case both VHD and VMDK are supported formats, though VHD is not a good choice - personally I would convert it to the VBox native format, VDI - you can use CloneVDI to do that.

When using Disk2VHD you must ensure that you make a "whole disk" image. A partition image is never bootable.

UUID problems only occur when you copy (not clone) an existing virtual disk. The UUID is essentially an internal bar code that uniquely identifies that specific file - the barcode is created by the tool that creates the VHD (Disk2VHD in your case). If you simply copy the file using the host OS then you'll have two files with the same barcode, and VirtualBox doesn't like that. Cloning (i.e. copying with the correct tool) ensures that the barcode (UUID) is changed and hence there can be no conflicts.

As to your error: a sharing violation means that some other software already has that VHD open. For example if you had the VHD mounted in a host "virtual disk mount" tool then you would get this error when you tried to use the disk in VirtualBox. Another possibility is launching two VMs both using the same VHD file. Generally speaking, running two data cables to the same hard drive at the same time from different PCs does not auger well for the safety of any data on that drive. That's true even for virtual PCs.
Abe6393
Posts: 6
Joined: 18. May 2015, 06:01

Re: Error Reading from VHD

Post by Abe6393 »

TY. Like I said I'm still new to a lot of this.

Umm is there anyway that I can fix or check that out? It's not hooked up to any VM atm and I can't hook it up to any because of that error popping up. The VHD is or at least should be bootable because I tried it on my old windows install and it worked fine. Is it possible that it thinks it is still connected to something from my old windows install which is why it does not work on the new windows install?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Error Reading from VHD

Post by mpack »

Just rebooting the host should close any apps that are currently holding it open. I'm assuming that your user account has full access permissions on that file and folder.
Abe6393
Posts: 6
Joined: 18. May 2015, 06:01

Re: Error Reading from VHD

Post by Abe6393 »

Did a restart and same problem/error code as before. Checked permissions and such and I have full control. Only user on host with only one account which is mine.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Error Reading from VHD

Post by mpack »

Try using the host OS to copy the VHD somewhere else. That should either expose or bypass a sharing violation.

Or, clone the VHD using CloneVDI (I gave you the link above). Make sure the destination folder is somewhere else.

Another thought that strikes is: what did you output the VHD to when you used Disk2VHD? Hopefully it wasn't a FAT formatted external drive - CloneVDI should give you an error in that case.
Abe6393
Posts: 6
Joined: 18. May 2015, 06:01

Re: Error Reading from VHD

Post by Abe6393 »

Sry for having a late reply. I outputed the VHD to and internal drive. It is a 2TB SATA3 7200RPM Seagate drive formatted as NTFS.

I tried using CloneVDI the other day twice. It stopped at 50% with an error. I'll post the error later to get the exact error code/message. I have tried copying the file to another internal drive but keep having problems with. It seems to slow my system and break a couple programs like Firefox not responding. Adobe or shockwave crashing in chrome.

Currently copying it for the 3rd time. Started off with 30minutes now it's up to 23 hours. If it doesn't copy i'll try a cut job and if that doesn't work I will leave as is.

I ran systeminternal's process explorer to search for processes from the location and nothing seems to be hitting it or the drive it's on except itself.

Is there any other possibly things you can suggest if copy/cut/CloneDVI doesn't work?
Abe6393
Posts: 6
Joined: 18. May 2015, 06:01

Re: Error Reading from VHD

Post by Abe6393 »

Just got done trying to copy again. Tried a cutting and pasting to another location. Both more or less stopped about half way and firefox started messing up with no further progress. I tried CloneDVI again for the error message. Error message is just: Error - Drive Write Error.

After that I took and ran Error Checking on the Internal HDD that the VHD is on and everything seems clean. It did not report any errors but I used the default Microsoft one from properties so not exactly sure how good that is.

No ideas at this point other then trying to find a program to see the files inside of the VHD and possibly scraping it.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Error Reading from VHD

Post by mpack »

I'm afraid that it sounds like you have a faulty disk drive. I've had the same symptoms myself with a brand new but cheap (WD) 2TB internal drive. Yes, scrapping the VHD will quite possibly be necessary, but you should also take the PC along to someone who can confirm the drive fault.
Abe6393
Posts: 6
Joined: 18. May 2015, 06:01

Re: Error Reading from VHD

Post by Abe6393 »

I'll do what I can on scraping it. I guess you can lock, delete or w/e you need to this thread then since this will no longer be related to VM and would probably just get off track. TYVM for your help even tho we didn't get much stuff done.
Post Reply