Build .VHDs offline with Server Manager

A secret Windows Server 2008 R2/Windows 7 trick is that you can manage virtual hard disks without installing Hyper-V. Rick Vanover explains how to manage .VHDs in standalone fashion.

Microsoft's virtual hard disk format is the .VHD format; this is also the XenServer file extension, and it is a complement to the VMware .VMDK and VirtualBox .VDI disk formats. In Windows Server 2008 R2 and Windows 7, administrators can create and manipulate .VHD files quite easily, even on a physical server.

With the Server Manager snap-in, you can create and attach a .VHD file directly. Figure A shows the drop-down box where a .VHD file can be created and attached. Figure A

The option to create a .VHD file can be used as a nice handoff to a virtual machine that has yet to be built.

There are two options for creating a .VHD file: dynamically expanding or fixed size. Dynamically expanding will do a thin provisioning of the virtual disk, and fixed size will allocate the entire amount of virtual disk at once. For most situations, I recommend dynamically expanding virtual disks. Figure B shows the creation window for a new virtual disk. Figure B

Once the new .VHD file is created, the disk can be initialized within the Windows Server, as it is enumerated as a new Virtual Disk SCSI Disk Device in the native driver stack of Windows, but it may be referred to as the Microsoft VHD HBA driver. Figure C shows this newly created disk is ready to be formatted with VMFS. Figure C

Use cases

One use case for attaching a .VHD file is a forensic task where the C:\ drive of a virtual machine is not bootable; this would be a way to possibly extract data from the volume. Another use case is moving a large amount of data from a virtual machine to a physical machine without a conversion.

Microsoft makes it easy

I'll give Microsoft props, as peeking inside a VMware .VMDK file is not easy at times and requires some form of hypervisor in play to access the virtual disk. Microsoft can't make it much easier to access a .VHD file within a Windows Server 2008 Server and Windows 7.

How do you use this handy mechanism? Let us know in the discussion.