VHD (file format)
Encyclopedia
A Virtual Hard Disk (VHD) is a virtual hard disk file format
File format
A file format is a particular way that information is encoded for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa. There are different kinds of formats for...

, meaning it can contain what is found on a physical hard disk drive, such as disk partitions
Disk partitioning
Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks. Partitions are also termed "slices" for operating systems based on BSD, Solaris or GNU Hurd...

 and a file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

, which in turn can contain files
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

 and folders. It is typically used as the hard disk of a virtual machine
Virtual machine
A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...

. The format was created by Connectix
Connectix
Connectix Corporation was a software and hardware company, noted for having released innovative products that were either made obsolete as Apple Computer incorporated the ideas into system software, or were sold to other companies once they become popular...

, which was later acquired by Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

, for what is now known as Microsoft Virtual PC
Microsoft Virtual PC
Windows Virtual PC is a virtualization program for Microsoft Windows. In July 2006 Microsoft released the Windows-hosted version as a free product...

. Since June 2005, Microsoft has made the VHD Image Format Specification available to third parties under the Microsoft Open Specification Promise
Microsoft Open Specification Promise
The Microsoft Open Specification Promise , is a promise by Microsoft, published in September 2006, to not assert legal rights over certain Microsoft patents on implementations of an included list of technologies....

.

Features

A Virtual Hard Disk allows multiple operating systems to reside on a single host machine. This method enables developers to test software on different operating systems without the cost or hassle of installing a second hard disk or creating a separate partition
Disk partitioning
Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks. Partitions are also termed "slices" for operating systems based on BSD, Solaris or GNU Hurd...

 on a single hard disk. The ability to directly modify a virtual machine
Virtual machine
A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...

’s hard disk from a host server supports many applications, including:
  • Moving files between a VHD and the host file system
  • Backup and recovery
  • Antivirus and security
  • Image management and patching
  • Disk conversion (physical to virtual, and so on)
  • Life-cycle management and provisioning

Supported formats

VHDs are implemented as files that reside on the native host file system. The following types of VHD formats are supported by Microsoft Virtual PC and Virtual Server:
  • Fixed hard disk image - a file that is allocated to the size of the virtual disk. Fixed VHDs consist of a raw disk image
    Disk image
    A disk image is a single file or storage device containing the complete contents and structure representing a data storage medium or device, such as a hard drive, tape drive, floppy disk, CD/DVD/BD, or USB flash drive, although an image of an optical disc may be referred to as an optical disc image...

     followed by a VHD footer (512 or formerly 511 bytes).
  • Dynamic hard disk image - a file that at any given time is as large as the actual data written to it, plus the size of the header and footer. Dynamic and differencing VHDs begin with a copy of the VHD footer (padded to 512 bytes), and for dynamic or differencing VHDs created by Microsoft products this results in a VHD-cookie string conectix at the begin of the VHD file.
  • Differencing hard disk image - a set of modified blocks (maintained in a separate file referred to as the "child image") in comparison to a parent image. The Differencing hard disk image format allows the concept of Undo Changes—when enabled, all changes to a hard drive contained within a VHD (the parent image) are stored in a separate file (the child image). Options are available to undo the changes to the VHD, or to merge them permanently into the VHD. Different child images based on the same parent image also allow "cloning" of VHDs; at least the globally unique identifier
    Globally Unique Identifier
    A globally unique identifier is a unique reference number used as an identifier in computer software. The term GUID also is used for Microsoft's implementation of the Universally unique identifier standard....

     (GUID) must be different.
  • Linked to a hard disk - a file which contains a link to a physical hard drive or partition of a physical hard drive.

Advantages

Significant benefits result from the ability to boot a physical computer from a virtual hard drive:
  • Ease of deployment: IT organizations can deploy standardized, 'pre-built' configurations on a single VHD. As an example, software engineering organizations which need a specific set of tools for a particular project could simply 'pull' the appropriately-configured VHD from a network location.
  • Backup-and-Restore: Changes to the contents of a VHD (such as infection by a virus, or accidental deletion of critical files) are easily undone.
  • Multi-User Isolation: Many current operating systems support having multiple users, but offer varying degrees of protection between them (e.g., one user of the OS could become infected by a virus which infects other users, or make changes to the OS which affect other users). By giving each user their own version of the operating system -- say, by creating for each of them a differencing VHD based on a base installation of the OS -- changes to any particular child image would have no effect on any of the other child images. However, a virus can be programmed to search for VHDs and infect it - it's more a matter of securing file permissions and using the appropriate accounts (restricted user always, administrator or super user only when installing software or configuring the operating system).

