Condividi tramite


Boot from Windows 7 VHD Boot without having any native Operating System

VHD boot is a new feature of Windows 7 and can be used in very creative ways. If you have a need for Reimaging a machine (like a testing environment) back to its original configuration then booting from VHD seem to be a very easy way to do it.

In this post I will outline the quickest way to build a machine from scratch with a VHD without installing any native operating System.

To get started you will first need to create a Windows 7 WinPE USB Disk (this can be done using the Windows 7 AIK)

  1. Boot the machine from the USB Drive into WinPE
  2. Format C: /q   -- This is optional, but make sure you delete c:\bootmgr
  3. Copy Windows 7 VHD file to any location on the hard disk [In this case I copied it to C:\VHD\Win7.vhd]
  4. Copy Bootmgr from the USB disk – Very important step, only the windows 7 Bootmgr will allow boot from VHD
  5. Type the following commands in the WinPE command window
    • C:\>DISKPART
    • DISKPART>SEL VDISK FILE="C:\VHD\Win7.vhd"
    • DISKPART>ATTACH VDISK
    • DISKPART>LIST VOL (This lists the drive letters and mappings, assuming F: maps to the VDISK)
    • DISKPART>Exit
    • C:\>Bcdboot F:\Windows

Now the system is ready, just Reboot the system and this will take you straight into your VHD.

If you have multiple VHDs, then you can copy all of them to the hard disk and repeat Step 5 for each of the VHD, specifying the path and file name appropriately.

Comments

  • Anonymous
    June 04, 2009
    Hi Vineet - thanks for posting this.  I was looking at the commands though and wondering why I need the Windows PE part - couldn't I boot from the Win7 DVD and run diskpart from the advanced setup options?  Or is the problem here the ability to provide access to the lcoal hard disk and my VHD at the same time? Mark

  • Anonymous
    June 05, 2009
    The comment has been removed

  • Anonymous
    December 09, 2009
    The comment has been removed

  • Anonymous
    September 20, 2010
    My problem is in dual booting.... I have both vista and windows7 installed but when I boot it comes up with Vista all the time I want it the other way around.. So that windows 7 boots up first......... please help

  • Anonymous
    April 13, 2011
    to mobile chippie Use easybcd and change the default os to boot. Its the easiest way.

  • Anonymous
    December 30, 2015
    The comment has been removed