How to Create a Virtual Hard Disk

A  Virtual Hard disk is capable of storing files, folders and file system like that of a Physical Hard Disk. It can host native files and support standard disk operations. It allows multiple operating systems to reside on a single host machine. We can modify a Virtual memory shared disk from a host server. It supports following applications:

  1. Moving files between a VHD and the host file system.
  2. Backup & Recovery.
  3. Antivirus & security.
  4. Image management & Patching.
  5. Disk Conversion (Physical to Virtual).
  6. Life cycle management and provisioning.

There are 3 types of VHD files:

  1. Fixed Hard-disk image: A fixed hard disk is a file that is allocated to the size of the virtual disk.
  2. Dynamic Hard-disk image: A dynamic hard-disk image is large as the actual data written to it at any given time. As more data is written, the file dynamically increases in size.
  3. Differencing Hard-disk image: It describes the modification of a parent image. This type of hard-disk is dependent on another hard-disk image to be fully functional.

Steps to create a Virtual Hard Disk:

  1. Go to ‘Start’, Right click on ‘Computer’, Click ‘manage’. The ‘computer management’ window will appear.
  2. From the left pane select ‘Disk Management’ option, Right click ‘Disk management’ and click ‘Create VHD’.
  3. In ‘Create and attach Virtual Hard Disk’ dialog box, mention the location where you want to create the VHD file by clicking on ‘Browse’ and mention the Virtual Hard disk size in MB.
  4. Type the file name for VHD and click on ‘save’. Click ‘Ok’ and newly attached disk is created.
  5. To initialize the disk, right click the icon near the disk designation and click ‘Initialize disk’. This opens the ‘Initialize disk’ dialog box. Select the disk and click ‘Ok’.
  6. You can now partition this Virtual Hard Disk in the same way you partition your physical Hard Disk.

Detach a VHD:

  1. Go to ‘start’ Right click on ‘Computer’ select ‘Manage’.
  2. From the left pane right click ‘Disk management’. Select ‘Detach VHD’.
  3. Click the icon besides the disk designation and click ‘Detach VHD’.
  4. In the Detach Virtual Hard Disk dialogue box select the VHD which you want to detach. Click ‘Ok’.
  5. You can now copy the VHD file from the location which you specified while creating VHD so that you can attach it to any computer.

Attach a VHD:

  1. Go to ‘start’ Right click on ‘Computer’ select ‘Manage’.
  2. From the left pane right click ‘Disk management’. Select ‘Attach VHD’.
  3. This will open attach Virtual Hard Disk dialogue box. Browse the location where you have saved the VHD file and click ‘Ok’.
  4. You can now see a new VHD in the Disk management window.

Importance of Virtual Hard Disk:

  1. Using Disk management tools to create and attach a VHD for offline image management. You can attach a VHD by using ‘Attach disk’ command which activates the VHD so that it appears on the host as a disk drive rather than as a .vhd file.
  2. Mounting reference VHD image on remote shares for image servicing.
  3. Configuring VHD files for native boot without requiring a full parent installation.
  4. Configuring computer to boot multiple local VHD files containing different application workloads, without requiring separate disk partitions.
  5. Managing desktop image deployment.
  6. A VHD can be used as running operating system on hardware without any other parent operating system. VHD is not designed to replace full image deployment on all client and server systems.