<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>found another bug, I've attached the patch</DIV>
<DIV> </DIV>
<DIV>two bugs:</DIV>
<DIV>(1) parent locators set to zero for base images</DIV>
<DIV>(2) block allocation table to be block-size aligned (2M)</DIV>
<DIV> </DIV>
<DIV>after these two fixes, vbox vhds works well on Hyper-V, I tested quite some large vhd files from p2v, all works fine now.</DIV>
<DIV> </DIV>
<DIV>These two fixes should be very safe to check in, (not sure if it may break snapshots, though)</DIV>
<DIV> </DIV>
<DIV>- hl<BR><BR>--- On <B>Tue, 10/13/09, Huihong Luo <I><huisinro@yahoo.com></I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>From: Huihong Luo <huisinro@yahoo.com><BR>Subject: Re: [vbox-dev] Fwd: VHD not readable by Hyper-V<BR>To: "vbox-dev@virtualbox.org" <vbox-dev@virtualbox.org><BR>Date: Tuesday, October 13, 2009, 1:40 PM<BR><BR>
<DIV id=yiv1333433458>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top>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<BR><BR>VBox The MS spec states:<BR><BR>
<STYLE>
<!--
#yiv1333433458  
 _filtered #yiv1333433458 {font-family:"MS Mincho";panose-1:2 2 6 9 4 2 5 8 3 4;}
 _filtered #yiv1333433458 {panose-1:2 2 6 9 4 2 5 8 3 4;}
#yiv1333433458  
#yiv1333433458 p.MsoNormal, #yiv1333433458 li.MsoNormal, #yiv1333433458 div.MsoNormal
        {margin:0in;margin-bottom:.0001pt;font-size:10.0pt;font-family:Arial;}
#yiv1333433458 p.DT, #yiv1333433458 li.DT, #yiv1333433458 div.DT
        {margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:9.0pt;margin-bottom:.0001pt;font-size:10.0pt;font-family:Arial;font-weight:bold;}
#yiv1333433458 p.DL, #yiv1333433458 li.DL, #yiv1333433458 div.DL
        {margin-top:0in;margin-right:0in;margin-bottom:4.0pt;margin-left:.25in;font-size:10.0pt;font-family:Arial;}
#yiv1333433458 span.DTChar
        {font-family:Arial;font-weight:bold;}
#yiv1333433458 span.DLChar
        {font-family:Arial;}
 _filtered #yiv1333433458 {margin:1.0in 1.25in 1.0in 1.25in;}
#yiv1333433458 div.Section1
        {}
-->
</STYLE>

<P class=DT>Parent Locator Entries</DIV>
<P class=DL>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. </DIV><BR><BR><BR>--- On <B>Tue, 10/13/09, Huihong Luo <I><huisinro@yahoo.com></I></B> wrote:<BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>From: Huihong Luo <huisinro@yahoo.com><BR>Subject: [vbox-dev] Fwd: VHD not readable by Hyper-V<BR>To: "vbox-dev@virtualbox.org" <vbox-dev@virtualbox.org><BR>Date: Tuesday, October 13, 2009, 6:49 AM<BR><BR>
<DIV id=yiv438658739>
<DIV><BR><BR>Sent from my iPhone</DIV>
<DIV><BR>Begin forwarded message:<BR><BR></DIV>
<BLOCKQUOTE type="cite">
<DIV><B>From:</B> Huihong Luo <<A rel=nofollow>huisinro@yahoo.com</A>><BR><B>Date:</B> October 13, 2009 6:35:42 AM PDT<BR><B>To:</B> Shu Wu <<A rel=nofollow>superwushu@gmail.com</A>><BR><B>Subject:</B> <B>Re: [vbox-dev] VHD not readable by Hyper-V</B><BR><BR></DIV></BLOCKQUOTE>
<DIV></DIV>
<BLOCKQUOTE type="cite">
<DIV>
<DIV>No problem with vpc, vbox also understands vhds from hyper-v<BR><BR></DIV>
<DIV>It is just that hyper-v doesn't understand vbox's vhd </DIV>
<DIV><BR>Sent from my iPhone</DIV>
<DIV><BR>On Oct 13, 2009, at 2:27 AM, Shu Wu <<A rel=nofollow></A><A rel=nofollow>superwushu@gmail.com</A>> wrote:<BR><BR></DIV>
<DIV></DIV>
<BLOCKQUOTE type="cite">
<DIV>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.<BR><BR>Cheers,<BR><BR>Wu Shu<BR><BR>
<DIV class=gmail_quote>2009/10/13 Klaus Espenlaub <SPAN dir=ltr><<A rel=nofollow></A><A rel=nofollow></A><A rel=nofollow>Klaus.Espenlaub@sun.com</A>></SPAN><BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV></DIV>
<DIV class=h5>Huihong Luo wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">None of vbox created vhd disk files are readable by 2008 Hyper-V.<BR> This is the error: "The file or directory is corrupted and unreadable"<BR> 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.<BR> If you know what might be wrong, pls post<BR></BLOCKQUOTE><BR></DIV></DIV>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.<BR><BR>Klaus<BR><BR><BR>_______________________________________________<BR>vbox-dev mailing list<BR><A rel=nofollow></A><A rel=nofollow></A><A rel=nofollow>vbox-dev@virtualbox.org</A><BR><A
 href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow></A><A href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow></A><A href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow>http://vbox.innotek.de/mailman/listinfo/vbox-dev</A><BR></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE>
<BLOCKQUOTE type="cite">
<DIV><SPAN>_______________________________________________</SPAN><BR><SPAN>vbox-dev mailing list</SPAN><BR><SPAN><A rel=nofollow></A><A rel=nofollow>vbox-dev@virtualbox.org</A></SPAN><BR><SPAN><A href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow></A><A href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow>http://vbox.innotek.de/mailman/listinfo/vbox-dev</A></SPAN><BR></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV><BR>-----Inline Attachment Follows-----<BR><BR>
<DIV class=plainMail>_______________________________________________<BR>vbox-dev mailing list<BR><A rel=nofollow>vbox-dev@virtualbox.org</A><BR><A href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow>http://vbox.innotek.de/mailman/listinfo/vbox-dev</A><BR></DIV></BLOCKQUOTE></TD></TR></TBODY></TABLE></DIV><BR>-----Inline Attachment Follows-----<BR><BR>
<DIV class=plainMail>_______________________________________________<BR>vbox-dev mailing list<BR><A href="http://us.mc343.mail.yahoo.com/mc/compose?to=vbox-dev@virtualbox.org" ymailto="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</A><BR><A href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank>http://vbox.innotek.de/mailman/listinfo/vbox-dev</A><BR></DIV></BLOCKQUOTE></td></tr></table>