Virtual Hard Drives (VHD’s) are nothing new.  They have been around in products like VMware and even in Windows Server 2008.   They allow you to create a file that they acts as if it is another hard drive on the machine.  This can be extremely helpful in many situations especially when you want to keep your file system clean while at the same time avoiding dealing with partitioning your existing hard drive.

There are are a few ways to create Virtual Hard Drives in Windows 7.  All of which are extremely simple.

  1. Command Line
  2. Graphical User Interface (GUI)
  3. Either of the 2 above options one time and then simply copy & paste to create additional VHD’s

The quickest to explain by far is Command Line.

  1. Type in the Windows search cmd.exe
  2. Right click on cmd and select “Run as Administrator” and then Yes on the following prompt
  3. Type diskpart then hit enter
  4. Type in the following command  create vdisk file=c:\VHDs\VHD1.vhd type=fixed maximum=16000 and then hit enter
  5. After waiting for a few minutes the following will be displayed “Diskpart Successfull created the virtual file”
  6. Type  select vdisk file=d:\VHDs\VHD1.vhd and then hit enter
  7. Type attach vdisk and then hit enter
  8. Type create partition primary and then hit enter
  9. Type assign and then hit enter

The disk is now accesible via Computer and only needs to be formated.  When you attempt to access the drive for the first time you will be prompted to format it.  Follow the prompts accepting the default options and the drive will be ready shortly thereafter.  If you are going to install Windows 7 to the drive you only need to complete steps 1-5.

Creating the VHD via the GUI method

Step #1: Right click on “Computer” in the Start Menu and select “Manage”

Select Manage

Step #2: Select “Disk Management” from the left hand menu. Then select “Action” from the top menu and then “Create VHD”.

Computer Management

Step #3: A dialog box will open with a few options you need to select.  At this time we will need to choose where to save the VHD image to.  I suggest creating a single directory for all VHD’s to reside.  On my machine I chose “C:\VHDs\” so that they are easily organized and can be accessed just as easily.

  1. Select where you want to place your VHD in the “Location” box
  2. Type in the size you would like your VHD to be.  For a Windows 7 install I recommend a minimum of 10 GB but a better number is closer to 16 GB.
  3. Change the “MB” drop down box to be “GB”
  4. Select “Fixed Size”
  5. Select “OK” when your done making your selections

Configure VHD

After you click “OK” you will need to wait a few minutes for the VHD to be created which in my experience typically takes about 5 minutes.  After it has been created you will see the drive now present in Disk Management section of Computer Management.

VHD Created

Step #4: Now that the drive has been created you might need to initialize it.  You will NOT need to do this or any of the following steps if you are going to install Windows 7 to this drive.

  1. Right click to the left of the drive that says “Unallocated”
  2. Select “Initialize Disk”

Initialize VHD

Step #5: After the previous step a pop-up will open.  Leave the default settings of MBR and then select “OK”

Initialize Options

Step #6: The disk is now initialized but not ready for information to be put on it yet.

  1. At the Disk Management screen Right click on the VHD
  2. Select “New Simple Volume”
  3. A new window will open, Select “Next”

Simple Volume

Wizard

Step #7: Assign the drive letter you desire or preferably just accept the defaults and select Next.

Drive Letter

Step #8: Options for formatting are best left at default but I suggest changing the drive name to something memorable.

Formatting Drive

Report

Step #10: Enjoy!  Once the drive is ready you will be presented with the following dialog box.

Autoplay