Sharing of thoughts and information is what blogging is all about. This way we can learn from each other. Post A Comment!These postings are provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
Chris Di LulloSr. IT Pro Marketing Manager Twitter | LinkedIn Pierre Roman Twitter | LinkedIn Mitch Garvis Twitter | LinkedIn Anthony Bartolo Twitter | LinkedIn
Many individuals who attended the IT Virtualization Boot Camp or Private Cloud Boot Camp in the last few months have asked how we set up the systems and how we are able to reset computers back to a pre-Camp state to take to the next event. The actual reset process is a simple XCOPY of the pre-Camp VMs and boot files over the ones that IT Pros worked with during the camps. A key piece of this process is the ability to boot from VHD. In this post, Mitch Garvis takes you through how to make use of this technology to boot multiple operating systems or versions of an OS on the same hardware.
I spend a lot of time demonstrating different technologies for different audiences. Because of that I often need to use different operating systems and rather than take along several machines (which I often have to do anyways, but for other reasons) I have taken to configuring my laptop (currently an HP EliteBook 2740p) in a multi-book configuration. When I boot up I get a menu asking me which OS instance I want to boot, and I am off to the races!
Of course, this is easier said then done when some of the operating systems that I use and present change as often as they do – either because of things that I do (domain join, virtualization demos) or new versions (as is the case with the current Windows 8 and Windows Server 2012). This problem is easily solved using the Boot from VHD (virtual hard disk) functionality in Windows 7 (and later).
Step 1: Preparing your host system
Although this is not strictly necessary, I like to partition my physical hard drive and place the VHDs on a separate partition from the operating system that is installed on the physical disk. This is partially a legacy practice from when I would install all of my operating systems for the multi-boot scenario on the disk itself. My current configuration has three partitions, one whose sole purpose is storing the OS VHDs. However thinking about it logically, there is no good reason I can think of why you can’t simply store the VHDs on the C drive.
You need to have the source media for the operating system you plan to install, as well as the imagex.exe file, which is a component of the Windows Automated Installation Kit. You can download this from download.microsoft.com, but make sure you download the version appropriate for the operating system and architecture on which you are installing it.
Because I often work with multiple images, I create a directory on my system called d:\VHDs, and in that folder I create a sub-folder for each image file. So I may have the following directories:
Step 2: Creating a VHD
There are a couple of ways you can create VHD files within Windows. I prefer to use the Disk Partition Tool (diskpart.exe) but if you want you can also use the Disk Management Tool within the GUI.
Step 3: Apply the image to the VHD file
Now that our VHD file is attached to the computer, it is visible in Disk Manager. Load that up (right-click on Computer, click Manage, and in the navigation pane click Disk Management) and initialize the disk, and then create a simple volume. Take note of the drive letter that is assigned to it. For the sake of the later step, let’s say the letter F: was assigned.
We can now apply the image using the ImageX tool.
Step 3 will take a few minutes, but when it is done you can list the files and see that it resembles a bootable Windows 2008 R2 hard drive. The problem is that most hardware will not recognize a VHD file as a boot device, so we need to edit the boot configuration data file, or BCD.
Step 4: Editing your Boot Configuration Devices (BCD) file
Although this can be done from the command line (using bcdedit.exe) it is a bit of a pain. there is a free (for personal use only) GUI tool called EasyBCD 2.1.2 which can do it for you.
You are done! All ready to go.
For Bonus Points!
That’s it. The multi-boot option gets fancier in Windows 8, and I will cover that in a later article. For now, as you know I always look forward to your comments and thoughts, and who knows… I might even give away the occasional prize for a good comment!
Mitch Garvis is a Renaissance Man of the IT world. He is a partner with SWMI Consulting Group, in addition to being a Virtual Partner Technology Advisor for Microsoft Canada. Among his numerous certifications are several MCITPs, as well as the new MCSE: Private Cloud. He lectures and trains on a variety of topics including System Center, server virtualization, desktop deployment, and security. You can read his blog at www.garvis.ca, or follow him on Twitter as @MGarvis. In his spare time he likes to break things, and has recently earned his Second Degree Black Belt in Taekwondo. He makes his home outside Toronto where he has one wife, two kids, two dogs, and two minutes to himself per day.
I'll assume it's EasyBCD but Step 4, item #1 says BCDEdit.
Damir. Xcopy? That's so 90s. :-) Use Robocopy. It's included in Windows 7 [at least].
If you like the EasyBCD GUI, you should check out GImageX, a GUI for imagex. I have no problems with command line, but sometimes it's nice to use a GUI. Saves my eyes from buggin' out.
@Ed - You're right, it should say EasyBCD instead of BCDEdit. Sorry about the confusion.
@Ed - In reality I just use Windows Explorer to copy and paste, which has Robocopy functionality built in.
@Mr.Hat - Thanks for the tip. Will look at it.