Boot from VHD Bare Metal

Below are the steps involved in setting up a machine (in this case my laptop) to boot from VHD when installing a new HDD. At some point I may come back and update with screen grabs but for the minute the steps should be enough for most proficient users.

  1. Install new HDD
  2. Boot from DVD. This must be either Windows 7 or Windows Server 2008 R2
  3. When the Install GUI loads Shift+F10 to open command prompt
  4. Type: DISKPART
  5. At the DISKPART Prompt type: list disk
  6. If you only have the newly installed HDD there should only be one entry here, in the case of multiple drives note the number of the new drive
  7. Type: select disk 0 (or the number noted previous if multiple drives)
  8. Type: list partition (should return none available if you have the new disk selected)
  9. Type: clean
  10. Type: create partition primary
  11. Type: format quick fs=ntfs
  12. Type: assign letter=c (or another suitable if multiple drives)
  13. Type: list partition (should now show the newly created partition)
  14. Type: select partition 1
  15. Type: active
  16. Type: create vdisk file=”C:filename.vhd” type=expandable maximum=100000 (maximum 100000 = 100Gb set as appropriate)
  17. Type: select vdisk file=”C:filename.vhd”
  18. Type: attach vdisk
  19. Use ALT+Tab to return to the install screen GUI
  20. Run the Windows installer as usual but select the vdisk as the installation drive. The installer will show a warning that windows cannot be installed to this disk, ignore it 😉
  21. Happily use your newly installed vhd boot machine!

Side notes:

This process cannot be carried out on a USB drive it has to be a permanent drive, it may work on eSATA but I don’t have a drive or connector to try it out with.

Creating a backup of the VHD for later recovery, this was one of the main reasons for using boot from VHD as I install a lot of beta software which can have a negative impact on the machines day to day running. I would advise taking a backup before installing any trial/beta software and then revert back to the backed up image if any issues occur:

  1. Boot from DVD, Windows 7/Windows Server 2008 R2
  2. Shift+F10 to open command prompt
  3. Type: C: (or whatever drive the image is on)
  4. Type: copy filename.vhd clone.vhd (this will take forever on a large drive)
  5. Type: exit
  6. Cancel the installation
  7. Done
With any luck this will be of use to someone out there!

Leave a Reply

Your email address will not be published. Required fields are marked *