Use VMware to install Linux in Windows

Source: Internet
Author: User

To install a Linux operating system from a hard disk, you must first prepare an installation package. The installation package for a Linux operating system is usually one or more ISO image files (which can be downloaded through the network). Secondly, start the system installer in the image file by some means. Then, follow the prompts of the installer to install it. During the installation process, you must specify the installation location of the Linux operating system, which involves some knowledge about hard disk partitioning. In summary, the key to learning how to install a Linux operating system is to learn two points: first, how to prepare hard disk space for the Linux operating system? 2. How to start the installer in the ISO image file. Hard Disk partitioning usually requires partitioning when using hard disks. If you compare an unpartitioned hard disk to a large white paper, the partitioned hard disk is equivalent to a few large boxes on this White Paper. After a hard disk is divided into multiple partitions, each partition is relatively independent. Each partition can have its own file format, such as fat16, FAT32, and NTFS. To install an operating system for a hard disk partition required by a Linux operating system, a dedicated partition is usually required for it. Specifically, it means that you cannot share a partition with other operating systems, or do not share a partition with your own data files. The former is because different operating systems may need Disk Partitions of different formats, the latter is more out of the considerations of user data security and convenient system maintenance. From the minimum configuration point of view, the Linux operating system requires an ext2 or ext3 hard disk partition as the root partition, the size is 2 ~ 5g. In addition, a swap partition in SWAp format is required, which is related to the memory size. If there is less than MB in the SWAp partition, the swap partition size should be twice the memory size; if there is more than MB in the SWAp partition, the swap partition size is equal to the memory size. When installing the Linux operating system, if you select the manual partitioning method, the hard disk partitioning tool disk Druid will be started. This program comes with the installer. The following describes how to use the software. The hard disk partition identifier in Linux uses hda, HDB, and so on to identify different hard disks in Linux, and uses hda1, hda2, hda5, and hda6 to identify different partitions. The letter A represents the first hard disk, B represents the second hard disk, and so on. While number 1 represents the first partition of a hard disk, number 2 represents the second partition, and so on. 1 to 4 correspond to the primary partition (primary partition) or extension partition (extension partition ). Starting from 5, it corresponds to the logical partition of the hard disk ). Even if a hard disk has only one primary partition, the logical Partition Number starts from 5. Pay special attention to this. The system has a hard disk named/dev/hda. It has an NTFS-format primary partition hda1 and an extended partition hda2, extended partition hda2 is divided into several logical partitions, including fat format hda5 and hda6, ext3 format hda8, and swap format hda7. Tip: compatibility issues. In Windows, hda1 corresponds to C, hda5 corresponds to D, and hda6 corresponds to E. Other windows partitions cannot be identified, so they cannot be seen. Delete a partition if you want to delete a partition, first select it with the mouse, and then click "delete" to delete a partition. Before deletion, a dialog box is displayed. Click "delete" to delete the selected partition and change it to idle space. To create a partition, you must have free space on the hard disk. Select the free space with the mouse, and click "new". The add partition dialog box is displayed. When creating a new partition, you must first select the file system type and then select or set a mount point based on the file system type. You do not need to set mount points for swap-type partitions. Vfat partitions are FAT32 partitions. You should set mount points instead of selecting mount point 1 from the mount point list. Finally, set the partition size. After setting, click "OK" to create a partition. After the modification takes effect, the modification does not have a substantial impact on the hard disk. You can still click the "exit" button to stop the installation program and discard the modification to the hard disk. To make the change take effect, click "Next. Note: Do not stop the installation program after you modify the partition and make it take effect. Otherwise, the hard disk partition table may be damaged. To operate the ISO file in Linux, run the following command as root to read the content in the file XXX. ISO from the/path directory. In actual use, modify the/path and XXX. ISO according to the actual situation. Mount-T iso9660-o loop XXX. if you want to create an ISO file for ISO/path, put the CD in the optical drive, and then execute the following Copy command to copy the content on the CD to an ISO file. Modify XXX. ISO according to the actual situation. CP/dev/cdrom xxx. ISO for operating ISO files in windows, special tools and software are generally required to operate ISO files. Such as winiso, winimage, and dameon tools. If you only want to read the content in the ISO file, you can use WinRAR. Both winrar3.0 and later versions support the file format iso9660. Open the ISO file with WinRAR, select the desired content, and extract it. The ISO file of the Linux operating system installation disk is mounted to the/mnt/ISO directory in the Linux environment. One is images, which contains some image files with a MB Floppy disk, bootdisk. IMG can be used to create a boot floppy disk for installation. The other is dosutils, which contains some dos tools, such as rawrite.exe. This software can be used to write the image file of the floppy disk to the floppy disk. In this way, you need to create a Linux boot disk. Read the bootdisk. IMG in the images folder of the ISO file and store it separately on the hard disk. If it is in Linux, insert the floppy disk into the floppy disk, and then execute the following command to put the bootdisk. write disk to IMG: dd If = bootdisk. IMG of =/dev/fd0 in DOS/Windows, read rawrite.exe from the dosutils folder in the ISO file and use it with bootdisk. IMG is saved in the same directory. Then execute rawrite at the DOS prompt, insert a floppy disk as prompted, and write bootdisk. IMG to the floppy disk. Use the Linux boot disk to boot the computer. When you are prompted about the installation method, select hard drive and provide the correct ISO file location information to start the installation program in the ISO file. Follow the prompts of the installation program to complete the installation. For installation instructions, see "start a VM to install Linux ". DOS start installation method this method needs to be carried out in a pure DOS environment, so you need to find a way to enter the pure DOS environment. The specific operation method is to read the dosutils directory in the ISO file and store it separately on the hard disk. Note that the partition must be stored in the fat16 or FAT32 format to ensure that the partition can be accessed in the DOS environment. Start the pure DOS environment, enter the dosutils directory, and execute autoboot. bat. When you are prompted about the installation method, select hard drive and provide the correct ISO file location information to start the installation program in the ISO file. Follow the prompts of the installation program to complete the installation. For installation instructions, see "start a VM to install Linux ". Tip: the easiest way to enter the DOS environment is to start the computer with a DOS boot disk. In Windows, This method requires the Windows environment and the special software VMware. With VMware first create a virtual machine, and Linux operating system ISO installation file as the Virtual Machine CDROM, and then from the CD-ROM to start the virtual machine, you can start the Linux operating system installation program,. The following describes the detailed steps. This method can be used to install multiple Linux operating systems. Use VMware to create virtual hosts. You can also find detailed instructions on how to use VMWare on the Internet. For the convenience of readers, this book includes one of them. Run VMware and click "new Virtual Machine" to enter the wizard for creating a new virtual machine. Select "m" (custom) and click Next to continue. Select the operating system type on the following interface. Select "Linux", select "Other Linux", and click Next to continue. Next, give the virtual machine a name. We only use VMware to install Linux, so the name of the virtual machine is irrelevant. The Virtual Machine name below stores the location information of the virtual machine configuration file, you can use the default program, click Next to continue. Next, select the hard disk used by the VM. This is a key part. Select "Use a physical disk", that is, "use physical hard disk ". This is the key to using VMware to install linux. Do not select the correct one. Click Next to continue. The program will give a warning that it is risky to create a virtual machine using a physical hard disk. Click OK to continue. Next, select the hard disk. Select one and use the entire hard disk. Click Next to continue. The last step is to specify the name of the file that stores the virtual machine configuration information, which can be used by default. Click "finish" to create the VM. After creating a VM, you must modify the VM settings. Double-click the CD-ROM on the VM management interface, modify it on the CD-ROM Configuration window (A0-17), use the ISO image file (use ISO image) as the CD-ROM, browse (Browse) find the prepared Linux System ISO file. Confirm. In this way, we have prepared the required virtual machine. This virtual machine is used to install the Linux operating system. After installation, this virtual machine is useless. Start Virtual Machine installation Linux click the Green Arrow "start this machine" in the window to start the virtual machine. When starting a virtual machine, press f2 to enter setup (similar to the BIOS of a computer), find the boot, and change the startup sequence, press "+" "-", put the CD-ROM (CD) location to the first, save and exit, VMWare automatically restarts the virtual machine, then it will boot from the virtual machine CD, it is actually guided by the ISO installation file of the Linux operating system. Then you can see the boot screen of the corresponding Linux operating system installation. The installation interface is the same as that seen when the disk is started. The following describes how to install the Red Flag linux4.1 desktop edition. Note that, though VMware is used, the operations are the same when you start the installation directly from the actual installation disc. You can switch the VMware View to the full screen view to make the installation process more realistic. Press the Enter key to start the installation on the GUI wizard. If you want to install it on a text interface, enter linuxtext in Boot: And press Enter. Next, the interface for using the Protocol will appear. If you are interested, read it, select "accept", and click "Next ". Next, set the partition. First, you will see the interface for selecting the partition method. The contestant will work on the partition, and then click "Next ". The partition selection page is displayed. All partitions on the disk are listed here. As shown in the figure, there is a hard disk named/dev/hda on the system. It has an NTFS-format primary partition hda1 and an extended partition hda2, extended partition hda2 is divided into several logical partitions, including fat format hda5 and hda6, ext3 format hda8, and swap format hda7. Obviously, hda7 is the swap partition prepared for the Linux system, while hda8 is the partition prepared for the Linux system. Select hda8 and click "edit" to display the editing window for this partition. Set the mount point of the partition to the root (/), select "format the partition", and select ext3 for the format type. You must select format to clean up the original content of the selected partition. Otherwise, exceptions may occur during system operation. After editing the partition, click "OK" to display a formatting warning window. If you do not want to format the partition, click Cancel. Otherwise, click "format" to continue. The system configuration is as follows, including boot program setting, network device setting, and Super User Account (Root) password setting. These items can be changed during system operation. Therefore, you can use the default values and click Next continuously. By default, the boot program is installed in the/dev/hda1, that is, the Master Boot area (after the system is installed, you can change it. For details, refer to "manage startup methods "), the installer automatically solves the problem of dual startup (see "dual startup for Windows and Linux "). Click Next to start the installation. The installation progress page is displayed during the installation process. Manual intervention is not required during installation. After the installation is complete, a prompt is displayed. If you are using a CD, click "finish" to restart the computer. We use a virtual computer. Therefore, clicking "end" will only automatically restart the virtual computer. This is not what we want. Therefore, you can press + to obtain the mouse again, disable VMware. Restart the computer again. The grub startup interface will appear. The Linux system has been installed on the computer and can be started. After the Linux system is installed successfully, the NTFS-format primary partition hda1 will be automatically mounted to/mnt/winc, and the fat-format hda5 will be automatically mounted to/mnt/wind, hda6 is automatically mounted to/mnt/wine. Partitions In NTFS format can be automatically mounted by Linux, but can only be read and cannot be written. Partitions in the fat format are readable and writable after they are automatically mounted. However, File Permission control and management cannot be implemented, or disk space quota management cannot be performed. To make full use of Linux features, we should consider creating an ext3 format user data storage partition and storing user data in an ext3 format partition. Windows and Linux dual-start install linux when a Windows system already exists on the Linux boot computer, and choose to write the boot data to/hda1, in Linux, the startup options of windows are automatically added to the Startup menu for selection. The dual-start problem is automatically resolved and does not need to be repeated. If Linux is installed first on the computer and then Windows is installed. Windows will overwrite the primary boot, but will not automatically add the Linux Startup item to the boot menu. In this case, the dual startup problem of Windows and Linux must be solved manually. In this case, the Linux boot sector information should be extracted for backup before Windows is installed. Assume that the Linux boot program extracts the information of the Boot Sector in/dev/hda5 and saves it to the fat16 or FAT32 partition/mnt/wind/. The file name is bootsect. lnx, the corresponding command is: dd If =/dev/hda5 of =/mnt/wind/bootsect. lnx BS = 512 COUNT = 1 This is a command that can be executed in Linux. The file generated by this command is the key to solving the dual startup problem. The storage location of the file is also very important. It should be stored in the fat16 or FAT32 partition. You can copy this file to a floppy disk or a USB flash disk to prevent unexpected events. After installing windows, copy bootsect. lnx to the c root directory of windows, edit the C:/boot. ini file, add the following line, and save it. In this way, after restarting the computer, the "Linux" Startup item will appear in the Windows Startup menu. Select it to enter the Linux operating system. C:/bootsect. lnx = "Linux" restores Windows boot. If the boot data of Linux is installed in/hda1, the MBR is overwritten. In this case, both Windows and Linux can be properly guided by grub. If you want to use the Windows boot program to boot these two systems, you can first prepare the bootsect according to "boot from Windows. lnx file, and then start the computer with a DoS (Win98 or later) boot disk. Execute the following command to restore Windows boot. What fdisk/MBR should do next is to set the boot. ini file as "Guided by Windows" to enable dual startup.

Related Article

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.