I was getting caught up on some blog reading over my lunch hour and noticed a new post by the Deployment Guys on their blog. If you didn’t know, with Windows 7, you can now boot from VHD; there is even a trick to make Windows Vista boot from VHD. Booting loads the VHD and uses your physical hardware, its a great way multi-boot a computer into an OS that is VHD aware. In the Microsoft world, at this point in time, this means Windows 7 and Windows Server 2008 R2.
The post from the Deployment Guys blog explains how to deploy Windows 7 using Microsoft Deployment Toolkit 2010 (MDT 2010) to a computer and instead of deploying to Disk 0 Partition 1, it is set to deploy to VHD file.
How to Setup MDT to Create a Boot from VHD Deployment
So how do we do this? Here’s the point form version. (You can get pictures from the Deployment Guys blog)
- Create a task sequence to deploy Windows 7
- You are going to insert 3 steps in the Pre-Install \ New Computer only phase
- Edit the task sequence that changes how the drive is partitioned (I presented how to do this at TechDays Ottawa). In this case we don’t want to partition or format the drive. Disable this task sequence.
- Insert a Set Task Sequence Variable Step named Set Boot VHD Location. You set the location of the VHD file is by setting the Task Sequence Variable to BootVHDLocation and set the Value to the location where you want the file to exist. (for example C:\Boot1Windows7.vhd) Ensure that the file you named in the variable doesn’t already exist.
- Insert a Set Task Sequence Variable Step named Set Boot VHD Size. Set the task sequence variable to BootVHDSize and set the value to the maximum size you want the VHD to be. Ensure you have enough space to grow to the maximum.
- Insert a Run Command Line Step and call it Setup VHD. The command line is cscript.exe “%SCRIPTROOT%\ZTIDiskPartVHD.wsf (There is no start in value.)
- Download the script ZTIDiskPartVHD.wsf and copy is to your Distrobution$\Scripts folder. The link to the script is at ZTIDiskpartVHD.zip
- Run your task sequence on a computer and it will install Windows 7 into a VHD.
This doesn’t work on machines that use Bitlocker to encrypt the drive.
The full article can be found at: http://blogs.technet.com/deploymentguys/archive/2009/03/03/deploying-win-7-to-boot-from-vhd-with-mdt-2010.aspx. They have pretty pictures to help you out.
This is a really smart way to boot into different environments. You can have different VHD images for different tasks, ie. One for programming, one for gaming, etc. Pretty sweet and easy to deploy when using MDT