Skip to main content

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.

image

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.

image

Comments

Popular posts from this blog

Adding a Comment to a GPO with PowerShell

As I'm writing this article, I'm also writing a customization for a PowerShell course I'm teaching next week in Phoenix.  This customization deals with Group Policy and PowerShell.  For those of you who attend my classes may already know this, but I sit their and try to ask the questions to myself that others may ask as I present the material.  I finished up my customization a few hours ago and then I realized that I did not add in how to put a comment on a GPO.  This is a feature that many Group Policy Administrators may not be aware of. This past summer I attended a presentation at TechEd on Group Policy.  One organization in the crowd had over 5,000 Group Policies.  In an environment like that, the comment section can be priceless.  I always like to write in the comment section why I created the policy so I know its purpose next week after I've completed 50 other tasks and can't remember what I did 5 minutes ago. In the Group Policy module for PowerShell V3, th

Return duplicate values from a collection with PowerShell

If you have a collection of objects and you want to remove any duplicate items, it is fairly simple. # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   # Remove the duplicate values. $Set1 | Select-Object -Unique 1 2 3 4 5 6 7 What if you want only the duplicate values and nothing else? # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   #Create a second collection with duplicate values removed. $Set2 = $Set1 | Select-Object -Unique   # Return only the duplicate values. ( Compare-Object -ReferenceObject $Set2 -DifferenceObject $Set1 ) . InputObject | Select-Object – Unique 1 2 This works with objects as well as numbers.  The first command creates a collection with 2 duplicates of both 1 and 2.   The second command creates another collection with the duplicates filtered out.  The Compare-Object cmdlet will first find items that are diffe

How to list all the AD LDS instances on a server

AD LDS allows you to provide directory services to applications that are free of the confines of Active Directory.  To list all the AD LDS instances on a server, follow this procedure: Log into the server in question Open a command prompt. Type dsdbutil and press Enter Type List Instances and press Enter . You will receive a list of the instance name, both the LDAP and SSL port numbers, the location of the database, and its status.