Page 1 of 1
Support for VHD created with HyperV
Posted: 8. Jul 2009, 21:43
by hyperv
Hello,
I have the need to use VHDs created by HyperV (amd64 Guest Support) The VHDs are mostly build by MS as Demos. It would be ver fine to have support for this VHDs. Is this planned? When will this fixed? If yes I don't need any Server System as host on my labtop.
Thanks for Help.
Hyperv
Re: Support for VHD created with HyperV
Posted: 9. Jul 2009, 18:00
by Entegy
VirtualBox already has VHD support. Just go to the Media Manager and add it as a disk, then attach it to a virtual machine.
Unless of course, Sun broke it again in VB3. There was a weird glitch a in 2.1.X that prevented the addition of VHDs, yet VHDs in the Media Manager prior to upgrading to that version functioned fine.
Re: Support for VHD created with HyperV
Posted: 9. Jul 2009, 19:33
by Sasquatch
A user had problems with HyperV VHD files with VB too, and even VPC didn't work all that well with it. The version of the file is a bit different, so it's possible VB just can't work with it (yet).
Re: Support for VHD created with HyperV
Posted: 10. Jul 2009, 15:57
by hyperv
Entegy wrote:VirtualBox already has VHD support. Just go to the Media Manager and add it as a disk, then attach it to a virtual machine.
Unless of course, Sun broke it again in VB3. There was a weird glitch a in 2.1.X that prevented the addition of VHDs, yet VHDs in the Media Manager prior to upgrading to that version functioned fine.
Thats not the whole truth. I did exactly this what you desrcripe in your feed. But I get the well known "FATAL: no bootable media found." If I boot from an ISO with Vista Bits I can see my vhd but as unlocated disk space. No partition is seen.
That situation is very boring for me. I hope to have full VHD support. This would be for me an option to switch back from a server OS to a desktop OS.
Has someone any idea or any of the developers any comment or roadmap?
Re: Support for VHD created with HyperV
Posted: 10. Jul 2009, 16:56
by Sasquatch
Like I said, there is full VHD support, if it's for VPC. HyperV uses a new version for the file, just like how VMWare did. But the VMDK documentation is now open, so the Open Source community can use it for read and write access. Something that just isn't there for HyperV images.
Re: Support for VHD created with HyperV
Posted: 15. Sep 2009, 18:23
by EarthQ
Hi,
Can you actually see the VHD content if you boot from WinPE or a Linux Live distro, for example?
It may be the VHD format, but it also may be the OS installed, let's say, IO-APIC support may need to be anabled, and such.
You can try converting the Hyper-V VHD to VMDK and back to VHD using one of the tools available.
HTH.
Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 10:34
by Sasquatch
EarthQ wrote:Hi,
Can you actually see the VHD content if you boot from WinPE or a Linux Live distro, for example?
It may be the VHD format, but it also may be the OS installed, let's say, IO-APIC support may need to be anabled, and such.
You can try converting the Hyper-V VHD to VMDK and back to VHD using one of the tools available.
HTH.
Do you have any idea what you're talking about? If the format cannot be read by VB, it can't be read by any other OS or whatever. The data is inaccessible, how would you open something like that? The only way to get it to work for VB, is create a system image (not a virtual hard drive image) of the installed OS and restore that on a compatible format for the virtualization application.
Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 12:16
by EarthQ
Finally I had some time to test this out.
Using StarWind Converter (
http://www.starwindsoftware.com/downloa ... verter.exe) I was able to convert and sucessfully boot a WS2008 x86 VHD got from
http://www.microsoft.com/vhd (choose convert to VPC VHD).
The Hyper-V VHD has "wsv" (Windows Server Virtualization) as creator app in the VHD footer (see VHD specs), while the converted has "vpc" (Virtual PC)".
Unfortunatelly, directly patching the VHD rather than waiting for conversion does not work.
While Windows VPC (Win7) recognizes and boots Hyper-V VHD (x86), it stops recognizing it once the footer gets patched, and VirtualBox produces a nice BSOD
So there are more differences between VPC/VS and Hyper-V VHD format than just header/footer information, but at least VHD conversion WORKS.
I did not tested with x64 VHD yet, though.
Another story is that the guest OS boot properly (did not tested this so far).
When installing Hyper-V additions, HAL gets changed to IO-APIC HAL on Windows XP/2003.
If it is a Windows Vista, 2008, W7 or 2008 R2, it is supposed to have a single HAL (while ACPI is required), so it should be able to boot. However, XP/2003 will require a HAL change before they can boot properly.
That needs some more testing, although checking IO-APIC option should work
BTW, the Hyper-V VHD can be accessed by mounting it with VHDMount, usable in Windows 7 (included in Virtual Server 2005 R2 SP1) and Windows 7 native VHD support (this one needs the VHD not to be NTFS compressed).
HTH.
Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 17:44
by mpack
hyperv wrote:Thats not the whole truth. I did exactly this what you desrcripe in your feed. But I get the well known "FATAL: no bootable media found." If I boot from an ISO with Vista Bits I can see my vhd but as unlocated disk space. No partition is seen.
Beware: that indicates that the software you used to examine the HDD did not find a recognizable partition table on the virtual disk. It doesn't indicate anything wrong or different about the VHD structure, nor does it mean that a partition table isn't there.
Also, how precise was your comment? Did it see unallocated space, or did it see one big unrecognized partition filling the drive?
Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 19:51
by EarthQ
I can confirm that the conversion trick with SolarWind tool does the magic also for WS2008 Enterprise x64 VHD available at
http://microsoft.com/vhd (I am running Win7 x64 host, just in case it makes any difference to VB developers).
The point now is identify why VB does not recognize Hyper-V VHDs but once converted it does.
By looking at VHD specs and Hyper-V and converted VHD, both are supposed to use the same "VHD File Format Version", that is, 1.0.
But for some reason while VirtualPC/VirtualServer/Hyper-V/Windows 7 can recognize Hyper-V VHD (another thing is the ability to boot the OS inside), VB cannot recognize it. Maybe some unusual format checks in VB code?
HTH.
Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 19:55
by EarthQ
mpack wrote:hyperv wrote:Thats not the whole truth. I did exactly this what you desrcripe in your feed. But I get the well known "FATAL: no bootable media found." If I boot from an ISO with Vista Bits I can see my vhd but as unlocated disk space. No partition is seen.
Beware: that indicates that the software you used to examine the HDD did not find a recognizable partition table on the virtual disk. It doesn't indicate anything wrong or different about the VHD structure, nor does it mean that a partition table isn't there.
Also, how precise was your comment? Did it see unallocated space, or did it see one big unrecognized partition filling the drive?
I also saw this.
Diskpart tool shows the disk in its full size, as completely clean, no partitions at all. However, Win7/VHDMount shows the VHD content (Windows installation, boot loader, etc.). So it may have something to do with how VB reads probably MBR or how VB inteprets disk geometry that later gets wrongly exposed to the guest OS.
HTH.
Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 20:55
by mpack
EarthQ wrote:So it may have something to do with how VB reads probably MBR or how VB inteprets disk geometry that later gets wrongly exposed to the guest OS.
VBox does not care about, read, write, or interpret any part of the MBR in any way. The guest OS does all that.
Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 22:47
by EarthQ
Update:
After WS2008 x64 mini-setup, a window shows the following info:
Download update for VirtualBox VMM Device
VirtualBox VMM Device is not compatible with this version of Windows.
VirtualBox VMM has stopped working properly.
An update is available that solves this problem.
Click to download the update from the Sun Microsystems, Inc. website
The link points to
http://dlc-cdn-rd.sun.com/c1/virtualbox ... 5e824/.exe, that ends up downloading VB 2.2.2 .... Does it want me to install VB 2.2.2 inside VB 3.0.6?
I am ignoring this, and install additions.. works fine.
HTH.
Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 22:50
by EarthQ
EarthQ wrote:
The Hyper-V VHD has "wsv" (Windows Server Virtualization) as creator app in the VHD footer (see VHD specs), while the converted has "vpc" (Virtual PC)".
Unfortunatelly, directly patching the VHD rather than waiting for conversion does not work.
While Windows VPC (Win7) recognizes and boots Hyper-V VHD (x86), it stops recognizing it once the footer gets patched, and VirtualBox produces a nice BSOD
So there are more differences between VPC/VS and Hyper-V VHD format than just header/footer information, but at least VHD conversion WORKS.
I did not tested with x64 VHD yet, though.
I have reviewed VHD specs more carefully and found that there is a checksum in the VHD footer to update on any change. Lack of update the checksum too may be what made the VHD unusable... I'll give a try to direct VHD footer patching later ...

Re: Support for VHD created with HyperV
Posted: 16. Sep 2009, 23:19
by EarthQ
BTW,
Devs can add support for new platform code to VHD stuff

:
http://www.virtualbox.org/browser/trunk ... DDCore.cpp
#define VHD_PLATFORM_CODE_7I2K 0x3769326B <- VHD created by Windows 7
#define VHD_PLATFORM_CODE_WI2R 0x57693272
#define VHD_PLATFORM_CODE_WI2K 0x5769326B
#define VHD_PLATFORM_CODE_W2RU 0x57327275
#define VHD_PLATFORM_CODE_W2KU 0x57326B75
#define VHD_PLATFORM_CODE_MAC 0x4D163220
#define VHD_PLATFORM_CODE_MACX 0x4D163258
HTH