Install Windows 7 to a virtual disk with a VHD file

Source: Internet
Author: User

Windows7 Beta1 Released, many friends want to be able to experience. But it is only a beta version, the experience is still to be deleted, how can both install the experience and not the existing XP or Vista system impact? We can use the Windows7 new VHD file to install Windows7 onto a virtual disk. Come with me below.

  first, understand the VHD

What is a VHD file? In fact, the VHD file is not unfamiliar to us, when you create a virtual computer with Microsoft Virtual PC software, a VHD file is generated. In addition, under Windows7, if you click start → all programs → maintenance → backup and restore, and then click "Establish Backup Mirror" in the Open dialog box, you can back up the selected partition and the VHD file is generated after the backup. Alternatively, you can find the "Create VHD" option under the Action menu in Windows7 Disk Manager (Figure 1).

The VHD is a file, but in Windows7 Disk Manager, we can virtual a VHD file as a disk partition through the action → add VHD menu. Disk 2 in Figure 1 is a disk partition that is virtualized by the VHD file. In Windows7, we can use a virtual disk partition like a normal disk partition without any difference.

With the VHD virtual disk partitions, we can hide and protect important files and even install the operating system.

  Second, the virtual installation Windows7

The VHD file can be used on the server, virtual out of multiple hard disks, so that clients can access files on the same server operating systems or virtual hard disks that are installed on multiple virtual hard disks. On the one hand, can save hardware cost. On the other hand, different clients can have different services. In addition, it is also good for backup, maintenance, and security--on the server side, the technician simply manages the corresponding VHD file.

Below, we will demonstrate the virtual installation of Windows7. Assuming that the operating system Windows XP (and other systems) are already installed on your computer, now, to install Windows7 in a VHD file on the computer, you can choose Windows XP or Windows7 from the menu when you start. The entire architecture is shown in Figure 2. To do this, prepare a partition on your computer that has at least 10GB of free space, in this case a D disk, and a free space of 20GB.

  1. Installation process

1th Step: Start the Installation Wizard

Start the computer with the Windows7 installation CD, and when the Setup Wizard runs to the Language settings interface, press the "SHIFT+F10" key combination to bring up the command Prompt window, as shown in Figure 3.

  

  2nd step: Load the virtual hard disk

In turn, enter the following command, note that each command must be entered with the ENTER key to confirm.

Command 1:diskpart

Command action: Run the Partition management command.

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

Command 2:creste vdisk file=e:\ls. VHD type=fixed maximum=12000

Command action: Create a virtual hard disk. The hard drive consists of files stored in the D-Packing directory (FILE=E:\LS). VHD) to simulate. The maximum space for the hard disk is 12GB. The type=fixed in the command indicates that the virtual hard disk has a fixed capacity size.

Note that the execution of this command may take about 10 minutes, at this time, in addition to observing the computer on the hard drive lights flashing, no response on the screen, please be patient, do not mistakenly believe that the panic. If the command executes successfully, the prompt returned on the screen is "Diskpart successfully (successful) created the virtual disk file".

Command 3:select vdisk file=e:\ls. Vhd

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

If the command executes successfully, the prompt returned on the screen is "Diskpart successfully open the virtual file".

Command 4:attach Vdisk

Command action: Activates the virtual hard drive.

If the command executes successfully, the screen prompts: "Diskpart successfully attached the virtual file".

Command 5:exit

Command function: Exit DiskPart.

Tip: The key to this installation is to create a VHD file using the command DiskPart and virtual it as a hard disk. The test indicates that to complete this operation, the version number of DiskPart must be 6.1.7000, which is provided by Windows7. Windows XP or Vista can not be installed in this way, although XP and Vista also provide the DiskPart command, but the version is lower than 6.1.7000. In addition, the original operating system of the C disk can also be Vista or Windows7.

  3rd Step: Format the virtual hard disk

Close the Command Prompt window and click Next to have the Installation Wizard continue until the interface shown in Figure 4 appears. Please note the information here: on my computer, there is already a hard disk, the flag is Disk0, it has 3 partitions below. The virtual hard disk that you just added is marked Disk1, followed by the word "unallocated space", which indicates that it has not been partitioned and formatted, and is now partitioned and formatted.

First, select Disk1, and then click Drive Options (Advanced). Then, click New in the next interface, at which point the program asks us to enter the size of the first partition, which defaults to the maximum (this example is 12GB). Click Apply directly to create a unique partition with the maximum space on the virtual hard disk. Then, click Format to reformat the partition of the virtual hard disk. Finally, click "Next" to return.

  4th Step: Complete the installation

In Figure 4, select the partition where the installation location is the virtual hard disk that you just created, and then click the "Next" installation to continue. When you are done, you can choose which system to enter by starting the menu, as shown in Figure 5. In Figure 5, the previous item is Windows XP and the latter is Windows7.

  

2. Effect display

On the surface, the partitions that can be observed are different after booting to the two systems separately. On my computer (the real hard disk partition is only two), the details are shown in the following table (√ indicates that x means no).

When you start to Windows XP, you can observe all partitions of a real hard drive under My computer, find a VHD file created from a command prompt, but not convert it to a virtual hard disk in a normal way, and therefore cannot observe its contents.

When you boot to Windows7, you can also observe two partitions, one for the logical partition of the real hard disk (that is, Disk 0) that holds the VHD file, and another for the hard disk (that is, disk 1) that is virtualized by the VHD, as shown in Figure 6.

In Figure 6, the author has been able to display in Windows XP, the partition marked with a dot, the Windows7 can be displayed in the partition marked with five-star symbol. Under Windows7, the C partition is fictitious by the VHD file, however, the operation is exactly the same as the real system.

Tip: Under Windows7, the partition that installs Windows XP can also be displayed by setting it: Right-click Under Disk Manager, select Change Drive letter and path, and then click Add and follow the default options.

The advantage of this installation is that, compared to ordinary dual-Windows systems:

The two systems are isolated from each other, avoiding the important files that damage another system under a set of systems because of false operation.

It becomes easier to maintain Windows7. Simply back up the VHD file under Windows XP.

To maintain Windows XP under Windows7, simply display the partition where it was installed.

Third, why the VHD was introduced into the WINDOWS7

Perhaps Microsoft has realised that many people need to experience new systems and install new software. Virtual disk technology allows users to achieve these needs in the most secure way. Install the operating system into a file, in fact, such as Ubuntu Linux system already has this function.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.