Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If you just try to attach a VHD and then install Windows to a partition inside it, it will tell you that it's a "surfaced virtual disk" and that Windows cannot be installed to that partition.

But obviously it's a lie, because this is possible when booting directly off a DVD. :-)

So how do you do that from a running system?

share|improve this question

First of all, a warning: Close all your programs and save all your files before attempting this! Make sure there is nothing important still in the system cache! (Sync is handy for this.)

Windows does NOT perform a "graceful" shutdown using this trick!

When you're done with that, to 'trick' the installer thinking it's in Windows PE, simply create the registry entry


and run the installer from the DVD. It will now allow you to install to a VHD.

Once the installer says "Restarting in 10 seconds...", press Alt-Tab to go back to the registry editor (have it open!) and delete the MiniNT key so that you don't trick any other programs into thinking your current system is a PE system. :)

Now the system will reboot the kernel (the user mode shutdown process is bypassed) and should continue installing Windows to your partition.

Note 1: Drive letters probably won't be preserved this way, though.

Note 2: You can "try" to attempt to "fix" the drive letters immediately on the first reboot, before the second, when the installation is about to perform system-specific configurations. If you do so, however, be warned: Your \Users\All Users junction (and all the tens of other junctions/symbolic links) will point to your old system drive, not the new one! So you have to be prepared to fix this manually -- and yes, it's a pain to do this 'correctly' without corruption.

share|improve this answer
You could, in theory also edit the registry offline i suppose, or create a script that adds and removes the registry entry . Really cool trick tho – Journeyman Geek Jun 11 '12 at 3:17

Performing an install of Windows to a partition inside of a VHD, while running Windows consists of a few steps and some specific tools.

Tools required:

  1. ImageX - specifically for the platform of your current installation of Windows (i.e. x64 or x86). You can get it as part of the Windows Automated Installation Kit here:
  2. DiskPart - built into Windows 7.

High level steps:

  1. Using DiskPart, create the VHD. Then mount it in Windows, partition it, and assign a drive letter to the partition you'll want to use for the new installation. For discussion, let's say you assign the drive letter as "Z:\".
  2. Get access to the Windows 7 "install.wim" file. You can find it in the "\sources" directory of the Windows 7 installation disc. For discussion, let's say you have that mounted/inserted into drive letter "D:\".
  3. Using ImageX from an Administrator command-line, apply the Windows 7 "install.wim" file to the new VHD's partition by using the following command:

    imagex.exe /apply D:\sources\install.wim 1 Z:\

You can find more info about the ImageX tool here:

I hope that helps. I have used the above technique to make fresh installs of Windows 7 and Windows Server 2008/2008 R2 for both virtual machines and "boot from VHD" scenarios.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.