Windows 10: Mount or Unmount VHD or VHDX File in Windows 10  

    Mount or Unmount VHD or VHDX File in Windows 10

    Mount or Unmount VHD or VHDX File in Windows 10

    How to Mount or Unmount VHD and VHDX Files in Windows 10
    Published by Category: Virtualization
    04 Apr 2017
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 20,847

    Show Printable Version 


    How to Mount or Unmount VHD and VHDX Files in Windows 10

    information   Information
    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.

    Note   Note
    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:


    EXAMPLE: Mounted VHDX file in This PC
    Click image for larger version. 

Name:	Mounted_VHD-VHDX.png 
Views:	323 
Size:	127.9 KB 
ID:	97989





    Mount or Unmount VHD or VHDX File in Windows 10 OPTION ONE Mount or Unmount VHD or VHDX File in Windows 10
    Directly Mount VHD or VHDX file

    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)
    Click image for larger version. 

Name:	Mount_VHD-VHDX-context-menu.png 
Views:	187 
Size:	49.3 KB 
ID:	97998






    Mount or Unmount VHD or VHDX File in Windows 10 OPTION TWO Mount or Unmount VHD or VHDX File in Windows 10
    Mount VHD or VHDX file in Disk Management

    1. Open Disk Management (diskmgmt.msc).

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

    Click image for larger version. 

Name:	Attach_VHD-VHDX_Disk_Management-1.jpg 
Views:	178 
Size:	108.8 KB 
ID:	97990

    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)

    Click image for larger version. 

Name:	Attach_VHD-VHDX_Disk_Management-2.jpg 
Views:	162 
Size:	74.6 KB 
ID:	97991

    4. You can now close Disk Management if you like.






    Mount or Unmount VHD or VHDX File in Windows 10 OPTION THREE Mount or Unmount VHD or VHDX File in Windows 10
    Mount VHD or VHDX file in Windows PowerShell

    Note   Note
    For more details and options for the Mount-VHD cmdlet, see: Microsoft TechNet: Mount-VHD


    1. Open an elevated Windows PowerShell.

    2. 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"

    Note   Note
    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"


    Click image for larger version. 

Name:	Mount-VHD_PowerShell.png 
Views:	103 
Size:	14.4 KB 
ID:	97999

    3. You can now close Windows PowerShell if you like.






    Mount or Unmount VHD or VHDX File in Windows 10 OPTION FOUR Mount or Unmount VHD or VHDX File in Windows 10
    Unmount VHD or VHDX file using Eject

    1. Open This PC in File Explorer.

    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)
    Click image for larger version. 

Name:	Eject_VHD-VHDX.png 
Views:	205 
Size:	76.3 KB 
ID:	97997






    Mount or Unmount VHD or VHDX File in Windows 10 OPTION FIVE Mount or Unmount VHD or VHDX File in Windows 10
    Unmount All VHD and VHDX files by Restarting Computer

    1. Restart the computer to automatically unmount all VHD and VHDX files at once.






    Mount or Unmount VHD or VHDX File in Windows 10 OPTION SIX Mount or Unmount VHD or VHDX File in Windows 10
    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)

    Click image for larger version. 

Name:	Detach_VHD-VHDX_Disk_Management-1.jpg 
Views:	152 
Size:	131.9 KB 
ID:	97992

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

    Name:  Detach_VHD-VHDX_Disk_Management-2.png
Views: 7045
Size:  7.8 KB

    4. You can now close Disk Management if you like.






    Mount or Unmount VHD or VHDX File in Windows 10 OPTION SEVEN Mount or Unmount VHD or VHDX File in Windows 10
    Unmount VHD or VHDX file in Windows PowerShell

    Note   Note
    For more details and options for the Dismount-VHD cmdlet, see: Microsoft TechNet: Dismount-VHD


    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)

    diskpart

    list vdisk

    exit

    Click image for larger version. 

Name:	diskpart_list_vdisk.png 
Views:	111 
Size:	41.7 KB 
ID:	98013


    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 #

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

    For example: Dismount-VHD -DiskNumber 2


    Name:  Dismount-VHD_-DiskNumber_PowerShell.png
Views: 4043
Size:  13.0 KB


     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"

    Note   Note
    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"


    Click image for larger version. 

