Welcome to TechNet Blogs Sign in | Join | Help

Windows 7: Boot from VHD First Impression: Part 3 (Booting VHD from Vista SP1 or later)

Hello All,

In last 2 parts we have seen how easily we can create/attach VHD files in Windows 7 and how easy it is to boot from VHD. In this part we will see booting the VHD file from PC running Windows Vista operating system. We have native support for VHD in Windows 7 and the bootloader in Windows 7 understands the VHD files that is the reason we can actually boot from VHD file.

In order to boot a vhd file in Windows Vista, we will have to follow 3 steps.

  1. Copy the Windows 7 bootloader from a machine running Windows 7
  2. Create the back up of a existing bootloader on a PC running Windows Vista
  3. Replace the Windows 7 bootloader files on a PC running Windows Vista Operating System
  4. Copy/Create VHD files in Vista machine and Adding the VHD entry in Boot Menu for VHD Boot and then Boot from VHD

Copy the Windows 7 bootloader from a machine running Windows 7

In order to boot from VHD we need to have the bootloader that understands the VHD file. Apparently, Windows Vista bootloader does not understand VHD files and hence cannot boot into the VHD file.

To solve this issue, we will first obtain the bootloader from PC running Windows 7. Now, boot into a machine Windows 7. You can download Windows 7 Beta build 7000 and use that bootloader.

Basically, we require 2 files BootMgr and BCDEdit.exe. If you have Windows 7 installed on a single partition then your ‘bootmgr’ file is located on ‘C:\’ (i.e. your system, active, primary partition) and your ‘bcdedit.exe’ file is located in ‘C:\Windows\System32’ folder.

After booting into Windows 7, connect the USB thumb drive or flash drive. For this step open the Elevated Command Prompt with Administrator Privileges and type the following commands.

C:\windows\system32>xcopy /h /y bcdedit.exe f:\    (Note: F: is the external USB Thumb Drive or Flash Drive)

/H - Copies hidden and system files also.

/Y  - Suppresses prompting to confirm you want to overwrite an existing destination file.

C:\>cd\

C:\>xcopy /h /y bootmgr f:\

Once done unplug the USB thumb drive, we will need it when we will replace the files to Vista machine.

image

 

Create the back up of a existing bootloader on a PC running Windows Vista  (MAKE SURE YOU PERFORM THIS ON YOUR VISTA MACHINE)

In this step, we will take the back up of existing bootloader. Basically, the backup of the 2 files BootMgr and BCDEdit.exe if in case. The ‘bootmgr’ file is located in ‘C:\’ and your ‘bcdedit.exe’ file is located in ‘C:\Windows\System32’ folder. Boot into WINDOWS VISTA.

For this step open the Elevated Command Prompt with Administrator Privileges and type the following commands.

C:\windows\system32>cd\

C:\>xcopy /y /h bootmgr bootmgr.sav

Press f after prompted

C:\>cd Windows\System32

C:\windows\system32>xcopy /y /h bcdedit.exe bcdedit.sav

Press f after prompted

image

Replace the Windows 7 bootloader files on a PC running Windows Vista Operating System (MAKE SURE YOU PERFORM THIS ON YOUR VISTA MACHINE)

In this step, we will replace Windows 7 bootloader with existing Windows Vista bootloader. Thus, we will overwrite BootMgr and BCDEdit.exe, which are located in ‘C:\’ and  ‘C:\Windows\System32’ folder.

For this step use Windows Vista Bootable DVD or Windows 7 Bootable DVD and Boot into Windows Recovery Environment or WinPE.

After selecting the operating system open the Elevated Command Prompt and type the following commands.

C:\>attrib bootmgr –s –h –r                     (Note:  C: is the Windows Vista OS Partition)

Attribute command with –s –h –r changes the System, Hidden and Read Only attributes of a given file.

C:\>e:                                                          (Note:  E: is the Thumb Drive or Flash Drive)

E:\>xcopy /y /h bootmgr c:\bootmgr

E:\>xcopy /y /h bcdedit.exe c:\windows\system32

Now you are ready to Boot from VHD on your Windows Vista machine.

image

Copy/Create VHD files Vista machine and Adding the VHD entry in Boot Menu for VHD Boot and then Boot from VHD

Rest all is same as my previous posts. Refer Windows 7- Boot from VHD First Impression- Part 1 and Windows 7- Boot from VHD First Impression- Part 2 for creating the VHD and adding them into the Boot Menu.

After the booting up you will see two entries Windows Vista and VHD file. Select the VHD and hit, and you are now booting from VHD.

Aviraj Ajgekar

Published Wednesday, January 28, 2009 10:36 PM by aviraj
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# 再谈从虚拟磁盘文件启动计算机

Sunday, February 01, 2009 3:55 AM by 喻勇(Frank Yu)的技术博客

最近发了一系列关于在Widows 7下使用VHD启动计算机的帖子( 帖子一 、 帖子二 、 帖子三 ),得到了网友们比较热烈的回应。大牛 Aviraj Ajgekar 在他的博客中又列出了在Vista

# re: Windows 7: Boot from VHD First Impression: Part 3 (Booting VHD from Vista SP1 or later)

Saturday, July 25, 2009 10:26 AM by realtebo

Is it possible to install the windows 7 bootloader on a USB stick and then copy the VHD into USB to boot directly the VHD from a boot via USB?

To be full portable...

# re: Windows 7: Boot from VHD First Impression: Part 3 (Booting VHD from Vista SP1 or later)

Thursday, October 08, 2009 5:19 PM by RustyB

Is it possible to use this method to create a .wim file of Vista (after modifying the bootloader) that could be booted from a VHD? Is it also possible to get a download of the bootmgr and bcdedit.exe files if I don't have windows 7 enterprise or ultimate?

# re: Windows 7: Boot from VHD First Impression: Part 3 (Booting VHD from Vista SP1 or later)

Friday, October 09, 2009 2:47 AM by aviraj

Nope. Currently you cannot use Windows 7 or Windows Server 2008 R2 for boot from USB.

# re: Windows 7: Boot from VHD First Impression: Part 3 (Booting VHD from Vista SP1 or later)

Wednesday, November 04, 2009 2:35 PM by Garry Martin

# re: Windows 7: Boot from VHD First Impression: Part 3 (Booting VHD from Vista SP1 or later)

Thursday, November 05, 2009 1:52 AM by Bruno Figueiredo

Hi,

is it possible to boot Vista from VHD ? I've tried but keep getting the startup repair window.

I've simply created a VHD, installed vista, added to the boot manager. Am I missing something?

Thanks

# re: Windows 7: Boot from VHD First Impression: Part 3 (Booting VHD from Vista SP1 or later)

Thursday, November 05, 2009 4:35 AM by aviraj

Boot from VHD supports only for Windows 7 and Windows Server 2008 R2. There is no downlevel OS support.

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker