Support for VHD created with HyperV

Discussions related to using VirtualBox on Windows hosts.
Post Reply
hyperv
Posts: 2
Joined: 8. Jul 2009, 21:35
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Vista, XP W2K8

Support for VHD created with HyperV

Post 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
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Re: Support for VHD created with HyperV

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Support for VHD created with HyperV

Post 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).
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
hyperv
Posts: 2
Joined: 8. Jul 2009, 21:35
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Vista, XP W2K8

Re: Support for VHD created with HyperV

Post 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?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Support for VHD created with HyperV

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
EarthQ
Posts: 11
Joined: 15. Sep 2009, 18:19
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Support for VHD created with HyperV

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Support for VHD created with HyperV

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
EarthQ
Posts: 11
Joined: 15. Sep 2009, 18:19
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Support for VHD created with HyperV

Post 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 :roll:
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.
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: Support for VHD created with HyperV

Post 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?
EarthQ
Posts: 11
Joined: 15. Sep 2009, 18:19
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Support for VHD created with HyperV

Post 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.
EarthQ
Posts: 11
Joined: 15. Sep 2009, 18:19
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Support for VHD created with HyperV

Post 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.
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: Support for VHD created with HyperV

Post 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.
EarthQ
Posts: 11
Joined: 15. Sep 2009, 18:19
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Support for VHD created with HyperV

Post 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? :shock:

I am ignoring this, and install additions.. works fine.

HTH.
EarthQ
Posts: 11
Joined: 15. Sep 2009, 18:19
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Support for VHD created with HyperV

Post 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 :roll:
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 ... :mrgreen:
EarthQ
Posts: 11
Joined: 15. Sep 2009, 18:19
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Support for VHD created with HyperV

Post 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
Post Reply