3 Linux Basics - Installation of VMware and Linux

3 Linux Basics - Installation of VMware and Linux

  1. "Bird Brother's Linux Private Kitchen Basic Learning Chapter 4th Edition" 1
  2. "Brother Bird's Linux Private Kitchen Server Setup Third Edition" 2
  3. "Han Shunping_2021 Graphical Linux Comprehensive Upgrade" 3
  4. "Han Shunping Education Installation CentOS7.6" 4
  5. "Han Shunping Education Installation CentOS8.1" 5

3.1 Install VMware and CentOS

  Learning Linux requires an environment, that is, a host running the Linux kernel operating system (hereinafter referred to as "Linux host"), and we now use a host with Windows operating system (hereinafter referred to as "Windows host") to study. So we can directly install the Linux system on a computer (clear the Windows system and) and then perform remote access/control through LAN and other technologies. This method is very similar to the actual development situation, as shown in the following figure:

网络连接
Windows主机
Linux主机
Figure 3-1 Actual Linux development-structural relationship

But in this case, for beginners, not only do you have to buy a physical host again (even if the configuration requirements are not high, you will need extra money), you also need to reinstall a system (many bugs will appear in this process), and you need to To fix the network connection, you also need to know how to maintain it later. If you accidentally delete the database later, you need to reinstall the system... The operation is too difficult! Therefore, this course uses the virtual machine software " VMware " running on Windows to teach the whole course. The advantage is that not only does it not require additional equipment, but also can retain "virtual machine snapshots" arbitrarily, which can easily restore the state of the virtual machine. For Beginners can focus on learning instructions without wasting time on reinstalling the system repeatedly.

  To use software to develop a virtual machine, you need to install the virtual machine software VMware first, and then create a virtual machine on this software and install a Centos7.6 system . VMware 15.5 is a software running under the Windows system. This software can create any number of virtual machines and install any system. The structural relationship is as follows:

主机/母机【Windows】
软件 VMware 15.5
CentOS7.6【Linux】
Ubantu【Linux】
Windows11【Windows】
Figure 3-2 Virtual machine for Linux development-structural relationship

Let's introduce these two installation steps in turn.

3.1.1 VMware installation

1. Enable virtualization device support

First check whether "Virtualization" is enabled. If it is not enabled, VMware cannot be installed later. The basic idea is to check whether it is "enabled" in "Performance Manager->Performance->CPU->Virtualization". You can refer to the CSDN blog post "How to determine whether the CPU virtualization function is enabled in the BIOS setting? ". Then:

  1. If it is enabled, go directly to the next step "Install the virtual machine software VMware15.5".
  2. If it is not enabled, you can refer to the Baidu article " Enable BIOS Virtualization Settings | Enable CPU Virtualization Support ". Note that different brands of motherboards have different keys to enter the BIOS. , f2, f12etc. DELcan be tried or Baidu.

2. Install VMware15.5

virtual machine 15.5 is a software for creating virtual machines, the installation method is as follows:

  1. Krypton gold method: the official address will be charged.
  2. Friendly method: "Software Manager" will always drop God, VMware15.5 installation tutorial . The installation demonstration in the video is " P5, 11:20~16:00 ".

3.1.2 Centos7.6 installation steps

  After installing the virtual machine software VMware above, you can create a virtual machine in this software and install a CentOS7.6 system for this virtual machine. The steps are as follows:
1. Download the operating system CD

CentOS 7.6 DVD version 4G is the mainstream production environment in 2020, and Centos 8.1 DVD version 8G will be the mainstream in the future. Directly click on the image link of Alibaba Cloud to download it in the browser, or copy the corresponding address to open Xunlei to download it.

  • CentOS 7.6: http://mirrors.aliyun.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-2009.iso
  • CentOS 8.1: http://mirrors.aliyun.com/centos/8.1.1911/isos/x86_64/CentOS-8.1.1911-x86_64-dvd1.iso
  • More mirror sources: http://mirrors.aliyun.com/centos/

2. Create a virtual machine

