Deploying Win 7 to Boot From VHD with MDT 2010

One of the more difficult scenarios that customers have found in the past is multi-booting a new OS. The effort needed to re-partition the drive to allow for the new OS is sometimes too great. One new solution that is gaining ground in deployment is Boot From VHD. This allows you to take a VHD file with Windows 7 or Windows Server 2008 R2 and boot your machine to it. This means that you can take advantage of the physical hardware of your machine while not having to repartition your drive for Win 7 and keep your original OS intact. More information on how to Boot From VHD can be found here https://edge.technet.com/Media/Windows-7-Boot-from-VHD/ .

MDT 2010 Beta 1 can deploy Win 7 Beta out-of-the-box however, it deploys it to the Disk 0 Partition 1 by default. In order to change this behaviour so that MDT 2010 deploys Win 7 to a VHD and leaves your existing OS you can follow the steps below:

1. Create a Task Sequence to install Win 7 in MDT 2010

2. Insert the following 3 steps in the Pre-Install \ New Computer only Phase:

a) Disable the format and partition disk step

disable

b) Insert a Set Task Sequence Variable Step to set the path for the VHD with the variable BootVHDLocation. Ensure that path DOES NOT EXIST already on the machine.

BootVHD01

c) Insert a Set Task Sequence Variable Step to set the size of the VHD (in MB) with the variable BootVHDSize. Ensure that there is enough space on the drive as the VHD may grow to this size.

BootVHD02

d) Insert a Run Command Line step to run the command line cscript.exe "%SCRIPTROOT%\ZTIDiskPartVHD.wsf"

BootVHD03

3. Copy the attached script below to your Distribution$\Scripts folder.

4. Run your task sequence on a machine and watch Win 7 install into a VHD. Once the process is done, your machine will have a boot menu similar to this:

BootMenu

Please note, this script does not deal with BitLocker encrypted drives and Boot From VHD will only work with Windows 7 Beta or Windows Server 2008 R2. As always test this out and feel free to post comments.

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .

This post was contributed by Aly Shivji a consultant with Microsoft Services - U.S. East Region.

ZTIDiskpartVHD.zip