Monday, November 14, 2011

Booting Windows Server 8 from a VHD

In the previous, think some of you might heard about dual boot on a single machine. Have you ever think that you can do so with a virtual hard drive. The beauty of the VHD, when you are done with it, just delete it and make a new one.

In other area also, VHD provide a good performance in the Fixed Size disk and it do not require Hyper-V to boot them. Here I am going to explain some of the steps. They will be just 4 simple steps. Download the Windows Server 8 Preview and start to test it out your self at Windows Server 8 Preview download page.

Step 1 : Create Virtual Hard Drive by using diskpart.

  1. diskpart
  2. create vdisk file=”e:\winsrv8devprev.vhd” maximum=20000 type=FIXED
  3. select vdisk file=”e:\winsrv8devprev.vhd”
  4. attach vdisk
  5. create partition primary
  6. assign letter=W
  7. format quick fs=ntfs label=WINSRV8DEVPREV
  8. exit 

Step 2 : Preparation for installation.

  1. Create a folder in Drive e:\vhd
  2. Copy the install.wim from the cd\sources\install.wim to e:\vhd
  3. Download powershell script from http://archive.msdn.microsoft.com/InstallWindowsImage/Release/ProjectReleases.aspx?ReleaseId=2662
  4. After you have perform step 1 and 2, to proceed to the next steps you can either use step 3.1 or 3.2.But my prefer option will be using powershell

Step 3.1 : Installing WIM Image to VHD (powershell)

  1. Open cmd and cd to e:\vhd
  2. run powershell command and run the following command to change the behaviour of the powershell to allow any scripts to be loaded set-executionpolicy unrestricted
  3. .\install-windowimage.ps1 -WIM install.wim
  4. .\install-windowimage.ps1 -WIM install.wim -Apply -index 1 -Destination w:

 Step 3.2 : Installing WIM Image to VHD (imagex)

  1. Open cmd and cd to e:\vhd
  2. run powershell command and run the following command to start the installation "imagex /apply d:\install.vim 1 w:" 
Now we are good to move on, we have completed our setup on the virtual hard drive setup. We are ready to configure the virtual hard disk to be bootable in a non hyper-v setup. The following next step, you will have an easy option to configure and making sure the virtual hard drive can be boot. Each of the steps give you an idea what is required.

 

Step 4.1 : Configure vhd boot (1 step)

  1. bcdboot w:\windows

Step 4.2 : Configure vhd boot (4 step)

  1. bcdedit /copy {current} /d "Windows 8 Preview"
  2. bcdedit /set device vhd=d:\vhd\windows8.vhd
  3. bcdedit /set osdevice vhd=d:\vhd\windows8.vhd
  4. bcdedit /set detecthal on
    If you can't find the guid, below got some example where to look for guid which also known as identifier

    guid-identifier-windows-7-bcdedit

    I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.

      No comments:

      Post a Comment