Refer to the tutorial for this part ( P6, 3:20~12:00 34:50 ), pay attention to select "Red Hat Enterprise Linux7 64-bit".

Some keys are given below:

  • VMware15:
    UY758-0RXEQ-M81WP-8ZM7Z-Y3HDA
    VF750-4MX5Q-488DQ-9WZE9-ZY2D6
    UU54R-FVD91-488PP-7NNGC-ZFAX6
    YC74H-FGF92-081VZ-R5QNG-P6RY4
    YC34H-6WWDK-085MQ-JYPNX-NZRA2

  • VMware17: System House article " vmware17 latest key permanent use ".
    4A4RR-813DK-M81A9-4U35H-06KND
    NZ4RR-FTK5H-H81C1-Q30QH-1V2LA
    JU090-6039P-08409-8J0QH-2YR7F
    4Y09U-AJK97-089Z0-A3054-83KLA
    4C21U-2 KK9Q-M8130-4V2QH-CF810
    MC60H-DWHD5-H80U9 -6V85M-8280D
    ZA30U-DXF84-4850Q-UMMXZ-W6K8F
    AC590-2XW97-48EFZ-TZPQE-MYHEA
    YF39K-DLFE5-H856Z-6NWZE-XQ2XD
    AC15R-FNZ16-H8DWQ-WFPNV-M28E2 C Z1J8
    -A0D82-489LZ-ZMZQT-P3KX6
    YA11K -6YE8H-H89ZZ-EXM59-Y6AR0

3. Start to install the system (CentOS7.6)

For the specific process, please refer to ( P6, 12:00~34:50 ) and the document "Han Shunping Education Installation CentOS7.6.docx". Some common faults are listed below:

[Fault 1]: After clicking VMware "Start Virtual Machine", the computer blue screens and restarts.

  • Solution 1: Control Panel -> Programs -> Enable or Disable Windows Features -> Check "Virtual Machine Platform".
  • Solution 2: Control Panel -> Programs -> Enable or Disable Windows Features -> Uncheck "Hyper-V".
  • Solution 3 [Valid for me]: VMware checks to update to VMware 17 version. After downloading the installation package from the official website, VMware on this computer will be automatically upgraded. Note that the keys need to be changed, refer to the keys listed in the previous sub-step.

Refer to the Web Development Network article " Share several solutions to the blue screen when the Vmware virtual machine is turned on ".

[Fault 2]: After clicking VMware "Start Virtual Machine", it pops up "VMware Workstation is not compatible with Device/Credential Guard. After disabling Device/Credential Guard, you can run VMware Workstation.", as shown below:

  • The solution is the same as above.
  • Difficulty 1: Partitioning

Boot partition boot-1G-standard partition ext4, swap partition swap-2G-standard partition swap, root partition /-remaining all-standard partition ext4.

Swap partition: The swap technology is to swap out memory to auxiliary storage when the process is suspended, freeing up memory for the process in the ready state to improve memory utilization.
Root Partition: Basically all software is installed here.

  • Difficulty 2: Three modes of network connection
  1. Bridge mode: IP is actually assigned, and the virtual system and external systems (such as the Internet) can communicate in two directions, but it is easy to cause IP conflicts.
  2. NAT mode : IP is only allocated locally. The virtual machine can communicate with the external system through the host in one direction, but the outside world cannot directly communicate with the virtual machine. It can only communicate with the virtual machine indirectly through the network port of windows, which is not easy to cause IP conflicts . .
  3. Host mode: an independent system, the virtual machine does not communicate with the outside world, and generally only accesses the physical host (local machine).

3.3 Basic operation of virtual machine

1. Virtual machine cloning
If many virtual machines with the same configuration are required at the same time, it is too complicated to configure one by one. At this time, using "virtual machine cloning" can quickly realize the "copy and paste " of virtual machines . Note that when cloning, the virtual machine needs to be shut down first . The methods to accomplish virtual machine cloning are:

  1. Copy an installed virtual machine file directly. It is to directly copy the virtual machine folder created by VMware, and even compress it into a file and send it to the Internet for rapid deployment and use by others.
  2. Use VMware's clone operation. Right-click on the virtual machine name -> Manage -> Clone -> "Create clone link" is just a reference, changes to the virtual machine will affect the original "parent"; "Create full clone" is the real clone.

