It could be quite old thing for you, it has been already discussed on may Forums and weblogs. But now-a-days, I’m working with VHDs on Windows 7 and I thought to blog about this. In my opinion, its one of the best addition to Windows 7 is the Native Support for VHDs(Virtual Hard Disks).

About VHDs:

VHD file contains the complete structure representing a Hard Disk Drive, and is used to store or install Virtual Operating Systems and their associated programs. It is used by Virtual PC, Virtual Server and Hyper-V to represent virtual disks.

Virtual Hard Disks also allow multiple operating systems to reside on a single real machine. This enables developers and testers to test software on different operating systems without hassle of host machine.

Windows 7 includes support for creating, mounting, and booting from VHD files. There are two ways to create and mount or attach VHDs, you can either use Diskpart.exe  or Disk Management to do this.

Diskpart

As you know Diskpart.exe is the disk partition utility since Windows XP, when create, delete partitions, volumes are come into picture. In past it is managed objects disk, partition and volume. Now in Windows 7, the object “vdisk” has been added, that deals with commands like select, create, delete, attach, detach to do vdisk specific actions.

Here is few high lighted commands, that are invented or re-invented in diskpart.exe

Diskpart Commands

Examples:

create vdisk file=C:\VHD\W7x86.VHD Maximum=20000 Type=Fixed

Create a VHD at above location size of 20GB with type of Fixed, that means the file size fixed and file will occupy 20GB of space. No matter it is empty or not.

attach vdisk file=C:\VHD\W7x86.VHD

Attach the particular VHD in disk list. You can use “list disk” to see the disks are attached including VHDs.

sel vdisk file=C:\VHD\W7x86.VHD

Select VHD and prepare for disk operations, like create, delete partitions, etc.

detach vdisk

Detach the VHD from disk list, first make sure you have already selected specific VHD.

Disk Management

We can say its GUI version of diskpart.exe. Actually Disk Management usages diskpart.exe in background to perform all disk operations. So its much convenient that diskpart command-line utility for newbie.

Disk Management - Action Menu

In Windows 7, Disk Management has two options under Action menu to create and attach VHDs. That follow simple wizard, where VHD size, path, type, etc. are take as input. Rest of things are same as like physical disk and you can simply create, delete, format partitions and all other tasks.

Note: If you have query, whether this information applies to Windows Server 2008 R2 as well.  Yes, it does.

2 responses to “Native VHD Support in Windows 7”

  1. Mike Avatar

    I’ve created disk files OK so now have C as the main disk and three files for drives D, E, R.

    How can I make them permanent so they are still attached when I restart the PC?

    Regards

    Mike

  2. khiang Avatar

    i would like to know more about commands on window xp and 7. i hope ur website will help me

Leave a Reply

Your email address will not be published.