Go Back   TechArena Community > ARENA > Guides & Tutorials
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



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

Guides & Tutorials


Reply
 
Thread Tools Search this Thread
  #1  
Old 07-05-2009
Member
 
Join Date: Aug 2005
Posts: 434
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"

Reply With Quote
  #2  
Old 07-05-2009
Member
 
Join Date: Aug 2005
Posts: 434
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.

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

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

attach vdisk

exit
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!
Reply With Quote
  #3  
Old 07-05-2009
Member
 
Join Date: Aug 2005
Posts: 434
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).


Backspace

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.
Reply With Quote
  #4  
Old 28-02-2010
Member
 
Join Date: Feb 2010
Posts: 1
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
Reply With Quote
  #5  
Old 27-01-2011
Member
 
Join Date: Jan 2011
Posts: 1
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
Reply With Quote
  #6  
Old 07-11-2011
Member
 
Join Date: Nov 2011
Posts: 1
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.
Reply With Quote
Reply

  TechArena Community > ARENA > Guides & Tutorials
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to install Windows 7 on a virtual hard disk (VHD) in 10 steps"
Thread Thread Starter Forum Replies Last Post
Windows Virtual PC limit 3 Hard Disk? Gangeya Operating Systems 4 05-04-2010 05:32 PM
Error on copying Virtual hard disk of Virtual PC to new computer Azariah Windows Software 2 02-06-2009 10:53 PM
Need to delete Virtual Hard Disk in Windows 7 Dwarner Operating Systems 2 30-04-2009 11:42 PM
How to Create and Attach a Virtual Hard Disk in Windows 7 ChrisUlrich Tips & Tweaks 0 19-03-2009 11:38 PM
How to install Virtual Disk Windows 98 SE with Virtual Box Asgar Operating Systems 3 27-01-2009 05:29 PM


All times are GMT +5.5. The time now is 03:56 PM.