November 5 2009

Dual booting Windows Server 2008 R2 with Windows 7 using VHD booting

I wanted to run Windows Server 2008 R2 in a dual boot configuration on my Windows 7 RTM laptop – so that I can demonstrate Windows Server 2008 R2 features to partners when required.

This gave me an opportunity to use the new “Boot from VHD” feature on Windows 7 and Windows Server 2008 R2. Essentially, I would have Windows 7 on my laptop on one partition on the raw disk. The remaining space on the RAW disk (in my case 15 GB) will be allocated to a partition containing a VHD (Virtual Hard Disk) file, that can be mounted to boot the computer off the VHD file. I will be installing Windows Server 2008 R2 on this VHD file.

image

Here’s how I went about doing it.

Since I did not have any unallocated space on my hard drive, I used the “shrink” option on drive C in Windows 7 (Computer Management) to get some free space – and got 15 GB unallocated as seen in the above screenshot.

Next, I popped in the Windows Server 2008 R2 DVD.

image

At the Welcome screen above, I press SHIFT+10 to launch the WinPE console.

Once you get the WinPE console, use DISKPART to prepare a partition for the Windows Server 2008 R2 VHD:

  1. Type ‘DISKPART’ to launch the utility
  2. Type ‘LIST DISK’ to see the list of physical disks in your machine.
  3. Type ‘SEL DISK 0’ assuming you have only 1 physical disk installed
  4. Type ‘CREATE PARTITION PRIMARY’ to create a primary partition out of the free space
  5. Type ‘FORMAT FS=NTFS QUICK’ to quick-format the new partition on NTFS format
  6. Type ‘LIST VOL’ and look at what you’ve done :-) . Notice the asterisk next to the new partition (in my case, it’s Volume 3).
  7. Type ‘ASSIGN’ to assign the next available drive letter to the selected partition.
  8. Type ‘LIST VOL’ again to see what drive letter was assigned (in my case, it’s E)
  9. Now for the magic: ‘CREATE VDISK FILE=E:\FILENAME.VHD MAXIMUM=15000 TYPE=EXPANDABLE’ – this creates a dynamically expandable VHD file filename.vhd on the new volume with a maximum size of 15000 MB. Keep the maximum size lesser than the size of the partition.
    WinPE Screenshot
  10. Notice that once you finish this command, Windows 7 detects virtual hardware “Microsoft VHD HBA” and installs it. 
    image
  11. Type ‘SELECT VDISK FILE=E:\filename.vhd
  12. Type ‘ATTACH VDISK’ to attach the VHD disk.
  13. Type ‘CREATE PARTITION PRIMARY’ to create a primary partition inside the VHD.
  14. Quick format the partition on NTFS by issuing the ‘FORMAT FS=NTFS QUICK’ command
  15. Assign a drive letter V: on this volume ‘ASSIGN LETTER=V:
  16. LIST VOL to see what you’ve achieved.
  • Volume 1 and 2 were pre-existing Windows 7 volumes
  • Volume 3 (E:) is the disk that we created to store the VHD file
  • Volume 4 (V:) is the virtual disk inside the virtual machine (uses space on E:)

WinPE screenshot

Type EXIT DISKPART to close the utility and close the WinPE session.

Next, continue with the Windows Server 2008 R2 installation from Windows 7. Do not choose the upgrade option, choose the New Installation option.

Choose to install Windows on the partition you just created.

 

image

When installation is complete, and you restart your computer, a boot loader menu appears, where you can choose to boot Windows 7 or Windows Server 2008 R2.




Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • HelloTxt
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • StumbleUpon
  • Technorati
  • Twitter

You can leave a comment, or trackback from your own site. Delicious Bookmark this on Delicious

11 Responses to “Dual booting Windows Server 2008 R2 with Windows 7 using VHD booting”

  1. Anonymous says:

    Was Wins 7 already installed on your laptop before installing Sr2008?
    Thank you.

  2. Shijaz says:

    Yes. Windows 7 was installed.

  3. Anonymous says:

    32 bit i'm assuming?

  4. Shijaz says:

    No, 64 bit all the way!
    64bit version of Windows 7 Ultimate and Windows Server 2008 R2 of course is 64 bit.

  5. nalvarez says:

    Let’s say that I have some virtual machines (created in a Win. Server 2008 R2 Hyper-V) stored in the partition of Windows 7.

    I want to know if I’m gonna be able to see and use these virtual machines from the VHD partition running 2008 R2, as well as the rest of the files from the W7 partition

    Thanks

  6. SAK says:

    In the last step, should i install windows 2008 server in E or V.

  7. Staats says:

    Quick question… Does anything special need to be done to allow booting from a VHD? When I’ve tried this, the installation will nto allow me to install on the vhd because it is not bootable. Any ideas? Thanks for you help!

  8. humalla says:

    i did all that went to install and i get a error not enoth temp memory (533mb needed) i free’d up 102gbs for this windows server 2008 install i have more than enoth space 100gb on c drive 300gb on d

    its only 1 hdd 500gb would you happen to know why its coming up with this probem

    using windows 7 64bit pro

    want to install duel boot windows server 2008 64bit

  9. humalla says:

    this computer does not have enough space for temporary files. windows installation needs at least 535 megabytes (MB) of space on any partition for temporary files. to install windows, free enough space and restart the installation

    error code 0×80070103

    i dont understand the problem when i have put 102gb for it to install on

Leave a Reply