Results 1 to 6 of 6

Thread: How to install Windows 7 on a virtual hard disk (VHD) in 10 steps

  1. #1
    Join Date
    Aug 2005

    How to install Windows 7 on a virtual hard disk (VHD) in 10 steps

    You want to test Windows 7, without impacting your current installation of Windows XP or Vista on your desktop? A possible solution is: Boot from VHD.

    To facilitate testing of Windows 7 with minimal impact on the existing OS, I recommend using a new feature called Windows 7 "Boot from VHD. It is the ability to boot the system on a virtual disk (physically represented by a *. vhd file on your disk).

    The idea is to create a *. vhd file to be viewed by the Boot Manager (the program run at startup of your machine, which runs your operating system) as a physical disk, and install Windows 7 on this virtual disk. With this technique, there is no impacte on the structure of your physical disk, and it has no OS currently installed: minimizing the risks!
    The advantage of this technique compared with virtualization solutions on the workstation (Virtual PC, VM Ware, ...) is that the performance of the system in the virtual disk is done natively on the hardware resources of your PC, and not not by an emulation layer that may degrade performance significantly.

    With this technique, constraints / impacts that come to mind are:
    • Occupying a space of 6 GB of storage for the virtual disk (*. vhd)
    • Replacing the boot manager of your current OS (Vista / XP) with that of Windows 7 to support the "boot from VHD"

  2. #2
    Join Date
    Aug 2005

    Installing Windows 7 on a VHD disc in 10 steps

    How to Install Windows 7 on a VHD disc in 10 steps

    If you accept the constraints described above, I propose the following procedure, which I think is the easiest way to install Windows 7 on a virtual disk in multi-boot:

    1. Back up your critical data / priority (good practice in general)

    2. Free up space on your physical disk to be at least 6 GB of free space (to allow more applications to be installed / tested later)

    3. Restart your system from the installation DVD of Windows 7

    4. Instead of proceeding with the installation, choose "Repair"

    5. The setup program offers to repair the system, this has no impact because we do not really fix the current system. Select the version of Windows currently installed.

    6. Among the options, select Command Prompt.

    7. We will then create a virtual disk (*. vhd) and then install Windows 7, using the utility Diskpart.exe, monitoring of the following commands to create a virtual disk.

    create vdisk file = c: \ vhd \ \ win7beta.vhd max = 32000

    select vdisk file = c: \ vhd \ win7beta.vhd

    attach vdisk

    Vdisk create command file = "xxx" maximum = yyy can set the size of your virtual disk. Allow enough space for your applications. In the example, I chose to create a virtual disk represented by c: \ win7beta.vhd size of 32 GB.

    The command attach vdisk, preceded by select vdisk file = xxx is used to mount your virtual disk to physical disk.

    8. Then the Windows Setup program by typing setup.exe 7.

    9. Take the home screen, select language and keyboard and user license (EULA). Then proceed to installation mode Custom (Advanced).

    10. Windows will then display a selection screen of the destination disk for the new facility. Select the newly created virtual drive (you find in relation to the size set with the command create vdisk file = "xxx" yyy = maximum, 32 GB in the example), then click Next.

    The setup continues as normal, and you managed your installation of Windows 7 VHD on a disc!

  3. #3
    Join Date
    Aug 2005

    Re: How to install Windows 7 on a virtual hard disk (VHD)

    Reboot and multi-boot

    Once installation is complete, the startup of your computer screen offers a selection of the system to run. This is done by the Windows Boot Manager 7.

    Now look at the structure of our hard disk. For Windows 7, the physical disk is tipped as a drive "D". Player "C" corresponds to our virtual disk (*. vhd) newly created.

    If you restart the computer from your old operating system (Vista in my example), you're strictly in the same situation as before the installation of Windows 7, with a little less disk space (corresponding to *. vhd file that represents the new virtual disk).


    With the technique described in this ticket you can easily revert back to cancel the installation or re-install a new version of Windows 7 (Beta version expires on 1 August 2009).

    To return to the initial context, you just have to use the bcdedit.exe (Boot Configuration Database Editor) to change the Boot Manager from Windows 7, and delete the *. vhd file after you restart your previous OS .

    Here's how:

    1. Open a command window in Administrator mode.

    2. Bcdedit.exe Run / v to obtain the configuration of the Boot Manager. The utility displays the different sections of the configuration of the Boot Manager.
    Select and copy the identifier of the section for Windows 7 description to the clipboard (using the context menu by right-click).

    3. Bcdedit.exe Run / delete (paste the ID here) to delete section 7 of the Windows Boot Manager. Be sure to provide the ID copied to the clipboard at the previous step.

    4. You now just need to reboot your PC to automatically boot on your old system. You can delete the virtual disk (c: \ win7beta.vhd in the example) to free up some space.

  4. #4
    Join Date
    Feb 2010

    Re: How to install Windows 7 on a virtual hard disk (VHD) in 10 steps

    can this be done on a external drive. thank you
    Last edited by arthuragardiner; 28-02-2010 at 08:36 PM. Reason: wanted to qoute your thread

  5. #5
    Join Date
    Jan 2011

    Re: How to install Windows 7 on a virtual hard disk (VHD) in 10 steps

    Thank you for this AWESOME! tutorial

    I just wanted to point out an quicker way to get to the cmd prompt is to use SHIFT+F10 keyboard combo

  6. #6
    Join Date
    Nov 2011

    Re: How to install Windows 7 on a virtual hard disk (VHD) in 10 steps

    Note: This will not work for Windows 7 Professional as Booting from a VHD is not licensed or supported under Windows 7 Professional.
    You need the Enterprise or Ultimate Edition for use the NativeBoot from VHD.

Similar Threads

  1. Windows Virtual PC limit 3 Hard Disk?
    By Gangeya in forum Operating Systems
    Replies: 4
    Last Post: 05-04-2010, 05:32 PM
  2. Replies: 2
    Last Post: 02-06-2009, 10:53 PM
  3. Need to delete Virtual Hard Disk in Windows 7
    By Dwarner in forum Operating Systems
    Replies: 2
    Last Post: 30-04-2009, 11:42 PM
  4. How to Create and Attach a Virtual Hard Disk in Windows 7
    By ChrisUlrich in forum Tips & Tweaks
    Replies: 0
    Last Post: 19-03-2009, 11:38 PM
  5. Replies: 3
    Last Post: 27-01-2009, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts