How to install Windows 7 on a VHD

Michael PietroforteMVP By Michael Pietroforte - Mon, March 23, 2009 - 3 comments google+ icon

Michael Pietroforte is the founder and editor of 4sysops. He is a Microsoft Most Valuable Professional (MVP) with more than 30 years of experience in system administration.

In my last post, I described some of the ways in which Windows 7′s support for native boots from a VHD can prove to be useful. In this article, I will outline how you can install Windows 7 on a VHD. I am aware of four alternative methods:

Install Windows 7 directly

1. You can install Windows 7 directly to a VHD. I find this procedure quite complicated.

Install Windows 7 in a Hyper-V virtual machine

2. If you have Hyper-V, you can install Windows 7 there, and then copy the VHD to the physical computer from which you want to boot this machine. Don’t forget to sysprep the machine first:
C:\windows\system32\sysprep\sysprep /generalize /shutdown

Use ImageX and Windows Disk Management

3. If you have another Windows 7 or Windows Sever 2008 R2 machine, you can create and attach a VHD using Disk Management and then use ImageX of the Windows 7 WAIK to apply an OS image of install.wim (from either the Windows 7 ISO file or DVD) to the mounted drive as follows. Note that “x” represents the drive letter of the drive on which you mounted the VHD and that “4″ points to the fourth OS image in the WIM file, which is Windows 7 Ultimate:

imagex /apply d:\install.wim 4 x:\

Use Wim2VHD

4. The Wim2VHD tool is similar to method 3 in how it works, but is perhaps a somewhat easier method than the manual one described in method 3. To use this tool, you will also need a Windows 7 or Windows Server 2008 R2 machine and a Windows 7 WAIK.

It may also be possible to use Virtual PC 2007 to create the Windows 7 VHD — but this didn’t work when I tried it. Maybe it was because my “physical test machine” was a virtualized VMware Workstation machine. Windows 7 started to boot from the VHD within the VMware VM, but then VMware Workstation produced an error message: “The CPU has been disabled by the guest operating system”. Well, even Windows 7 can’t run without a CPU. I think the problem was caused by the Virtual PC VHD. Cesar da la Torre had a similar problem in a physical environment.

Do you know of any other ways to create a Windows 7 VHD that can be used as a boot device on a physical machine?

-1+1 - Rate this post
Loading ... Loading ...
Disclaimer
Your question wasn't answered? Please ask in the new 4sysops forum!

3 Comments- Leave a Reply

  1. SLam says:

    I have W7 and R2, so I can test out methods 2,3,4.

    VHD is a good flexible format that can be easily converted to VMDK and XVA.

  2. Joel says:

    There is a tool on MSDN for quickly creating VHDs. It does not zero out the contents of the VHD, so do not use if others will have access to the VHD, but for testing, it is a huge time saver:

    http://code.msdn.microsoft.com/vhdtool

  3. Slam, I hope your tests were successful. ;-)

    Joel, thanks for the tip. I blogged about the VHD tool last week.

Please share your thoughts in a comment!

Login

Lost your password?