Virtual Hard Drive VHD File - Create and Start with at Boot

Page 1 of 16 12311 ... LastLast
    Virtual Hard Drive VHD File - Create and Start with at Boot

    Virtual Hard Drive VHD File - Create and Start with at Boot

    How to Create a Windows 7 VHD at Boot to Start with from Boot
    Published by
    Designer Media Ltd


    How to Create a Windows 7 VHD at Boot to Start with from Boot


       Information
    This will show you how to create a Windows 7 VHD file at boot on an existing installed OS's (ex: Vista or Windows 7) C: hard disk or partition to be able to natively boot from the Windows 7 VHD at startup in the Windows Boot Manager.

       Note
    This tutorial uses an example that will create a C:\(file name).vhd file on the C: drive/partition at boot that is used to natively boot from at startup.

    You will be able to create the VHD file on any partition or drive letter that you like though.

       Warning
    All Vista, Windows 7, and Windows 8 (except Windows 8 RT) editions support booting from a VHD.

    You must have either Windows 7 Ultimate, Windows 7 Enterprise, Windows 8 Pro, or Windows 8 Enterprise installed on the VHD to be able to boot from the VHD natively.


    EXAMPLE: Windows Boot Manager
    NOTE: You will be able to either select your currently installed OS (ex: Vista) or the VHD file (ex: Windows 7) in the Windows Boot Manager to start your computer with.
    Virtual Hard Drive VHD File - Create and Start with at Boot-boot_manager.jpg
    EXAMPLE: VHD file in your Current OS (ex: Vista)
    NOTE: This is where the VHD file will be stored at on your currently installed OS (ex: Vista) to be used to boot from.
    Virtual Hard Drive VHD File - Create and Start with at Boot-example.jpg



    OPTION ONE

    To Create and Add the VHD to Boot From


    1. Boot from your retail copy Windows 7 Ultimate or Enterprise installation DVD/USB, and do step 2 or 3 below for what you would like to do.
    NOTE: To have Windows 8 on VHD, see instead: How to Create a Windows 8 VHD at Boot to Dual Boot with Windows 7 or Vista

    2. When you are at the start of the Windows 7 installation screen, press the Shift+F10 keys, and go to step 4 below. (See screenshot below)
    Virtual Hard Drive VHD File - Create and Start with at Boot-setup.jpg
    3. Boot into the command prompt from the Startup Recovery Options screen, and go to step 4 below. (See screenshot below)
    NOTE: You will use OPTION TWO at that link.
    Virtual Hard Drive VHD File - Create and Start with at Boot-step1.jpg
    4. In the command prompt, type diskpart and press Enter. (See screenshot below)
    Virtual Hard Drive VHD File - Create and Start with at Boot-step2.jpg
    5. In the elevated command prompt, type list volume and press Enter. Make note of the drive letter for the volume that you want to create the VHD file on. (See screenshot below)
    NOTE: This will allow you to see what the drive letters are for each volume. They are not always the same at boot as they are in Windows.
    Virtual Hard Drive VHD File - Create and Start with at Boot-list-disk.jpg
    6. Do either step 7 or 8 below for what type of VHD file you would like to create.

    7. To Create a Fixed VHD File
    NOTE: A fixed VHD file will allocate the entire maximum size (ex: 40GB) that you set below for the VHD file size.
    A) In the command prompt, type the command below and press Enter.
    NOTE: Substitute the C drive letter in the command below for what volume (step 5) you would like to create the VHD on.

    Code:
    create vdisk file=C:\VHD-Windows7.vhd maximum=40960
    NOTE: You can substitute the VHD-Windows7 name with any name you would like for the VHD file instead. You can also substitute the maximum size of 40960 MB for the VHD to the maximum size you want instead in MB (1GB = 1024MB).
    Virtual Hard Drive VHD File - Create and Start with at Boot-step3.jpg
    B) Go to step 9.
    8. To Create an Expandable VHD File
    NOTE: An expandable VHD file will only be as large as the amount of data that is saved in the VHD file, but still can get as large as the maximium size (ex: 40GB) that you set below. For example, using this option, the VHD file showed only 7GB instead of the full 40GB. Even though the VHD file is expandable, you may need to install Windows Virtual PC to have a program associated with VHD files to actual see only the smaller size instead of the larger size for the VHD file.
    A) In the command prompt, type the command below and press Enter.
    NOTE: Substitute the C drive letter in the command below for what volume (step 5) you would like to create the VHD on.

    Code:
    create vdisk file=C:\VHD-Windows7.vhd maximum=40960 type=expandable
    NOTE: You can substitute the VHD-Windows7 name with any name you would like for the VHD file instead. You can also substitute the maximum size of 40960 MB for the VHD to the maximum size you want instead in MB (1GB = 1024MB).
    9. In the command prompt, type the command below and press Enter. (See screenshot below)
    NOTE: If you subsituted the VHD-Windows7 name in step 7 or 8, then you will need to use it here as well. Substitute the C drive letter in the command below for what volume (step 5) you would like to create the VHD on.

    Code:
    select vdisk file=C:\VHD-Windows7.vhd
    Virtual Hard Drive VHD File - Create and Start with at Boot-step4.jpg
    10. In the command prompt, type attach vdisk and press Enter. (See screenshot below)
    Virtual Hard Drive VHD File - Create and Start with at Boot-step5.jpg
    11. In the command prompt, type exit and press Enter. (See screenshot below)
    Virtual Hard Drive VHD File - Create and Start with at Boot-step6.jpg
    12. Close the command prompt window. (See screenshot above)
    A) If you used step 2 above, then click on Next, and go to step 13 below.

    B) If you used step 3 above, then continue on to step 14 below.
    13. Close the System Recovery Options window. (See screenshot below)
    WARNING: You must close it only. Do not click on the Shut Down or Restart button.
    Virtual Hard Drive VHD File - Create and Start with at Boot-step7.jpg
    14. Click on the Install now button. (See screenshot below)
    Virtual Hard Drive VHD File - Create and Start with at Boot-step8.jpg
    15. Check the I accept the license terms box and click on Next. (See screenshot below)
    Virtual Hard Drive VHD File - Create and Start with at Boot-step9.jpg
    16. Click on the Custom (advanced) option. (See screenshot below)
    Virtual Hard Drive VHD File - Create and Start with at Boot-step10.jpg
    17. Select the available option with the unallocated space that is the same maximum VHD size (ex: 40GB = 40960MB) that you specified in step 7 or 8 above, and click on the Next button. (See screenshot below)
    NOTE: If you see the Windows cannot be installed to this disk warning, then you can ignore it. Windows 7 will still install on the VHD file.
    Virtual Hard Drive VHD File - Create and Start with at Boot-step11.jpg
    18. Finish doing a clean install of Windows 7.
    NOTE: You will pick up at step 10 at that link to finish installing Windows 7 on the VHD file.

    19. When you restart or start the computer, you will now have Windows 7 to select from at boot to start natively from the VHD file. (See the first example at top of the tutorial.)



    OPTION TWO

    To Delete the VHD and Remove from Boot List


    1. To Remove OS VHD from Windows Boot Manager List
    A) Delete the listed OS VHD from the Windows Boot Manager in msconfig.
    2. To Delete the VHD File
    A) In Windows Explorer, navigate to the VHD file that you have created in step 7 or 8 of OPTION ONE above (ex: C:\VHD-Windows7.vhd), right click on the VHD file and click on Delete.

    B) Click on Yes to approve deletion.
    That's it,
    Shawn









  1. Posts : 3,141
    Vista Ult 64 bit Seven Ult RTM x64
       #1

    Thanks Shawn. Another excellent tutorial.

    Gary
      My Computer


  2. Posts : 71,977
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    You're welcome Gary.
      My Computer


  3. Posts : 9
    Windows Vista and Windows 7 Beta
       #3

    There a mistake in step 6.

    It should be "attach vdisk", not "attach disk".
      My Computer


  4. Posts : 71,977
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

    Nice catch Spacesurfer.

    +1 rep.

    Thank you,
    Shawn
      My Computer


  5. Posts : 10
    Windows Vista
       #5

    Could not get to Recovery Options using vista


    When I put the Windows 7 DVD in and tried to get to Recovery Options Windows 7 said the OS was not the same and would not go forward.

    Reading
    This will show you how to create a Windows 7 VHD file at boot on an existing installed OS's (ex: Vista)


    I was hoping I could make a Windows 7 VHD with my main OS being Vista
      My Computer


  6. Posts : 71,977
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #6

    Hello Gencode, and welcome to Seven Forums.

    Did you boot from the Windows 7 DVD to try and enter the System Recovery Options screen?
      My Computer


  7. Posts : 10
    Windows Vista
       #7

    I figured it out


    Yeah, I booted from Win7, I did exactly as shown.

    The problem is my Vista was 64 bit and the Win7 was 32bit. I dloaded the Win7 64 bit beta and all worked as shown. Thanks!

    Ed,
      My Computer


  8. Posts : 71,977
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #8

    Ed, I'm happy to hear that you got it sorted. Thank you for sharing your results. :)

    Shawn
      My Computer


  9. Posts : 1
    Windows 7 x64
       #9

    Hi,

    Is it possible to install system other than Win7 (Vista or XP) on VHD and boot it?
      My Computer


 
Page 1 of 16 12311 ... LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:04.
Find Us