Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Thursday, January 6, 2011

Boot from a VHD file

Windows 7 and Windows Server 2008 R2 has a really neat testing feature.  It is called boot from VHD.  A VHD stands for Virtual Had Disk.  It is the file type that is used in Hyper-V virtual machines.  What this boot option does for you is it allows you to test an image on the actual hardware, before you deploy an image of the VHD to your clients and servers.  Here is how you set up a Boot from VHD on Server 2008 R2.

First, open Server Manager.

Expand Storage and click Disk Management. Give it a few seconds to load.

Right click Disk Management and select Attach VHD.

In the Attach Virtual Hard Disk window, click Browse.

In the Browse Virtual Disk files window, browse the the VHD file and click it.

Click Open.

Click OK.

Take note of the drive letter the VHD mounted as. In my example, the drive letter is W.  You will also notice that its icon is a light blue as opposed to a light grey for actual physical drives.


Close Server Manager.

Open a command prompt as an Administrator.  To do this click Start.  Type CMD.  If the Programs list, right click CMD and select Run as Administrator.  You may be prompted for credentials.

Type bcdboot w:\windows and press enter.  You will see the output as Boot files successfully created.

Type bcdedit /set {default} Description VirtualComputerName.  This will change the descripting listed on your boot options.  Since my host and this VM are both Windows Server 2008 R2 installations, they both say Windows Server 2008 R2.  Not exactly very descriptive. 

Once this change is made, click Start.

Right click Computer and select Properties.

In the System window, click Advanced System Settings.

In the Advanced tab, under Startup and Recovery, click Settings…

Clicking on the Default operating system drop down box will allow you to choose the OS that will start each time this host boots unless the user selects another OS.

Check the Time to display list of operating systems box to set a timer that will pause the boot sequence and allow the user to choose an alternate OS to boot to.  Click OK when you are done.

Go ahead and boot into your VHD.


No comments: