How to Mount or Unmount VHD and VHDX File in Windows 10
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.
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
- Option One: Directly Mount VHD or VHDX file
- Option Two: Mount VHD or VHDX file in Disk Management
- Option Three: Mount VHD or VHDX file in Windows PowerShell
- Option Four: Mount VHD or VHDX file in Command Prompt
- Option Five: Unmount VHD or VHDX file using Eject
- Option Six: Unmount All VHD and VHDX files by Restarting Computer
- Option Seven: Unmount VHD or VHDX file in Disk Management
- Option Eight: Unmount VHD or VHDX file in Windows PowerShell
- Option Nine: Unmount VHD or VHDX file in Command Prompt
EXAMPLE: Mounted VHDX file in This PC
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)
1 Open Disk Management (diskmgmt.msc).
2 Click/tap on Action in the menu bar, and click/tap on Attach VHD. (see screenshot below)
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)
4 You can now close Disk Management if you like.
For more details and options for the Mount-VHD cmdlet, see: Microsoft Docs: Mount-VHD
This command is only available after installing the Hyper-V Management Tools or Hyper-V feature.
1 Open an elevated Windows PowerShell.
3 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"
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"
3 You can now close the elevated Windows PowerShell if you like.
1 Open an elevated command prompt.
1 Typediskpart
into the elevated command prompt, and press Enter. (see screenshot below)
3 Type the command below into the elevated command prompt, and press Enter.
select vdisk file="Full path of .vhd or .vhdx file"
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:select vdisk file="D:\VHD\Example.vhdx"
4 Typeattach vdisk
into the elevated command prompt, and press Enter.
5 You can now close the elevated command prompt if you like.
1 Open This PC in File Explorer (Win+E).
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)
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)
3 Click/tap on OK to confirm. (see screenshot below)
4 You can now close Disk Management if you like.
For more details and options for the Dismount-VHD cmdlet, see: Microsoft Docs: Dismount-VHD
This command is only available after installing the Hyper-V Management Tools or Hyper-V
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)
3 Do step 4 (disk #) or step 5 (path) for how you want to unmount the .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 #
Substitute # in the command above with actual disk number (ex: 2) from step 2 above.
For example:Dismount-VHD -DiskNumber 2
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"
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"
6 You can now close Windows PowerShell if you like.
1 Open an elevated command prompt.
2 Typediskpart
into the elevated command prompt, and press Enter. (see screenshot below)
3 Typelist vdisk
into the elevated command prompt, press Enter, and make note of the attached VHD or VHDX file path (ex: "D:\VHD\Example.vhdx") you want to unmount.
4 Type the command below into the elevated command prompt, and press Enter.
select vdisk file="Full path of .vhd or .vhdx file"
Substitute Full path of .vhd or .vhdx file in the command with the actual full path of the .vhd or .vhdx file from step 3 you want to unmount.
For example:select vdisk file="D:\VHD\Example.vhdx"
5 Typedetach vdisk
into the elevated command prompt, and press Enter.
6 You can now close the elevated command prompt if you like.
That's it,
Shawn
Related Tutorials
- How to Create and Set Up New VHD or VHDX File in Windows 10
- How to Mount or Unmount ISO and IMG Files in Windows 10
- How to Add or Remove Mount Context Menu in Windows 10
- How to Change and Assign Drive Letter in Windows 10
- How to Create BitLocker Encrypted Container File with a VHD or VHDX File in Windows
- How to Auto-Mount VHD or VHDX File at Startup in Windows 10
- How to Mount and Unmount a Drive or Volume in Windows