How to Attach Detach Permanently Attach VHD File
In this blog, we will have a look hot to attach detach permanently attach VHD. Windows OS has an excellent tool for managing our drives and partitions, it’s called Disk Management. Some of the best features are that it permits you to mount and unmount VHD files so that you can work with them as you need. In this process, I will show you how to attach and detach Virtual Hard Disk (VHD) images in Windows. As well as how to permanently attach a VHD file that is always available.
What is the use of Virtual Hard Disk (VHD)
VHD or a Virtual Hard Disk file is a VHD image that stores all the data from a file system or hard disk partition all in a single file. Virtual hard drive files are usually used and created by virtual machine software such as Hyper-V, Virtual Box.
Additionally, the old Windows Image Backup tool from Windows also saves system images as VHD files.
Attach Detach Permanently Attach VHD
How to Mount a VHD Image
Right click on Windows Start button and then choose Disk Management.
Attach VHD in Disk Management
Select action menu and then attach VHD.
Select the browse button.
Locate the VHD file to mount and select it and then hit the open button.
Select ok
Attaching a Virtual Hard Disk file
Now you can see that the VHD file has been mounted as a separate drive, and it has its own drive letter assigned.
Launch File Explorer and then click on the new partition to open it.
Now, you can easily see the desired files from the attached VHD file.
How do I permanently attach a VHD
Is your question how I permanently attach a VHD, here is what we should do:
Open task scheduler and then click create the task in the Actions panel.
How to Create Task in Task Scheduler
In the create task windows under General tab, enter a friendly name for the VHD permanently mount task. Then, choose the Run whether user is logged on or not and Run with highest privileges options, and then select Windows OS in the Configure for dropdown list.
Select Triggers tab and then click on New.
In the New Trigger window, choose At startup from the Begin the task list at the top and then click the ok button.
Select Actions tab and then click New.
New Action window opens, enter powershell.exe in the Program/script field and then in the Add arguments (optional) text field, enter this command: Mount-DiskImage ‘Path to the VHD file’.
Change the ‘Path to the VHD file’ with the original path to the VHD file that you need to mount permanently, hit OK.
Choose ok to save the ‘permanently mount VHD’ task.
Enter the credentials of your Windows OS user account and then hit ok.
The attached VHD disk is available to use for as long as you wish, even if you reboot your PC. If you decide you no longer want to access it, simply you can detach the VHD file (unmount VHD).
How to detach a VHD image (unmount VHD)
Open Disk Management again.
Right-click on the attached VHD and then select the Detach VHD option.
Choose ok button.
Related: Virtual Hard Disk Recovery
For more information, please click here