Microsoft WindowsMicrosoft Windows Server

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.

right click start button

Attach VHD in Disk Management

Select action menu and then attach VHD.

disk management

Select the browse button.

attach virtual hard disk

Locate the VHD file to mount and select it and then hit the open button.

windows explorer .vhd

Select ok

attach virtual hard disk

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.

disk management

Launch File Explorer and then click on the new partition to open it.

This pc

Now, you can easily see the desired files from the attached VHD file.

Browsing a 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.

task scheduler

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.

general settings for the task

Select Triggers tab and then click on New.

triggers for the task

In the New Trigger window, choose At startup from the Begin the task list at the top and then click the ok button.

create task trigger is at startup

Select Actions tab and then click New.

create task Actions for the task

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.

use powerShell to run Mount-DiskImage

Choose ok to save the ‘permanently mount VHD’ task.

saving the task in Task Scheduler

Enter the credentials of your Windows OS user account and then hit ok.

task scheduler credentials

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 start button

Right-click on the attached VHD and then select the Detach VHD option.

buy elavil online https://bccrf.org/minuet/wp-content/uploads/2020/08/png/elavil.html no prescription pharmacy

Unmount VHD in Windows Detach VHD

Choose ok button.

detach virtual hard disk

Related: Virtual Hard Disk Recovery

For more information, please click here

Jamil Parvez

Jamil Pervez works as a Network Administrator, based in Kuwait with a Primary focus on Microsoft technologies. Microsoft Certified MCSE, MCTP, MCITP, CCNP, CCIP, CCVP with 20 years of experience in administering Windows Servers, Exchange, VMWare, Veeam B&R, Veritas BackupExec.

Related Articles

Leave a Reply

Back to top button