Native VHD Boot


Native VHD Boot refers to the ability of a physical computer to mount
Mount (computing)
Mounting takes place before a computer can use any kind of storage device . The user or their operating system must make it accessible through the computer's file system. A user can access only files on mounted media.- Mount point :A mount point is a physical location in the partition used as a...

 and boot from an operating system contained within a VHD. Windows 7 Enterprise and Ultimate editions support this ability, both with and without a host operating system present. Windows Server 2008 R2
Windows Server 2008 R2
Windows Server 2008 R2 is a server operating system produced by Microsoft. It was released to manufacturing on July 22, 2009 and launched on October 22, 2009. According to the Windows Server Team blog, the retail availability was September 14, 2009. It is built on Windows NT 6.1, the same core...

 is also compatible with this feature.

Limitations

The VHD format has a built-in limitation of 2 TB for the size of any dynamic or differencing VHDs. This is due to a sector offset table that only allows for the maximum of a 32-bit quantity. It is calculated by multiplying by 512 bytes for each sector.

The C×H×S formula in the VHD specification allows a maximum of 65535×16×255 sectors. About 127 GB is also the limit for VHDs in Windows Virtual PC
Windows Virtual PC
Windows Virtual PC is a virtualization program for Microsoft Windows. In July 2006 Microsoft released the Windows-hosted version as a free product...

. For less than 65535×16×63 sectors (about 31 GB) the CHS-value in the VHD footer uses a minimum of H=4 and a maximum of H=16 heads with S=17, 31, or 63 sectors per track. The CHS algorithm then determines C=(T/S)/H. The specification does not discuss cases, where the CHS value in the VHD footer does not match the (virtual) CHS geometry in the Master Boot Record
Master boot record
A master boot record is a type of boot sector popularized by the IBM Personal Computer. It consists of a sequence of 512 bytes located at the first sector of a data storage device such as a hard disk...

 of the disk image in the VHD.

Software using the VHD file format

Virtual Hard Disk format was initially used only by Microsoft Virtual PC
Microsoft Virtual PC
Windows Virtual PC is a virtualization program for Microsoft Windows. In July 2006 Microsoft released the Windows-hosted version as a free product...

. Later however, Microsoft used the VHD format in Hyper-V
Hyper-V
Microsoft Hyper-V, codenamed Viridian and formerly known as Windows Server Virtualization, is a hypervisor-based virtualization system for x86-64 systems. A beta version of Hyper-V was shipped with certain x86-64 editions of Windows Server 2008, and the finalized version was released on June 26,...

, the hypervisor
Hypervisor
In computing, a hypervisor, also called virtual machine manager , is one of many hardware virtualization techniques that allow multiple operating systems, termed guests, to run concurrently on a host computer. It is so named because it is conceptually one level higher than a supervisory program...

-based virtualization technology of Windows Server 2008. Microsoft also used the format in Complete PC Backup, a backup software component
Backup software
Backup software are computer programs used to perform backup; they create supplementary exact copies of files, databases or entire computers. These programs may later use the supplementary copies to restore the original contents in the event of data loss....

 included with Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

 and Windows 7. In addition, Windows 7 and Windows Server 2008 R2 include support for creating, mounting, and booting from VHD files.

The Vista (or later) drive manager GUI supports a subset of the functions in the diskpart command line tool. VHDs known as vdisk in diskpart can be created, formatted, attached (mounted), detached (unmounted), merged (for differencing VHDs), and compacted (for VHDs on an NTFS host file system). Compacting is typically a two step procedure, first unused sectors in the VHD are filled with zeros, and then diskpart can use the NTFS
NTFS
NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....

 feature of sparse files to eliminate runs of zeros in the VHD. The virtual machine additions in older VPC
Windows Virtual PC
Windows Virtual PC is a virtualization program for Microsoft Windows. In July 2006 Microsoft released the Windows-hosted version as a free product...

 versions and the virtual machine integration features in Windows Virtual PC
