Disk Management - How to Mount and Unmount VHD Images
In one of our previous tutorials, we have shown how to manage your disks using the disk management utility. This article will continue to talk about the tool and show a simple way to mount and unmount Virtual Hard Disk (VHD) images with Disk Management, so that you can read or modify the contents of any '.vhd' file.
What is a Virtual Hard Disk(VHD)
Virtual Hard Disk (or VHD) is a virtual hard disk image that stores data in a single file. This type of file is created and used on by Microsoft virtualisation solutions such as Windows Virtual PC. This format was adopted by other virtualization solutions like VirtualBox, the product of Sun Microsystems, or VMware ESX Serve.
Also, the Windows Backup utility saves system images in this format.
How to Mount a VHD Image using Disk Management
First of all, open the Disk Management utility.
In the left-side panel, right click on Disk Management and choose the 'Attach VHD' option.
You can find the 'Attach VHD' option also in the Action menu (see capture below).
Click on Browse.
You now have to select the VHD file. When found, select it and press the Open button.
You are now back to the 'Attach Virtual Hard Disk' window. My advice here is to let the 'Read-only' box unchecked, so you can modify the files from the image. If this box is checked you will only be able to copy the files. Click on OK to begin the mounting process.
You will see that the VHD file has been mounted as separate disk drive and it has its own drive letter, in this case 'K:'.
Open Windows Explorer and click on the new partition to open it.
Now you can easily manipulate the desired files from the attached system image.
How to Unmount a VHD Image from Disk Management
After you are done working with the mounted virtual image, it's time to see how to unmount it. Open Disc Management, right click on the attached VHD (in this case 'K:') and choose the 'Detach VHD' option.
Click on the OK button to finish.
NOTE: In the 'Detach Virtual Hard Disk' window you can find the 'Delete the virtual hard disk file after removing the disk' option. This allows you to erase the selected image. I strongly advice to leave this box unchecked so you let the VHD image intact. Check it only if you really want to delete this image.
You will now see that the partition has been removed from the Disk Management window.
Useful Usage Scenarios
There are times when you need a single file or folder from a VHD file or System Image created by Windows Backup. Using the Disk Management utility you can easily mount the VHD file and copy the files and folders you need.
Also, this allows you to add folders and files to any image. Depending on the usage scenario - this feature can be useful.
As you could see from this tutorial, it's very easy to use Disk Management to mount VHD files and work with them. If you have any other tips to share related to this tool, don't hesitate to leave a comment.