How to Install Windows Server 2008 R2 or Hyper-V Server 2008 R2 into a VHD and then Boot via Multiboot


Do you want to try out Hyper-V Server 2008 R2 and don't have a spare machine for testing?

By following the instructions below you can install the following operating systems in a VHD file and then boot directly from VHD. In addition you can backup these "pseudo-partitions" easily since they are contained in a single VHD file:

Hyper-V Server 2008 R2

Windows 7

Windows Server 2008 R2 (Full or Server Core installations)

Requirements: Windows 7 or Windows Server 2008 R2. Windows PowerShell needs to be installed.

 

Instructions:

1. Download Hyper-V Server 2008 R2 (or Windows 7, Windows Server 2008 R2). Microsoft's Hyper-V Server DVD Download Page

2. Download Microsoft's Windows Image installation script. Microsoft Download or BackupChain's Mirror

3. Open the ISO image by mounting it or by using an archive tool (examples: Virtual Clone Drive and 7-ZIP)

4. Extract the SOURCES folder to your C: drive

5. Copy the script file (Install-WindowsImage.ps1) into the C:\sources folder

6. Open Disk Management. (Click on Start and search for 'Create and Format Hard Disk Partitions'. Click on the result to start)

7. Click Action -> Create VHD.

8. Right click on the new disk drive and select Initialize Disk, then press OK

9. Right click on the new volume created and click New Simple Volume

10. Click through the Wizard, format the volume and assign it a drive letter, such as X:

11. Open Windows PowerShell as Administrator and run these commands:

 

Set-ExecutionPolicy Unrestricted

c:

cd \sources

For Windows 7 and Hyper-V Server 2008 R2, type:

.\Install-WindowsImage.ps1 –WIM C:\sources\install.wim -Apply -Index 1 -Destination X:

 

For Windows Server 2008 R2 Enterprise Full Installation, type this instead:

.\Install-WindowsImage.ps1 –WIM C:\sources\install.wim -Apply -Index 3 -Destination X:

 

For Windows Server 2008 R2 Datacenter Full Installation, type this instead:

.\Install-WindowsImage.ps1 –WIM C:\sources\install.wim -Apply -Index 5 -Destination X:

 

12. Wait a while until the process is completed, then go back to Disk Management and Detach VHD (right click on volume)

Now you have a VHD that's ready to boot; however, you may want to set up a boot menu on your machine as well.

 

Multiboot / Boot Menu Setup Instructions:

1. Open Command Prompt as administrator

2. Run:

bcdedit /copy {current} /d "New Hyper-V Server Instance Name in Boot Menu"

3. Then bcdedit will return a GUID number like this one: {fb557585-549d-11df-b7c7-adaaeda2b284}. Use the GUID returned for the following instructions below.

4. bcdedit /set {GUID} device vhd=[C:]\myfolder\myvhdfilename.vhd

5. bcdedit /set {GUID} osdevice vhd=[C:]\myfolder\myvhdfilename.vhd

6. Optional: If you plan to use Hyper-V's virtualization features you may want to turn on the hypervisor:

bcdedit /set hypervisorlaunchtype Auto

You may also need to turn on virtualization support in your BIOS if you haven't done so already.

 

Congratulations! Now you can reboot and select your VHD to boot from. The reset of the Windows installation will continue once you boot from VHD.

Don't forget to set up your virtual backup solution for your new Hyper-V Server 2008 R2 installation! Our Hyper-V backup software also works on VMware.

Please email us your support requests: support@backupchain.com