Windows Virtual PC
Windows Virtual PC is a virtualization program for Microsoft Windows. In July 2006 Microsoft released the Windows-hosted version as a free product...

 contain precompact ISO images for the first step in supported guest systems.

Third-party products also use VHD file format. VirtualBox
VirtualBox
Oracle VM VirtualBox is an x86 virtualization software package, originally created by software company Innotek GmbH, purchased by Sun Microsystems, and now developed by Oracle Corporation as part of its family of virtualization products...

, part of Sun xVM
Sun xVM
Sun xVM is a product group from Sun Microsystems that addresses virtualization technology on x86 platforms.-History:Sun originally announced the xVM product family in October 2007 as a broader product line...

 line of Sun Microsystems
Sun Microsystems
Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...

 supports VHD in versions 2 and later.
VMware ESX Server
VMware ESX Server
VMware ESX is an enterprise-level computer virtualization product offered by VMware, Inc. ESX is a component of VMware's larger offering, VMware Infrastructure, and adds management and reliability services to the core server product...

 and VMware Workstation
VMware Workstation
VMware Workstation is a virtual machine software suite for x86 and x86-64 computers from VMware, a division of EMC Corporation, which allows users to set up multiple x86 and x86-64 virtual machines and use one or more of these virtual machines simultaneously with the hosting operating system...

 also support the VHD file format as an alternative to its proprietary VMDK
VMDK
The VMDK file format is a type of virtual appliance developed for VMware products. The format is open/documented.-Products that use the format:* VMware Workstation* VMware Player* VMware Server* VMware Fusion...

 format. The VHD file format is also adopted by XenSource
Xen
Xen is a virtual-machine monitor providing services that allow multiple computer operating systems to execute on the same computer hardware concurrently....

 for what is now the Citrix
Citrix Systems
Citrix Systems, Inc. is a multinational corporation founded in 1989, that provides server and desktop virtualization, networking, software-as-a-service , and cloud computing technologies, including Xen open source products....

 XenServer
Xen
Xen is a virtual-machine monitor providing services that allow multiple computer operating systems to execute on the same computer hardware concurrently....

 hypervisor.

Offline modification

It is sometimes useful to modify a VHD file without booting an operating system. Hyper-V
Hyper-V
Microsoft Hyper-V, codenamed Viridian and formerly known as Windows Server Virtualization, is a hypervisor-based virtualization system for x86-64 systems. A beta version of Hyper-V was shipped with certain x86-64 editions of Windows Server 2008, and the finalized version was released on June 26,...

 features offline VHD manipulation — providing administrators with the ability to securely access files within a VHD without having to instantiate a virtual machine. This provides administrators with granular access to VHDs and the ability to perform some management tasks offline.
The Windows Disk Management MMC plugin can directly attach a .vhd as a drive letter in Windows 7, Windows Server 2008 and Windows Server 2008 R2.

For situations where mounting a VHD within the operating system is undesirable, several programs enable software developers to inspect and modify VHD files, including .NET DiscUtils
.NET DiscUtils
.NET DiscUtils is an open source .NET software library, hosted on Microsoft's CodePlex site for accessing and manipulating virtual disk images...

, WinImage
WinImage
WinImage is a disk imaging application for Microsoft Windows created by Gilles Vollant Software. Its features include creating, reading and editing disk images and also opening VMware and Microsoft Virtual PC hard disk images...

 and R1soft Hyper-V VHD Explorer
R1soft Hyper-V VHD Explorer
R1soft Hyper-V VHD Explorer is an application used to mount Hyper-V Virtual Disks in Windows Explorer for Windows Server 2008 R2 computers, produced by R1Soft...

.

Virtual Floppy Disk (VFD)

A Virtual Floppy Disk (VFD) is a related file format used by Windows Virtual PC
Windows Virtual PC
Windows Virtual PC is a virtualization program for Microsoft Windows. In July 2006 Microsoft released the Windows-hosted version as a free product...

, Microsoft Automated Deployment services and Microsoft Virtual Server 2005. Typically it contains an image of a 720 KB or 1.44 MB floppy disk
Floppy disk
A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...

. Windows Virtual PC for Windows 7 (version 6.1) no longer offers a user interface for manipulating virtual floppy disks; however, it still supports virtual floppy disks via scripting.

There are software tools to mount VFD files as virtual floppy disks and access their contents.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK