[vbox-dev] fixed - VHD not readable by Hyper-V

Huihong Luo huisinro at yahoo.com
Wed Oct 14 03:56:53 GMT 2009


found another bug, I've attached the patch
 
two bugs:
(1) parent locators set to zero for base images
(2) block allocation table to be block-size aligned (2M)
 
after these two fixes, vbox vhds works well on Hyper-V, I tested quite some large vhd files from p2v, all works fine now.
 
These two fixes should be very safe to check in, (not sure if it may break snapshots, though)
 
- hl

--- On Tue, 10/13/09, Huihong Luo <huisinro at yahoo.com> wrote:


From: Huihong Luo <huisinro at yahoo.com>
Subject: Re: [vbox-dev] Fwd: VHD not readable by Hyper-V
To: "vbox-dev at virtualbox.org" <vbox-dev at virtualbox.org>
Date: Tuesday, October 13, 2009, 1:40 PM






I found the vhd bug on vbox implementation. vbox mistakenly sets parent locators ("wi2r", etc.) for base vhd image. If setting these fields to zeros for base image, Hyper-V is happy. Should be very easy to fix, if you need the code diff, let me know

VBox The MS spec states:






Parent Locator Entries
These entries store an absolute byte offset in the file where the parent locator for a differencing hard disk is stored. This field is used only for differencing disks and should be set to zero for dynamic disks. 


--- On Tue, 10/13/09, Huihong Luo <huisinro at yahoo.com> wrote:


From: Huihong Luo <huisinro at yahoo.com>
Subject: [vbox-dev] Fwd: VHD not readable by Hyper-V
To: "vbox-dev at virtualbox.org" <vbox-dev at virtualbox.org>
Date: Tuesday, October 13, 2009, 6:49 AM





Sent from my iPhone

Begin forwarded message:



From: Huihong Luo <huisinro at yahoo.com>
Date: October 13, 2009 6:35:42 AM PDT
To: Shu Wu <superwushu at gmail.com>
Subject: Re: [vbox-dev] VHD not readable by Hyper-V





No problem with vpc, vbox also understands vhds from hyper-v


It is just that hyper-v doesn't understand vbox's vhd 

Sent from my iPhone

On Oct 13, 2009, at 2:27 AM, Shu Wu <superwushu at gmail.com> wrote:




Can your VHD disk be read by Virtual PC or Virtual Server? It seems that Hyper-V and Virtual-PC share the same vhd format. One year ago I wrote my own program to generate a vhd file and make it to be accepted by Virtual PC, just following the official vhd specification. But I haven't tested it on Hyper-V.

Cheers,

Wu Shu


2009/10/13 Klaus Espenlaub <Klaus.Espenlaub at sun.com>




Huihong Luo wrote:

None of vbox created vhd disk files are readable by 2008 Hyper-V.
 This is the error: "The file or directory is corrupted and unreadable"
 I am debugging through the code, trying to change Footer info, such as version, creator OS, checksun, etc., to see it can correct the error.
 If you know what might be wrong, pls post

We only know what Microsoft documents in their VHD format spec, which we believe to have correctly implemented. However as usual those specs are incomplete and not really precise, so there's plenty of room for different interpretations.

Klaus


_______________________________________________
vbox-dev mailing list
vbox-dev at virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev



_______________________________________________
vbox-dev mailing list
vbox-dev at virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev

-----Inline Attachment Follows-----


_______________________________________________
vbox-dev mailing list
vbox-dev at virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev

-----Inline Attachment Follows-----


_______________________________________________
vbox-dev mailing list
vbox-dev at virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20091013/b1ba3b40/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VHDHDDCore.patch
Type: application/octet-stream
Size: 1662 bytes
Desc: not available
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20091013/b1ba3b40/attachment.obj>


More information about the vbox-dev mailing list