Name:	Dismount-VHD_-path_PowerShell.png 
Views:	89 
Size:	15.0 KB 
ID:	97996


    6. You can now close Windows PowerShell if you like.



    That's it,
    Shawn



  1. Posts : 5
    Windows 10 Home 64-bit
       30 Mar 2017 #1

    Mounted drive appears to be empty in File Manager


    Hi Brink. Thanks for your brilliant tutorials.
    I'm using W10 64-bit and its W7 Backup and Restore with an external 2TB hard drive for backup.
    With the aid of your tutorial I have mounted the .vhdx file for the C: drive system image as Drive M:, but when I try to view the contents of M: File Manager reports "This folder is empty". The image file size on the backup drive is 72.3 GB and the space used on virtual drive M: is only 9.7 MB of 17.9 MB capacity. The difference is suspiciously high to say the least. Both the real and the external hard drives are NTFS and 512 bytes per sector.

    I wonder if the problem could be related to VHD initialisation. I don't recall whether I chose MBR or GPT partition style, but I have a vague recollection of reading that GPT might be needed for UEFI. Would the wrong choice be accepted, and would it result in the above symptoms?

    Also, probably a minor point at present, but when I detach M:, either manually via Disk Management or by shutting down, the system seems to remember the attachment as M: and I no longer need to initialise. Does this mean I could run out of drive letters? Is there a way of completely removing this association? Do you mind if I suggest that this area be included in your tutorial if it has general relevance? My only other reference for this has been Windows 10 Inside Out, Bott, et al, Microsoft Press, 2015 - helpful as far as it goes.

    Thanks very much.
      My ComputerSystem Spec


  2. Posts : 20,847
    64-bit Windows 10 Pro build 16199
    Thread Starter
       30 Mar 2017 #2

    Hello Old Novice, and welcome to Ten Forums.

    Since this is a Windows Backup created from Windows 7, you might see if the method in the tutorial below may work for you instead to manually extract files from.

    Backup - Manually Extract Files from in Vista Windows 7 - Windows 7 Help Forums

    If this was a system image from Windows 7 instead, then see if this below may work better.

    System Image - Extract Files Using Disk Management - Windows 7 Help Forums
      My ComputersSystem Spec


  3. Posts : 5
    Windows 10 Home 64-bit
       02 Apr 2017 #3

    Hi, and thanks for your reply.

    There is no problem with File Backups. It is the System Image Backup .vhdx file which I am trying to view, using it to mount a VHD (Drive M which appears empty to File Manager. As you suggested I had a good look at the W7 tutorial for file mounting, and explored some of its links, but to no avail.

    I also tried to mount the VHD with Diskpart from elevated command prompt: Diskpart; select vdisk file=filename.vhdx; attach vdisk. There was no need to assign a drive letter as Windows remembered it, which is annoying. M: was again empty.

    Then, Windows PowerShell: Mount-VHD -Path "[location of vhd]". This cmdlet failed with error message "Mount-VHD is not recognised as the name of a cmdlet ...". Googling this, I found this could be due to the absence of a Hyper-V module for Windows PowerShell. Now, I know that Hyper-V Virtualization does not come with W10 Home but does with W10 Pro. Could my problem be related? Could it be that the image file is vdhx rather than vdh which I assume was the format in W7? I am out of my depth here, and don't want to experiment without advice.

    Out of interest I checked UEFI Bios and found Virtualisation Technology to be disabled, and Hyper-V missing from the Programs and Features list in Control Panel. With some trepidation I tried Enabling Virtualisation. Programs and Features list was unchanged, as was the PowerShell outcome and the zero content of M: after attaching via Disk Management. I returned Virtualisation to Disabled.

    Drive M:'s properties show its partition type to be GUID, not MBR.

    Grateful for any further thoughts. Thanks.
      My ComputerSystem Spec


  4. Posts : 20,847
    64-bit Windows 10 Pro build 16199
    Thread Starter
       02 Apr 2017 #4

    Just to verify, are you sure that you are trying to mount the correct largest VHD from the system image?
      My ComputersSystem Spec


  5. Posts : 5
    Windows 10 Home 64-bit
       03 Apr 2017 #5

    Yes. There are three .vhdx files in the image backup folder:

    <GUID Filename.vhdx>: (C: Drive, I assume) 75,845,632 KB The one I've been using.
    <GUID Filename.vhdx>: (Windows Recovery, I assume) 526,336 KB
    Esp.vhdx: (EFI System Partition) 110,592 KB

    However, this morning I discovered some new information which I think might be helpful. My initial backup drive was a Seagate 2TB Expansion Drive in use for over a year, but never really tested except for checking the backup files were readable in File Manager, but not the image files. A couple of weeks ago I dropped this drive and Windows Backup would no longer accept it, and it didn't pass the Long Generic test by SeaTools for Windows, although chkdsk /scan reported no problems with the files or file structure, so I hope they might be recoverable. I replaced the drive with a Seagate 2 TB Backup Plus Slim which I first checked with chkdsk and Seatools for Windows. The above file sizes come from the new drive.

    This morning I tried to attach a VHD using the .vdhx file from the old drive, and it worked!

    While this might point to a fault in the new drive, I wonder if it matters that the old drive is 4096 bits/sector and the new drive 512. I think I recall reading somewhere that W7 would automatically change from .vhd files to .vhdx if the drive were 4096. Could there be some confusion in my machine due to this change affecting the Attach process?

    I hope this is not a red herring.
      My ComputerSystem Spec


  6. Posts : 20,847
    64-bit Windows 10 Pro build 16199
    Thread Starter
       03 Apr 2017 #6

    Dropping the drive does indeed sound like the cause of a drive error affecting this.

    You might see if you are able to run Check Disk on the drive using the Repair drive option (if available) to see if that may help to with any bad sectors to hopefully be able to copy and read the .vhdx file from it afterwards.
      My ComputersSystem Spec


  7. Posts : 5
    Windows 10 Home 64-bit
       04 Apr 2017 #7

    Hi Brink
    Firstly, apologies that my last post was ambiguous. It was the old drive I had dropped that I was able to mount from and its replacement that I'm having trouble with.

    I did run chkdsk on both drives again, including the /f option on the new drive. Even though the dropped (old) drive is unaccepted by Windows Backup its existing files appear to be OK. So I succeeded in copying an old backup .vhdx file from the old drive to a new folder on the new drive. I could successfully mount the file from the old drive (to VHD N, but not its copy from the new drive (to VHD M; when trying to view M: from File Manager, I was still getting zero contents. It was while staring perplexedly at the Disk Management screen that I realised what was wrong, and I am very red-faced about it.

    In previous posts I mentioned that after initially assigning the drive letter M, future attempted attachments using the same file were automatically attached as M. I had just been accepting that, I guess without bothering to look carefully at the screen. It turned out that M had been assigned to the wrong VHD partition - the one at the right-hand side of the graphical display - and I had not picked it up. After correcting that everything works fine and I no longer have a problem. I also discovered that I can remove that ongoing association with the drive letter if, before detaching, I right click the (correct) VHD partition, choose the Change Drive Letter option and click Remove. I still think it would be helpful if you added a bit about this in this tutorial.

    So I do apologise for taking up your time; the upside of the exercise for me has been that I have learnt a lot and am now a member of 10 Forums.

    Regards and best wishes.
      My ComputerSystem Spec


  8. Posts : 20,847
    64-bit Windows 10 Pro build 16199
    Thread Starter
       04 Apr 2017 #8

    That's great news Old Novice. I'm glad you got it sorted.

    No need to apologize. It happens to all of us.
      My ComputersSystem Spec


 

Related Threads
How to Mount or Unmount ISO and IMG Files in Windows 10 An ISO or IMG file, also called a disc image, is a single file thatís a copy of an entire data CD or DVD. When you mount an .ISO or .IMG file, it will be added as a CD/DVD drive in This...
The thing is that since a few days ago, I can't mount any iso file which was made from a music CD. I can mount any other iso files (video DVDs, software), but music cds. This is what happens: ...
Solved How do I open a VHDX file? in Virtualization
Using Windows 10-64 and Windows backup and restore. I want to view a file that must be contained in a recent backup. I see the apparent backup files as vhdx. I right click to mount the virtual HD and get an error message as shown in the screenshot....
Magic ISO was removed when I updated to Windows 10 (though I had to clean up afterwards). One thing I found very useful with MagicISO was the ability to have several ISO files that were always mounted, but it appears that I can't RMB on an ISO...
Couldn't Mount File Warning in Installation and Upgrade
What does this mean exactly? Couldn't Mount File Virtual hard disk files can't be mounted from image files, or from removable media that isn't formatted with NTFS file system. I like 10 but being forced back to 8.1 because Speech Recognition...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:43.
Find Us