This tutorial will show you how to natively mount (attach) or unmount (detach) a VHD or VHDX virtual hard disk file as a drive in Windows 11.
Virtual hard disks (VHDs) are disk image file formats that have similar functionalities to a physical hard drive and are designed primarily for use with Hyper-V virtual machines.
When you attach a .vhd or .vhdx file, it will be mounted as a drive in File Explorer > This PC to open and access.
Reference:
Manage Virtual Hard Disks (VHD)
You must be signed in as an administrator to mount (attach) or unmount (detach) VHD and VHDX files.
VHD and VHDX files cannot be mounted on removable media that isn't formatted with the NTFS or ReFS file system.
- Option One: Mount VHD or VHDX file by Opening
- Option Two: Mount VHD or VHDX file using Mount Context Menu
- Option Three: Mount VHD or VHDX file from File Explorer Command Bar
- Option Four: Unmount VHD or VHDX file from File Explorer Command Bar
- Option Five: Unmount VHD or VHDX file using Eject Context Menu
- Option Six: Mount VHD or VHDX file using Open with Context Menu
- Option Seven: Mount VHD or VHDX file in Settings
- Option Eight: Unmount VHD or VHDX file in Settings
- Option Nine: Mount VHD or VHDX file in PowerShell
- Option Ten: Unmount VHD or VHDX file in PowerShell
- Option Eleven: Mount VHD or VHDX in Command Prompt
- Option Twelve: Unmount VHD or VHDX in Command Prompt
- Option Thirteen: Mount VHD or VHDX file in Disk Management
- Option Fourteen: Unmount VHD or VHDX file in Disk Management
- Option Fifteen: Unmount All VHD or VHDX files at Once
EXAMPLE: VHD or VHDX mounted as drive in File Explorer > This PC
1 Perform one of the following actions to open and mount the VHD or VHDX file: (see screenshot below)
- Single or double click/tap on the VHD or VHDX file to open it.
- Select the VHD or VHDX file, and press Enter.
1 Open File Explorer (Win+E). (see screenshot below)
2 Navigate to and right click on the VHD or VHDX file you want to mount.
3 Click/tap on Mount.
1 Open File Explorer (Win+E). (see screenshot below)
2 Navigate to and select the VHD or VHDX file you want to mount.
3 Click/tap on Mount on the command bar.
1 Open This PC in File Explorer (Win+E). (see screenshot below)
2 Select the drive that is a mounted VHD or VHDX file.
3 Click/tap on Eject on the command bar.
1 Open This PC in File Explorer (Win+E). (see screenshot below)
2 Right click on the drive that is a mounted VHD or VHDX file.
3 Click/tap on Eject.
1 Open File Explorer (Win+E). (see screenshot below)
2 Navigate to and right click on the VHD or VHDX file you want to mount.
3 Click/tap on Open with.
4 Click/tap on Windows Explorer.
1 Open Settings (Win+I).
2 Click/tap on System on the left side, and click/tap on Storage on the right side. (see screenshot below)
3 Click/tap on Advanced storage settings on the right side to expand it, and click/tap on Disks & volumes. (see screenshot below)
4 Click/tap on the Attach VHD button at the top. (see screenshot below)
5 Perform the following steps: (see screenshots below)
- Click/tap on Browse.
- Navigate to and select the VHD or VHDX file you want to mount.
- Click/tap on Open.
- Click/tap on Attach.
6 When finished, you can close Settings if you like.
This option is only available starting with Windows 11 build 27686.1000 (Canary).
1 Open Settings (Win+I).
2 Click/tap on System on the left side, and click/tap on Storage on the right side. (see screenshot below)
3 Click/tap on Advanced storage settings on the right side to expand it, and click/tap on Disks & volumes. (see screenshot below)
4 Click/tap on Properties for the attached VHD/VHDX disk you want to detach. (see screenshot below)
5 Click/tap on Detach VHD. (see screenshot below)
6 Click/tap on OK to confirm. (see screenshot below)
7 When finished, you can close Settings if you like.
Mount-VHD (Hyper-V)
1 Open Windows Terminal (Admin), and select Windows PowerShell
2 Type the command below into 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 "D:\Example VHDX.vhdx"
3 You can now close Windows Terminal (Admin) if you like.
Dismount-VHD (Hyper-V)
1 Open Windows Terminal (Admin), and select Windows PowerShell
2 Type the commands below one at a time into PowerShell, and press Enter after each command to find the path of the mounted VHD or VHDX file. (see screenshot below)
diskpart
list vdisk
exit
3 Do step 4 (disk #) or step 5 (path) for how you want to unmount the .vhd or .vhdx file.
Dismount-VHD -DiskNumber #
Substitute # in the command above with actual disk number (ex: 3) from step 2 above.
For example: Dismount-VHD -DiskNumber 3
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 "D:\Example VHDX.vhdx"
6 You can now close Windows Terminal (Admin) if you like.
1 Open Windows Terminal (Admin), and select Command Prompt
2 Type the command below into the elevated command prompt, and press Enter. (see screenshot below)
diskpart
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:\Example VHDX.vhdx"
4 Type the command below into the elevated command prompt, and press Enter.
attach vdisk
5 You can now close Windows Terminal (Admin) if you like.
1 Open Windows Terminal (Admin), and select Command Prompt.
2 Type the commands below one at a time into the elevated command prompt, and press Enter after each command to find the path of the mounted VHD or VHDX file. (see screenshot below)
diskpart
list vdisk
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 attached .vhd or .vhdx file you want to unmount.
For example: select vdisk file="D:\Example VHDX.vhdx"
4 Type
detach vdisk
into the elevated command prompt, and press Enter.5 You can now close Windows Terminal (Admin) if you like.
1 Open Disk Management (diskmgmt.msc).
2 Click/tap on Action on the menu bar, and click/tap on Attach VHD. (see screenshot below)
3 Perform the following steps: (see screenshots below)
- Click/tap on Browse.
- Navigate to and select the VHD or VHDX file you want to mount.
- Click/tap on Open.
- Click/tap on OK.
4 When finished, you can close Settings if you like.
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)
When a VHD has been attached and made available to the system for use, it appears blue.
3 Click/tap on OK to confirm. (see screenshot below)
4 You can now close Disk Management if you like.
1 Restart the computer.
That's it,
Shawn Brink