Mount a VHD as a Real Drive in Windows and Detach It Safely
Double-click a file, and a new drive appears in Explorer with its own letter, folders and free space. That is mounting a VHD - and done carelessly it is also how people confuse letters, write to the wrong disk, or tick the one checkbox that deletes everything. Here is the disciplined way.
✍️ Technical Anshu🪟 Windows 10 / 11⏱️ 7 minute read
🎥 Watch the video to see attach and detach demonstrated live in Disk Management
Attaching - also called mounting - is the moment a .vhd or .vhdx file becomes a working drive. The video demonstrates it in Disk Management; this guide covers all three mounting routes, the read-only option almost nobody uses, and the detach habits that keep the data inside safe. If you only remember one line, make it this: detach never deletes, unless you explicitly tell it to.
Result: drive V: appears, label LabData, ready to useSame file
👆 All three routes plug in the same file. Pick the route by situation - Explorer for speed, PowerShell for read-only control and scripts.
1
Mount It - Three Routes, One Result
Explorer: right-click the .vhd or .vhdx file → Mount. A drive appears immediately. A brand-new, never-initialized disk will mount but show no letter until you initialize and format it in Disk Management
Disk Management:diskmgmt.msc → Action → Attach VHD → browse → OK. Best when you also need to see the disk's partitions and health
DiskPart: run diskpart, then select vdisk file="D:\VHD\Data.vhdx" and attach vdisk
PowerShell:Mount-VHD -Path "D:\VHD\Data.vhdx" in an administrator window (the Hyper-V module provides the cmdlet)
Whichever route you took, confirm in Explorer that the letter and label are the disk you expected before writing anything
2
Drive Letter Discipline - Letters Are Borrowed, Not Owned
Windows hands the mounted disk the next free letter, which may differ from last time - yesterday's V: can return as G: if a USB drive grabbed V: first
Give every VHD volume a clear label (LabData, BackupOct, TestWin) and identify disks by label, never by letter alone
If software must always find the disk at the same letter, assign a high letter like V: in Disk Management (right-click the volume → Change Drive Letter and Paths). High letters collide with removable drives far less often
Never let a backup job, a sync tool or a database quietly depend on a mounted VHD's letter without checking - a detached VHD plus a reused letter means your job writes to the wrong disk with total confidence
3
Mount Read-Only When You Are Only Looking
Inspecting a backup or a disk you do not fully trust? Mount it so that nothing - not you, not Windows, not an indexing service - can change a byte:
DiskPart route: select vdisk file="D:\VHD\Backup.vhdx" then attach vdisk readonly
The drive appears normally for reading and copying out, but every write is refused
This is the correct way to peek inside a backup VHD, examine a disk image from another machine, or let someone browse without any chance of 'tidying up' the evidence
4
Detach Safely - The Checkbox That Bites
Close every file and window that points inside the mounted disk. A document left open can lose its last unsaved changes, exactly like pulling a USB drive mid-write
Detach from Explorer (right-click the drive → Eject), from Disk Management (right-click the disk → Detach VHD), with DiskPart's detach vdisk, or with Dismount-VHD -Path "D:\VHD\Data.vhdx"
In the Disk Management detach dialog, watch for the checkbox Delete the virtual hard disk file after removing the disk. Untick it. Detach means unplug; that checkbox turns unplug into destroy
Restarting or shutting down Windows detaches all VHDs automatically - no data is harmed, you simply attach again next time
If detach refuses because the disk is 'in use', something still has it open - close Explorer windows into it, stop the app, then retry. Forcing your way past that message is how half-written files happen
🔴 One VHD, one writer. Never mount the same virtual disk file on two computers at once over a network share, and never mount a disk that a running virtual machine is using. Two systems writing to one file system image will corrupt it - quietly at first, then completely. Copy the file if a second machine needs it.
🎥 Watch the Complete Process in the Video
The video walks through attach and detach on screen - watch it once and the routine in this guide becomes muscle memory.
Why did my VHD come back with a different drive letter today?
Windows assigns the first free letter at attach time, so the result depends on what else is plugged in. A USB drive or card reader that grabbed your usual letter pushes the VHD to the next one. Give the volume a clear label to recognise it by, and if a fixed letter matters, assign a high letter such as V: in Disk Management - it will be kept far more consistently.
Is it safe to mount a VHD file I received from someone else?
Mounting an image does not run programs by itself, but the files inside are untrusted content like any download. Mount it read-only (Mount-VHD -ReadOnly or DiskPart attach readonly), scan it with your antivirus before opening documents or executables from it, and never boot a received disk image or run its installers on trust.
I detached the VHD and the file seems gone. What happened?
Detach alone never deletes the file - it stays exactly where it was, usually still visible in its folder. Two real possibilities: the delete-file checkbox in the detach dialog was ticked, which does erase it, or you are looking in a different folder than the one the file lives in. Search the drive for *.vhdx to settle it before assuming the worst.
This guide is based on the Technical Anshu Windows VHD video • Stuck on any step? Ask in the video comments — you will get a reply there 🙏