Published by


Brink's Avatar
Administrator

Posts: 17,489

Show Printable Version 


How to Mount or Unmount VHD and VHDX Files in Windows 10

information   Information
VHD (Virtual Hard Disk) is a file format which represents a virtual hard disk drive (HDD). It may contain what is found on a physical HDD, such as disk partitions and a file system, which in turn can contain files and folders. It is typically used as the hard disk of a virtual machine.

VHDX is a Hyper-V virtual hard disk file format. VHDX has a much larger 64 TB storage capacity than the older VHD format 2TB limit. It also provides data corruption protection during power failures and optimizes structural alignments of dynamic and differencing disks to prevent performance degradation on new, large-sector physical disks.

When you mount a .vhd or .vhdx file, it will be added as a drive in This PC to open it from.

This tutorial will show you different ways on how to natively mount or unmount VHD and VHDX virtual hard disk files in Windows 10.

Note   Note
You must be signed in as an administrator to be able to mount and unmount VHD and VHDX files.

VHD and VHDX files cannot be mounted from removable media that isn't formatted with NTFS or ReFS file system.


CONTENTS:


EXAMPLE: Mounted VHDX file in This PC
Click image for larger version. 

Name:	Mounted_VHD-VHDX.png 
Views:	155 
Size:	127.9 KB 
ID:	97989





VHD or VHDX File - Mount or Unmount in Windows 10 OPTION ONE VHD or VHDX File - Mount or Unmount in Windows 10
Directly Mount VHD or VHDX file

1. Do step 2 or step 3 below for what you would like to do.

2. Double click/tap on the .vhd or .vhdx file.

3. Right click or press and hold on the .vhd or .vhdx file, and click/tap on Mount. (see screenshot below)
Click image for larger version. 

Name:	Mount_VHD-VHDX-context-menu.png 
Views:	85 
Size:	49.3 KB 
ID:	97998






VHD or VHDX File - Mount or Unmount in Windows 10 OPTION TWO VHD or VHDX File - Mount or Unmount in Windows 10
Mount VHD or VHDX file in Disk Management

1. Open Disk Management (diskmgmt.msc).

2. Click/tap on Action in the menu bar, and click/tap on Attach VHD. (see screenshot below)

Click image for larger version. 

Name:	Attach_VHD-VHDX_Disk_Management-1.jpg 
Views:	69 
Size:	108.8 KB 
ID:	97990

3. Click/tap on Browse, navigate to and select the .vhd or .vhdx file, click/tap on Open, check or uncheck Read-only, and click/tap on OK. (see screenshots below)

Click image for larger version. 

Name:	Attach_VHD-VHDX_Disk_Management-2.jpg 
Views:	62 
Size:	74.6 KB 
ID:	97991

4. You can now close Disk Management if you like.






VHD or VHDX File - Mount or Unmount in Windows 10 OPTION THREE VHD or VHDX File - Mount or Unmount in Windows 10
Mount VHD or VHDX file in Windows PowerShell

Note   Note
For more details and options for the Mount-VHD cmdlet, see: Microsoft TechNet: Mount-VHD


1. Open an elevated Windows PowerShell.

2. Type the command below into the elevated Windows PowerShell, and press Enter. (see screenshot below)

Mount-VHD -Path "Full path of .vhd or .vhdx file"

Note   Note
Substitute Full path of .vhd or .vhdx file in the command with the actual full path of the .vhd or .vhdx file you want to mount.

For example: Mount-VHD -Path "C:\Users\Brink\Desktop\Non-Insider W10.vhdx"


Click image for larger version. 

Name:	Mount-VHD_PowerShell.png 
Views:	46 
Size:	14.4 KB 
ID:	97999

3. You can now close Windows PowerShell if you like.






VHD or VHDX File - Mount or Unmount in Windows 10 OPTION FOUR VHD or VHDX File - Mount or Unmount in Windows 10
Unmount VHD or VHDX file using Eject

1. Open This PC in File Explorer.

2. Right click or press and hold on the drive for the mounted .vhd or .vhdx file, and click/tap on Eject. (see screenshot below)
Click image for larger version. 

Name:	Eject_VHD-VHDX.png 
Views:	84 
Size:	76.3 KB 
ID:	97997






VHD or VHDX File - Mount or Unmount in Windows 10 OPTION FIVE VHD or VHDX File - Mount or Unmount in Windows 10
Unmount All VHD and VHDX files by Restarting Computer

1. Restart the computer to automatically unmount all VHD and VHDX files at once.






VHD or VHDX File - Mount or Unmount in Windows 10 OPTION SIX VHD or VHDX File - Mount or Unmount in Windows 10
Unmount VHD or VHDX file in Disk Management

1. Open Disk Management (diskmgmt.msc).

2. Right click or press and hold on the Disk # for the mounted .vhd or .vhdx file, and click/tap on Detach VHD. (see screenshot below)

Click image for larger version. 

Name:	Detach_VHD-VHDX_Disk_Management-1.jpg 
Views:	45 
Size:	131.9 KB 
ID:	97992

3. Click/tap on OK to confirm. (see screenshot below)

Name:  Detach_VHD-VHDX_Disk_Management-2.png
Views: 2769
Size:  7.8 KB

4. You can now close Disk Management if you like.






VHD or VHDX File - Mount or Unmount in Windows 10 OPTION SEVEN VHD or VHDX File - Mount or Unmount in Windows 10
Unmount VHD or VHDX file in Windows PowerShell

Note   Note
For more details and options for the Dismount-VHD cmdlet, see: Microsoft TechNet: Dismount-VHD


1. Open an elevated Windows PowerShell.

2. Type the commands below one at a time into the elevated Windows PowerShell, and press Enter after each command. Make note of the Disk # and/or file path of the .vhd or .vhdx file you want to unmount. (see screenshot below)

diskpart

list vdisk

exit

Click image for larger version. 

Name:	diskpart_list_vdisk.png 
Views:	50 
Size:	41.7 KB 
ID:	98013


3. Do step 4 (disk #) or step 5 (path) for how you want to unmount the .vhd or .vhdx file.


 4. Use Disk # in PowerShell to Unmount VHD or VHDX file

A) Type the command below into the elevated Windows PowerShell, press Enter, and go to step 6 below. (see screenshot below)

Dismount-VHD -DiskNumber #

Note   Note
Substitute # in the command above with actual disk number (ex: 2) from step 2 above.

For example: Dismount-VHD -DiskNumber 2


Click image for larger version. 

Name:	Dismount-VHD_-DiskNumber_PowerShell.png 
Views:	46 
Size:	13.0 KB 
ID:	97995


 5. Use File Path in PowerShell to Unmount VHD or VHDX file

A) Type the command below into the elevated Windows PowerShell, press Enter, and go to step 6 below. (see screenshot below)

Dismount-VHD -Path "Full path of .vhd or .vhdx file"

Note   Note
Substitute Full path of .vhd or .vhdx file in the command above with actual full file path from step 2 above.

For example: Dismount-VHD -Path "C:\Users\Brink\Desktop\Non-Insider W10.vhdx"


Click image for larger version. 

Name:	Dismount-VHD_-path_PowerShell.png 
Views:	32 
Size:	15.0 KB 
ID:	97996


6. You can now close Windows PowerShell if you like.



That's it,
Shawn