2. Virtual machine snapshot
When performing a major operation on the virtual machine system, you can first "archive" the virtual machine, so that even if some subsequent misoperations cause system abnormalities, the system can quickly return to the original normal operation status. The "snapshot management" in VMware realizes the "rollback" of virtual machines . Notice:

  1. Each "archive" will take up a certain amount of virtual machine disk space (default 20G), and it will take a long time, so don't take snapshots too frequently.
  2. Each "archive" and "read file" will display the progress in the lower left corner of the VMware software window , but be careful to wait for the completion before proceeding to the next step! ! Otherwise, many strange problems will arise.

3. Virtual machine migration and deletion
The essence of a virtual system is a file placed in a folder. So directly deleting/copying these files as a whole will delete/clone a complete virtual machine accordingly.

  1. Virtual machine migration: directly copy or cut the whole folder of the installed virtual system to another location for use.
  2. Deletion of the virtual machine: use VMware to delete (menu->delete from disk); or manually delete the folder corresponding to the virtual system directly.

3.4 Install VMtools

After installing VMtools, you can set up Windows and CentOS shared folders to facilitate better management of VM virtual machines under Windows. Steps to install vmtools:

  1. Enter centos with root authority, right-click on the CD-ROM "CentOS7 x86_64" and "eject".
  2. Click "Virtual Machine" -> "Reinstall VMware Tools" in the VM menu bar. If the option is grayed out, just go to "Virtual Machine" -> "Power" -> "Suspend Virtual Machine" -> "Restart Virtual Machine".
  3. After a while, the CD-ROM drive "VMware Tools" will appear on the Centos desktop, double-click to open the installation package "xx.tar.gz".
  4. Copy it to a folder /opt, which is in "Other Locations -> Computer".
  5. Right-click on /optthe folder and "Open in Terminal", enter the following decompression command tar, note that the xx in the second command should be replaced with the real file name, and the Tab key can quickly fill in the file name:
tar -zxvf xx.tar.gz
  1. Enter the directory where the vm is decompressed. /optRight-click the directory and enter the terminal:cd vmware...
  2. Install: ./vmware- install.pl.
  3. Next, read the options, and selectively use the default settings (pay attention to overwriting the previously installed files). Generally, just press Enter, and the installation will be successful.

Note: gcc is required to install vmtools, the command gcc-vcan check whether gcc is installed.
Note: The 7.9 version does not need to install the tool! No need to install! No need to install! system build-in!

3.5 Setting up shared folders

After the installation of VMTools is complete, you can set up a shared folder. For example, if you want to install a shared folder on the F drive, the specific steps are as follows:

  1. On the host Windows system, create a new folder F:/CentOS_share. You can also create test files in this folder test.txt.
  2. Set up VMware: Right-click the virtual system name -> Settings -> Options -> Shared Folders -> Always Enabled -> Add -> Find the corresponding folder -> OK.
  3. The shared folder is under Centos /mnt/hgfs/. It can be found in "Home Folder -> Other Locations -> Computer".

Through the above operations, Windows and CentOS can share files, and the process of sharing folders depends on VMware software . However, in actual development, Linux and Windows generally do not share the same physical host, so file uploads and downloads are completed remotely (depending on Xshell6 and Xftp6), which will be explained later.


  1. "Bird Brother's Linux Private Kitchen Basic Learning Chapter 4th Edition" ↩︎

  2. "Bird Brother's Linux Private Kitchen Server Setup Third Edition" ↩︎

  3. "Han Shunping_2021 Illustrated Linux Comprehensive Upgrade" ↩︎

  4. "Han Shunping Education Installation CentOS7.6" ↩︎

  5. "Han Shunping Education Installation CentOS8.1" ↩︎

Guess you like

Origin blog.csdn.net/weixin_46258766/article/details/131949072