My Notes for Setting up a Bootable VHD

 

This entry is just my raw notes for setting up a bootable VHD under Windows 7 (I  moved from SP 2010 Beta 1 into Beta 2). If you want to learn what this is about I suggest you start with Hanselman’s post (see link below). Its better. This post represents condensed notes I made for me.  My notes are based on Hanselman’s directly – with slightly less word count 🙂 using a specific approach

http://www.hanselman.com/blog/StepByStepTurningAWindows7DVDOrISOIntoABootableVHDVirtualMachine.aspx

Also, see my post on related virtualization tools and links

http://curriersblog.spaces.live.com/blog/cns!1FE2EFF5F31CEDCA!405.entry

Steps to create a bootable image made on a Windows 7 Ultimate machine

Create the Image
========================================================================================================

1. Install the Windows 7 AIK

2. Create a location to create your bootable image like C:BootImage

3. Burn a Win 2008 ISO disk, place in cd drive (d:)
   Or copy an ISO file to your computer and use 7-Zip to crack it open at http://www.7-zip.org/

4. Use IMAGEX.EXE from the AIK to find the designated SKU of the OS on the ISO Disk (note: for some reason could not find in the AIK, so used a copy I had ??)

   Copy IMAGEX from the AIK Tools directory c:Program FilesWindows AIKTools into c:BootImage (or similar) 

   Use this command line ==> IMAGEX.EXE /info d:sourcesinstall.wim

   The <DESCRIPTION> Tag will contain the SKU – ex: SERVERENTERPRISE

5. Download WIM2VHD script

http://code.msdn.microsoft.com/wim2vhd – move to c:BootImage

6. Open an elevated command window CMD.EXE using "Run As Administrator" at c:BootImage, this is important

7. Create a batch file containg the following script in c:BootImage makeboot.bat (no need to do this – just lazy for next time I do this)

   A Windows Server 2008 R2 Server Enterprise VHD, named win2008r2.vhd from your ISO disk (d:)

   CSCRIPT WIM2VHD.WSF /WIM:D:sourcesinstall.wim /SKU:SERVERENTERPRISE /VHD:C:BootImagewin2008r2.vhd

Add to machine startup
=========================================================================================================

1. Copy new VHD file made (made from above) to some archive location for use at some point in the future 

2. Open an elevated command window CMD.EXE using "Run As Administrator"

3. Run this command to obtain a place in the boot menu

   bcdedit /copy {current} /d "SharePoint 2010 Beta 2" (of course, you name this anything you want)

   in my case the guid returned was {cf6a4228-d247-11de-8dad-ed8c852314d7}

4. Attach the bootable image (note: both square and curly brackets are required)

   bcdedit /set {cf6a4228-d247-11de-8dad-ed8c852314d7} device vhd=[C:]BootImagewin2008r2.vhd
   bcdedit /set {cf6a4228-d247-11de-8dad-ed8c852314d7} osdevice vhd=[C:]BootImagewin2008r2.vhd
   bcdedit /set {cf6a4228-d247-11de-8dad-ed8c852314d7} detecthal on  

5. Confirm this is part of the boot menu using
   bcdedit /v

5. Reboot and select "SharePoint 2010 Beta 2" to boot into

Other optional Stuff (required to delete or inspect boot)
===========================================================================================================

To see the boot listing open CMD as an administrator and type

bcdedit /v

under identifer I see {6b05eae7-7ed2-11de-9273-ea77fd91edfa} which should be removed. Use the following command

ex: bcdedit /delete {6b05eae7-7ed2-11de-9273-ea77fd91edfa}

To make a boot entry the default use this command

ex: bcdedit /default {6b05eae4-7ed2-11de-9273-ea77fd91edfa} in this case my Windows 7 install becomes my default

You will need to use the CMD Edit – Mark – Copy from the command window to copy out the identifier

Optional stuff to play with (not required for bootable disk)
============================================================================================================
To create a new virtual disk that is expandable with a max size of 100 Gig 

This is the sample DISKPART script to create a virtual disk

Type "DiskPart" from the command prompt – you will see the DISKPART> prompt

   create vdisk file="C:BootImagewin2008r2VDISK.vhd" type=expandable maximum=100000
   select vdisk file="C:BootImagewin2008r2VDISK.vhd"
   attach vdisk

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s