2

How do you mount a .vhd file in Windows Vista? In Windows 7 you use disk management but there is no option available for Windows Vista.

nitiger
  • 121
  • 1
  • 3

2 Answers2

2
  • Download MS Virtual Server 2005 R2 SP1
  • Download its update
  • Open an administrator command prompt and run setup /v"PATCH=%cd%\KB948515.msp ADDLOCAL=VHDMount"
  • Choose custom install
  • (optional) Use/add the following reg file for a very handy mounting

    Windows Registry Editor Version 5.00 
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell]
    @="Mount" 
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount - Commit]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount - Commit\command]
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /u /c \"%1\""
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount - Discard]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount - Discard\command]
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /u /d \"%1\""
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Mount]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Mount\command]
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /m \"%1\""
    
    [HKEY_CLASSES_ROOT\.vhd]
    @="Virtual.Machine.HD"
    
  • (optional) Install Virtual PC 2007 for a nice GUI to create/manage/merge disks

If you are using Home editions (officially unsupported by Virtual Server) my recommended workaround is using a hex editor on its setup.exe to change CAP_DisallowedOS = 1 string to 0.


In some rare(?) occasions, msiexec may crash almost at the end of installation with a 0xc000000d BEX error (VHD Mount Merge Module Custom Dll does something fishy while trying to install Microsoft Virtual Server Storage Bus driver)

Mysteriously, stopping WPDBusEnum service seemed to fix the issue.


Addendum: I have been getting quite a lot of BSOD with standby. So I decided for unmounting the thing before going to sleep, and re-mounting after resume. Unfortunately vhdstor driver seems to get stuck after awhile, locking disk file against further actions.

I eventually came down to program Microsoft Virtual Server Storage Bus on/off for every suspension

mirh
  • 955
  • 1
  • 10
  • 21
  • Great work!! Do you think it's possible to patch W8.1 editions in order to use VHD tools (for powershell) as well, using a similar method? Also, what does the `CAP_DisallowedOS` do? (Google returned 0.) – not2qubit Jan 20 '20 at 14:10
  • 1
    It's a property set by the VSWIXCustomActions dll when, guess what, it happens not to like your OS. I suppose you could even fake somehow the reported version then, but at the end of the day I just found easier to edit that bit in the installer. As for newer Windows, the problem seems more to do with a "hardblock" entry in the [compatibility](https://docs.microsoft.com/en-us/archive/blogs/virtual_pc_guy/installing-virtual-server-2005-r2-sp1-on-windows-7) database than the msi. But as I already commented below, I don't really see much a point when from 7 onward VHD is natively supported OOTB. – mirh Jan 20 '20 at 17:59
0

You can use DiskPart & scripts, or use Virtual Server 2005 R2... or how about Gizmo Drive?

Logman
  • 3,640
  • 1
  • 19
  • 30
  • Diskpart supports VHDs [only](https://blogs.msdn.microsoft.com/7/2009/10/07/diskpart-exe-and-managing-virtual-hard-disks-vhds-in-windows-7/) starting from W7 – mirh Jul 18 '17 at 10:06