Install Win 7 to a virtual disk with a VHD file (1)

  
        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 method is yes, we can use the new VHD file provided by Windows 7. Install Windows 7 on 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, you can also find the option to "Create VHD". The VHD is a file, but in the Windows 7 Disk Manager, we can virtualize the VHD file into a disk partition by using the &rquo;Operation →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, the virtual installation of Windows7 VHD files can be used on the server, virtual multiple hard drives, so that the client can access the files on the operating system or virtual hard disk installed on multiple virtual hard disks on the same server. 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. When the installation wizard runs to the language setting interface, press the “Shift+F10” key to bring up the command prompt window.


Step 2: Load the virtual hard disk Enter the following commands in turn, note that each input of a command must press the Enter key to confirm. Command 1: Diskpart command role: Run the partition management command. Hint: 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 and don't mistake it. 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 role: Activate the virtual hard disk. If the command is executed successfully, the screen prompts: "Diskpart successfully attached the virtual file". Command 5: Exit command role: Exit Diskpart. Hint: 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: Complete 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. Effect display On the surface, the partitions that can be observed are different after booting into two systems. 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 to 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 you can't convert it into a virtual hard disk by ordinary methods, so you can't observe it. To the content. After booting to Windows 7, you can also observe two partitions, one is the logical partition of the real hard disk (Disk 0) that stores the VHD file, and the other is the hard disk (Disk 1) partitioned by the VHD. 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”, click “add” and press all the way The default option is OK. Compared with the ordinary dual Windows system, the advantages of this installation method are: ● The two systems are isolated from each other, avoiding the destruction of important files of another system due to misoperation under one 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. Why VHD was introduced into Windows 7 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