Installing Win 7 to a virtual disk with a VHD file

  

After the release of Windows 7 beta1, many friends hope to experience it. But it is only a beta version after all. After the experience is over, how can it be installed and not affect the existing XP or Vista system? The solution is yes, we can use Windows 7 new VHD file to install Windows 7 to a virtual disk. Come with me below.

First, understand VHD

What is a VHD file? In fact, VHD files are no stranger to us. After creating a virtual computer with Microsoft Virtual PC software, VHD files will be generated. In addition, under Windows 7, if you click “ Start & Rarr; All Programs & Rarr; Maintenance & Rarr; Backup and Restore & rdquo;, then click on the "Create Backup Mirror" in the dialog box that opens, you can select the selected The partition is backed up, and the VHD file is generated after the backup. In addition, under the “Operation” menu of the Windows 7 Disk Manager (Figure 1), you can also find the option to “Create VHD”.

VHD is a file, but in the Windows 7 Disk Manager, we can virtualize a VHD file into a disk partition by using the “Action & Rarr; Add VHD” menu. Disk 2 in Figure 1 is the disk partition virtualized by the VHD file. In Windows 7, we can use virtual disk partitions like normal disk partitions without any difference.


With VHD virtual disk partitioning, we can hide and protect important files and even install operating systems.

Second, virtual installation Windows7

VHD files can be used on the server, virtual multiple hard drives, so that the client can access the same server installed on multiple virtual hard disks A file in a system or virtual hard disk. On the one hand, hardware costs can be saved. On the other hand, different clients can enjoy different services. In addition, it is also good for backup, maintenance and security —— on the server side, the technician can manage the corresponding VHD file.

Below, we will demonstrate the virtual installation of Windows 7. Assuming that the operating system Windows XP (although other systems) is already installed on the computer, Windows 7 is now installed in a VHD file on the computer. When booting, Windows XP or Windows 7 can be selected through the menu. The entire architecture is shown in Figure 2. In order to complete this operation, please prepare a partition with at least 10GB of free space on the computer. In this case, the D drive is selected, and the free space is 20GB.


1. Installation Process

Step 1: Start the Installation Wizard

Start the computer with the Windows 7 installation CD and run the Setup Wizard to the Language Settings screen. When, press “Shift+F10” to bring up the command prompt window, as shown in Figure 3.


Step 2: Load a virtual hard disk

followed by entering the following command, note that each input a command must press Return to confirm.

Command 1: Diskpart

Command Action: Run the partition management command.

Tip: In the past, the partition management command provided by Windows system was Fdisk. Since Windows XP, Fdisk was replaced by Diskpart. Diskpart is powerful enough to provide almost all the features of a partitioned magician, and more importantly it supports scripting.

Command 2: Creste vdisk file=e:ls.Vhd type=fixed maximum=12000

Command role: Create a virtual hard disk. The hard disk is simulated by a file (file=e:ls.Vhd) stored in the root directory of the D drive. The maximum space of the hard disk is 12GB. The type=fixed in the command indicates that the capacity of the virtual hard disk is fixed.

It should be noted that it may take about 10 minutes to execute this command. At this time, except that the hard disk indicator on the computer is blinking, there is no reaction on the screen. Please wait patiently, don't worry. Think of the crash. If the command is executed successfully, the prompt returned on the screen is "Diskpart successfully (created) created the virtual disk file".

Command 3: Select vdisk file=e:ls.Vhd

Command: Select the VHD file you just created (file=e:ls.Vhd) to act as a virtual hard disk (vdisk).

If the command is executed successfully, the prompt returned on the screen is “Diskpart successfully open the virtual file”.

Command 4: Attach vdisk

Command Action: Activate the virtual hard disk.

If the command is executed successfully, the screen prompts: <;Diskpart successfully attached the virtual file”.

Command 5: Exit

Command Action: Exit Diskpart.

Tip: The key to this installation method is to create a VHD file and virtualize it as a hard disk by commanding Diskpart. The actual test shows that to complete this operation, the version number of Diskpart must be 6.1.7000, which is provided by Windows 7. Although Windows XP and Vista also provide the Diskpart command, but the version is lower than 6.1.7000, you cannot install Windows XP or Vista in this way. In addition, the original operating system of the C drive can also be Vista or Windows 7.

Step 3: Format the Virtual Hard Disk

Close the Command Prompt window and click “Next” to let the installation wizard continue to run until the interface shown in Figure 4 appears. Please note the information here: On my computer, there is a hard disk, marked as Disk0, and there are 3 partitions below it. The virtual hard disk flag just added is Disk1, followed by the words “Unallocated Space”, indicating that it has not been partitioned and formatted, and will now be partitioned and formatted.


First, select Disk1 and click “Drive Options(advanced)”. Next, click “New” in the next interface. At this point, the program will ask us to enter the size of the first partition. The default is the maximum value (12GB in this example). Please click “Apply” to indicate that the maximum space of the virtual hard disk is used to create a unique partition. Then, click “Format” to format the partition of the virtual hard disk. Finally, click “Next” to return.

Step 4: Finish the installation

In Figure 4, select the installation location for the partition of the virtual hard disk you just created, and then click “Next”Install to continue. Once completed, you can select which system to enter through the boot menu, as shown in Figure 5. In Figure 5, the former is Windows XP and the latter is Windows 7.



2. shows the effect

On the surface, the two systems were to start, the partition can be observed is different. On my computer (there are only two real hard disk partitions), as shown in the following table (√ means that you can observe, × means not).


After booting into Windows XP, you can observe all the partitions of the real hard disk under "My Computer", you can find the VHD file created by the command prompt, but cannot pass the ordinary The method of converting it into a virtual hard disk, so you can't observe the contents.

After booting to Windows 7, you can also observe two partitions, one is the logical partition of the real hard disk (ie Disk 0) that stores the VHD file, and the other is the hard disk virtualized by the VHD (ie Disk 1) ) partition, as shown in Figure 6.


In Figure 6, the author has marked the partitions that can be displayed under Windows XP with dots, and the partitions that can be displayed under Windows 7 are marked with a five-star symbol. Under Windows 7, the C partition is virtualized by the VHD file. However, the operation is completely the same as the real system.

Tip: Under Windows 7, the partition for installing Windows XP can also be displayed by setting it: right-click on Disk Manager, select “change drive letter and path”, then click “ Add ” and follow the default options all the way.

Compared with the ordinary dual Windows system, the advantage of this installation method is:

● The two systems are isolated from each other, avoiding the destruction of another system due to misoperation under one system. Important files for the system.

●Maintaining Windows 7 has become easier. Just backup the VHD file under Windows XP.

●To maintain Windows XP under Windows 7, just display the partition where it is installed.

Third, why VHD was introduced into Windows7

Perhaps Microsoft has realized that experiencing new systems and installing new software is what many people need. The virtual disk technology allows users to achieve these requirements most securely. Install the operating system into a file. In fact, Linux systems such as Ubuntu already have this feature.

Copyright © Windows knowledge All Rights Reserved