Q. How can I make registry changes to an offline Virtual Hard Disk (VHD) with Windows 7 or Windows Server 2008 R2?
It's possible to mount registry stores from other OSs into the registry editor and make changes.
April 22, 2010
A. It's possible to mount registry stores from other OSs into the registry editor and make changes, and this applies equally to VHD files. Mount the VHD using Disk Administrator or Diskpart with the attach command, and you can then view the VHD file system. Launch the registry editor, load the hive of interest from the %systemroot%system32config of the mounted VHD, then make the changes and unload.
You can do all of this from the command line. Assuming the E: drive is the mounted VHD, to stop dynamic VHD expansion for the VHD (as discussed in the previous FAQ), run the following:
reg load HKLMVHDSYS e:windowssystem32configsystem reg add HKLMVHDSYSControlSet001servicesFsDependsParameters /v VirtualDiskExpandOnMount /t REG_DWORD /d 4 /f reg unload HKLMVHDSYS
Note that all I'm doing is mounting the system registry area of the VHD into the HKEY_LOCAL_MACHINEVHDSYS namespace, modifying that namespace, then unloading. It's actually not a complex process, and you can use this technique for many types of change.
About the Author
You May Also Like