Virtual Hard Disks (VHD or VHDX) are disk image file formats that serve similar functions to physical hard drives. They are primarily designed for use with Hyper-V virtual machines. Mounting VHDX files in Windows 11 allows instant access without requiring a permanent setup, like grabbing important files from a backup.
Why bother? Imagine grabbing a contract from last year’s backup in seconds, validating a script in a sandboxed disk, or keeping your main drive tidy by attaching VHDs only when needed. In this guide, you’ll learn exactly how to mount and unmount these virtual drives via simple clicks or powerful scripts.
Methods for mounting and unmounting VHD/VHDX files as a drive in Windows
These procedures only work for .vhd and .vhdx file types. When following the steps, please ensure that no virtual machine or application is actively using these file types. You’ll also need administrator privileges to configure protected files and use tools like Disk Management, PowerShell, and DiskPart.
Method 1: Mount and unmount via File Explorer
Mounting and unmounting a VHDX file as a drive takes seconds with File Explorer. Here’s how you can do it:
Mounting with File Explorer
- Press Win + E or click the folder icon in the taskbar to open File Explorer.
- Navigate to and right-click your .vhd or .vhdx file.
- Select Mount from the context menu.
- You can now access it as a new drive letter (e.g., E:) in File Explorer.
You can now browse, edit, or copy files exactly like a physical drive. You can unmount it at any time by following the steps in the next section.
Unmounting with File Explorer
- Open File Explorer (Press Win + E).
- Right-click the virtual drive.
- Select Eject.
The disk immediately detaches, releasing the drive letter.
Method 2: Mount and unmount using Disk Management
If you need more control over doing this task (like read-only files), Disk Management provides the best way for it in Windows 11.
Mount via Disk Management
- Press Win + X, then select Disk Management (or press Win + R and type diskmgmt.msc).
- Click Action > Attach VHD in the menu bar.
- Check Read-only if you want to prevent changes (e.g., for backup files).
- Leave it unchecked if you plan to make changes.
- Click OK.
The virtual disk now appears in the volume list, ready to initialize or assign a drive letter.
Unmount via Disk Management
- Press Win + X, then select Disk Management (or press Win + R and type diskmgmt.msc).
- Right-click the gray disk label (e.g., Disk 2) that represents your attached VHD/VHDX.
- Select Detach VHD.
⚠️ Important: Untick the Delete the virtual disk… checkbox, unless you plan to permanently delete the file.
The virtual disk disappears from Disk Management immediately, freeing up resources.
Method 3: Mount and unmount via PowerShell
Automate mounting and unmounting VHD/VHDX drives with Windows 11 PowerShell.
Mounting a VHD/VHDX file via PowerShell
- Press Win + X, then select Terminal (Admin).
- PowerShell is usually the default command-line tool in Windows Terminal. If not, click the dropdown arrow in the window tabs, then select Windows PowerShell.
- Run this command to mount VHD:
Mount-DiskImage -ImagePath "your_virtual_drive_path"
- Optional: If you want to mount it as read-only, run:
Mount-DiskImage -ImagePath "your_virtual_drive_path" -AccessType ReadOnly
- Optional: If you want to assign a drive letter to it, run:
Get-Partition -DiskNumber (Get-DiskImage -ImagePath "*your_virtual_drive_path*" ).Number | Set-Partition -NewDriveLetter G
Note: For steps 1 and 2, input the path for the VHD file after -Path (e.g., “D:\Backups\Image.vhdx”).
Unmounting a mounted VHD/VHDX drive via PowerShell
- Press Win + X, then select Terminal (Admin).
- PowerShell is usually the default command-line tool in Windows Terminal. If not, click the dropdown arrow in the window tabs, then select Windows PowerShell.
- Run this command to dismount VHD cleanly:
Dismount-DiskImage -ImagePath
"your_virtual_drive_path"
Key considerations for mounting or unmounting VHD/VHDX drives
Here are some additional considerations to remember when you are mounting or unmounting VHD/VHDX files.
Drive letter conflicts and management
This issue happens because Windows auto-assigns letters (e.g., F:), which can break scripts if that letter is already occupied by another drive.
There are two ways you can fix this:
- In Disk Management, right-click the partition, then select Change Drive Letter and Paths.
- Or, in PowerShell, pre-assign letters during mount (do step 4 in mounting via PowerShell).
BitLocker-encrypted VHDs
Take note that mounting doesn’t necessarily mean unlocking it as well. If the disk is encrypted, mount it normally, then right-click the drive > select Unlock BitLocker > enter password.
You can do this via PowerShell by running the following commands:
Mount-DiskImage -ImagePath "your_virtual_drive_path"
Unlock-BitLocker -MountPoint "input assigned drive letter" -Password (ConvertTo-SecureString "YourPass" -AsPlainText -Force)
Backup/Virtualization Software Conflicts
Mounting VHD/VHDX files will fail with errors like access denied if Hyper-V, Veeam, or Azure Backup is using them. To avoid these errors, shut down VMs in Hyper-V Manager and pause backup jobs in Veeam or Azure. If needed, you can force unlock via PowerShell with Get-Process -File “X:\your.vhdx” \| Stop-Process -Force.
Ensure to always check Hyper-V Manager, then turn off associated VMs. This will help avoid conflicts when mounting a VHD drive used as a backup or in virtualization software.
Bootable VHDs
Mount bootable VHD/VHDX files with extreme caution. Do not ever attempt to mount the currently running system’s boot disk, as it is already in use and will cause critical errors. Instead, only mount offline or copied OS disks.
Mount and unmount VHD/VHDX to keep your Windows system tidy
Mounting and unmounting VHD/VHDX files in Windows 11 transforms virtual disks into Swiss Army knives for IT tasks. Whether rescuing a single file from backups or testing software in isolation, using right-click > Mount for quick access or PowerShell’s Mount-VHD for scripted precision provides an efficient workflow.
Always prioritize safety. Remember to only mount trusted files, eject properly (via Eject or Dismount-VHD), and avoid conflicts with live systems. Treat virtual drives like physical hardware by unmounting cleanly to prevent corruption. By following this guide, you will have an efficient and uncorruptible drive for your system.