Virtualization Mount or Unmount VHD and VHDX file as Drive in Windows 11


  • Staff
Drive_banner.png

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:


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.



Contents



EXAMPLE: VHD or VHDX mounted as drive in File Explorer > This PC

VHD_mounted_as_drive.png





Option One

Mount VHD or VHDX file by Opening


1 Perform one of the following actions to open and mount the VHD or VHDX file: (see screenshot below)
Open_VHD_to_mount.png





Option Two

Mount VHD or VHDX file using Mount Context Menu


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.

Mount_VHD_from_context_menu.png





Option Three

Mount VHD or VHDX file from File Explorer Command Bar


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.

Mount_VHD_from_File_Explorer_command_bar.png





Option Four

Unmount VHD or VHDX file from File Explorer 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.

Eject_VHD-2.png





Option Five

Unmount VHD or VHDX file using Eject Context Menu


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.

Eject_VHD-1.png





Option Six

Mount VHD or VHDX file using Open with Context Menu


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.

Mount_VHD_from_open-with_context_menu.png





Option Seven

Mount VHD or VHDX file in Settings


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)


Attach_VHD_in_Settings-1.png

3 Click/tap on Advanced storage settings on the right side to expand it, and click/tap on Disks & volumes. (see screenshot below)

Attach_VHD_in_Settings-2.png

4 Click/tap on the Attach VHD button at the top. (see screenshot below)

Attach_VHD_in_Settings-3.png

5 Perform the following steps: (see screenshots below)
  1. Click/tap on Browse.
  2. Navigate to and select the VHD or VHDX file you want to mount.
  3. Click/tap on Open.
  4. Click/tap on Attach.
Attach_VHD_in_Settings-4.png
Attach_VHD_in_Settings-5.png

6 When finished, you can close Settings if you like.




Option Eight

Mount VHD or VHDX file in PowerShell



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.

Mount_VHD_in_PowerShell.png





Option Nine

Unmount VHD or VHDX file in PowerShell



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

Detach_VHD_in_PowerShell-1.png

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 #

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

For example: Dismount-VHD -DiskNumber 3


Detach_VHD_in_PowerShell-2.png

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"

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"


Detach_VHD_in_PowerShell-3.png

6 You can now close Windows Terminal (Admin) if you like.




Option Ten

Mount VHD or VHDX in Command Prompt


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.

Attach_VHD_command.png





Option Eleven

Unmount VHD or VHDX in Command Prompt


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.

Detach_VHD_command.png





Option Twelve

Mount VHD or VHDX file in Disk Management


1 Open Disk Management (diskmgmt.msc).

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

Attach_VHD_Disk_Management-1.png

3 Perform the following steps: (see screenshots below)
  1. Click/tap on Browse.
  2. Navigate to and select the VHD or VHDX file you want to mount.
  3. Click/tap on Open.
  4. Click/tap on OK.
Attach_VHD_Disk_Management-2.png
Attach_VHD_Disk_Management-3.png

4 When finished, you can close Settings if you like.




Option Thirteen

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)

When a VHD has been attached and made available to the system for use, it appears blue.


Detach_VHD_in_Disk_Management-1.png

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

Detach_VHD_in_Disk_Management-2.png

4 You can now close Disk Management if you like.




Option Fourteen

Unmount All VHD or VHDX files at Once


1 Restart the computer.


That's it,
Shawn Brink


 

Attachments

  • Drive.png
    Drive.png
    2.7 KB · Views: 33
Last edited:
Option 9 :
Mount-Diskimage and Dismount-Diskimage can mount/unmount VHD/VHDX files; this is usefull if Hyper V is not present.
 

My Computer

System One

  • OS
    Windows 11 Enterprise
    Computer type
    Laptop
    Manufacturer/Model
    Asus K73SV
    CPU
    ntel(R) Core(TM) i5-2410M CPU @ 2.30GHz
    Motherboard
    Asus K73SV Series Notebook
    Memory
    8 GB
    Graphics Card(s)
    Intel HD Graphics 3000 / nVidia GeForce GT 540M
    Sound Card
    Realtek
    Screen Resolution
    1600*900
    Hard Drives
    2 SSD Samsung 860 EVO 1 TB
    Other Info
    This is a Windows 11 no-compliant PC

Latest Support Threads

Back
Top Bottom