How to install Windows 7 or Server 2008 R2 from a Virtual Hard Disk (VHD) Part 2

Home > Blogs > Windows 7 > How to install Windows 7 or Server 2008 R2 from a Virtual Hard Disk (VHD) Part 2

How to install Windows 7 or Server 2008 R2 from a Virtual Hard Disk (VHD) Part 2

Like This Blog 4 Rick Trader
Added by April 30, 2012

In the last session we looked at how to install Windows 7 or Server 2008 R2 onto a virtual hard disk. In this session we will look at how to add a VHD file to an existing operating system and make it bootable. We will be using BCDEDIT.exe to add to the boot configuration data store. To get the syntax on how to use the BCDEDIT.EXE command type bcdedit /? at the command prompt.

Note: In Windows Vista and Windows 7 in order to modify the boot configuration data (BCD) store you must launch the command prompt with administrative privileges.

The first step is to copy the desired *.VHD file to the hard drive of the current operation system. In this demo, I will using the following path C:\VHD\2008R2.vhd

Note: If using windows 7 the command prompt must be ran as an administrator,

To view the current boot configuration data store, type: Bcdedit

boot configuration data store Bcdedit install virtual hard disk VHD

In the above data store there is currently one operating system available. Some of the above options are:

{id} – The GUID that is associated with the boot entry.

Default – If more than one operating system is available, this entry will identify the operating system that will be the default operating system.

Timeout – Count down timer used to allow for operating system selection if more than one operating system is available.

Device and OSDevice – Defines the partition to load the selected operating system.

Path – Path to the operating system loader file

NX – The NX option enables and configures Data Execution Prevention (DEP), a set of hardware and software technologies designed to prevent harmful code from running in protected memory locations.

Using BCDEDIT to add a VHD to the boot selection

Prior to making any changes to the BCD store a backup of the stores should be created by typing the following command:

Bcdedit /export “c:\datastore”

Note: This command will back up the data base to a file called datastore on the root of the “C” drive. If the database needs to be restored the /import switch could be used.

BCDEDIT /Copy

Use the BCDEDIT /copy command to copy an existing boot entry to be used by the new entry.

BCDEDIT copy command existing boot install virtual hard disk VHD

{current} – Identifies the GUID of the entry you desire to copy

/d – Adds a menu display name, the display name must be enclosed by “ “.

{ec70e4fc-87e6-11e1-a814-baa7f8fb05b7} – Is the newly generated QUID for the new operating system menu entry.

Note: Use the command prompt R2.vhdMark and Paste functions to copy and paste the above GUID including braces for use in the following commands.

BCDEDIT /Set

Use the BCDEdit /set command to configure specific boot entry elements.

BCDEDIT set command configure boot install virtual hard disk VHD

Device and osdevice – identifies the virtual disk (.VHD) and partition to load Windows Server 2008 R2 from.

Detecthal – option forces the loader to choose from a hard-coded selection of possible HALs and kernels, overriding any alternative specifications in hal or kernel options.

Bcdedit

Use BCDEDIT /v to view the new boot configuration data store.

BCDEDIT v command configure data install virtual hard disk VHD

New Window Boot Manager will allow you to now choose your desires operating system.

BCDEDIT /default

Use BCDEDIT /default to set the default entry that the boot manager will use when the timeout expires.

BCDEDIT default command configure data install virtual hard disk VHD

{id} – identifies the desired default operating system. In this example Windows Server 2008 R2 would be selected.

BCDEDIT /timeout

Use BCDEDIT /timeout to specify the time to wait in seconds before selecting the default entry.

BCDEDIT timeout command configure data install virtual hard disk VHD

The above entry would set the timeout value to 45 seconds.

Until next time, ride safe!

Rick Trader
Windows Server Instructor – Interface Technical Training
Phoenix, AZ

For more information, see the following posts in this series of posts on manipulating the Windows 7 Boot Configuration Database (BCD).

Part 1: How to install Windows 7 or Server 2008R2 from a Virtual Hard Disk
Part 2: How to install Windows 7 or Server 2008R2 from a Virtual Hard Disk (VHD)
Part 3: What happened to my BOOT.INI file?
Part 4: How to use BCDEDIT to add menu items to the selection screen in Win Server & Win7
Part 5: How to dual boot Windows 7 and Windows XP using BCD

Videos You May Like

Agile Methodology in Project Management

0 156 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

Windows 10 Features and Navigation – December 1, 2015

0 117 1

In this recorded Windows 10 webinar from December 1,2015, Windows Instructor Steve Fullmer presents the navigation and some of the new features associated with Windows 10 including Sysinternals Tools for Windows Client, Windows core concepts, exploring Process Explorer as well as some of the features that are not yet ready for prime time but will … Continue reading Windows 10 Features and Navigation – December 1, 2015

Detailed Forensic Investigation of Malware Infections – April 21, 2015

4 630 5

How does an investigator hunt down and identify unknown malware? In this recording of our IT Security training webinar on April 21, 2015, Security expert Mike Danseglio (CISSP / CEH) performed several malware investigations on infected computers and identify symptoms, find root cause, and follow the leads to determine what’s happening. He demonstrated his preferred … Continue reading Detailed Forensic Investigation of Malware Infections – April 21, 2015

Write a Comment

See what people are saying...

  1. Pingback: How to dual boot Windows 7 and Windows XP using BCD Configuration Database

  2. Pingback: What happened to my BOOT.INI file? | Interface Technical Training

  3. Pingback: How to use BCDEDIT to add menu items in Windows Server and Windows 7

  4. Pingback: Install Windows 7 or Server 2008R2 from a Virtual Hard Disk VHD part1 | Interface Technical Training Blog

Share your thoughts...

Please fill out the comment form below to post a reply.