This article directory
1. Download the CentOS image file
- Download URL: Alibaba Cloud Open Source Mirror Station
- Tip: The download speed may be very slow directly using the browser. It is recommended that you copy the above download address to [Xunlei] for download, which will be much faster. The following are detailed steps:
- After the above 3 steps are completed, you can click [Download Now] to download.
2. Install the virtual machine
- Open VWware, click [File] in the upper left corner with the left mouse button, and then click [New Virtual Machine] (the shortcut key for this step is
Ctrl + N
).
- Note: There is another situation: before this, your VMware may not have installed any virtual machine, your interface may be as follows, then you can directly click [Create a new virtual machine]:
- Check [Typical], and then click [Next]:
- Check [Install the operating system later], and then click [Next]:
- Select [Linux] for the operating system, and select the version of your own image file for the version (mine is [CentOS 7 64-bit]). Then click [Next]:
- [Virtual machine name] can be changed by yourself, then click [Browse] to select the installation path (personal choice), and finally click [Next]:
- 【Maximum Disk Size】You can choose the default one
20
, or change it according to your needs. Then check [Split the virtual disk into multiple files] (this is the default), and finally click [Next]:
- Click [Finish]:
- Return to the following interface:
3. Install CentOS 7
- Click [CentOS 7 64-bit] with the left mouse button, which is the name of the virtual machine created in the previous step. Then click [CD/DVD (IDE) Auto Detect]:
- Check [Use IOS image file], then click [Browse], select the CentOS image file downloaded in the first step, and finally click [OK]:
- Click [CentOS 7 64-bit] with the left mouse button, which is the name of the virtual machine created in the previous step. Click [Start this virtual machine]:
- Then the following interface will appear, we need to wait for a while:
- After a period of waiting, the following interface will appear. Choose language, I personally strongly recommend choosing English, because it will be much more convenient for you to use Linux commands later, and then click [Continue]:
- Select the first [INSTALLATION DESTINATION] under [SYSTEM]:
- The default is enough, and then click [Done], as shown below:
- After the previous step is completed, it will return to the following interface, and then click [SOFTWARE SELECTION] under [SOFTWARE]:
- For those who are new to the system, it is recommended to choose a graphical interface, and click [Done] in the upper left corner after selection. However, the interface is generally not very useful for us, and the interface of CentOS is not easy to operate, so choose the minimum installation here:
- Select the date and time, click [DATE & TIME]:
- Select [shanghai], and then click [Done] in the upper left corner:
- Click [Begin Installation] to start the installation:
- Set
root
account password, click [ROOT PASSWORD]:
- set password:
- After the password is set, enter the following interface and wait for a while:
- After a period of time, return to the following interface and click [Finish configuration] in the lower right corner (sometimes this interface may not exist, just go to the next step):
- Click [Reboot] in the lower right corner, that is, restart:
- Enter the account name and password, the password is invisible, and then click Enter:
- After the input is complete, enter the command line mode:
4. Configure the network
- Because the network adapter mode set during installation is
NAT
mode. There are two ways to configure here, one is to automatically obtain an IP, and the other is to obtain a fixed IP. (The following method is to automatically obtain an IP) - The first thing to ensure is that CentOS is in
NAT
mode:
- On the VMware interface, click [Virtual Network Edito] in [Edit]:
- Click [NAT Settings], and then modify the gateway IP under the same network segment as the subnet IP, that is, the first three digits must be the same, that is, the
192.168.138
last digit must be different (default is fine), and finally click [OK] to save the settings :
[Note]: The above steps can be skipped under normal circumstances, we just did a check. If your steps are strictly in accordance with the previous examples, there will be no problem with the above steps, so you can skip them.
- Enter the network configuration file directory of the virtual machine, the command is
cd /etc/sysconfig/network-scripts/
, and usels
the command to check whether there isifcfg-XXX
a configuration file with a name, if not, it means that the network card is not recognized, and you can only reinstall or change the version of the virtual machine (normally, there are, Don't worry):
- Enter the file with
vi ifcfg-ens33
the commandifcfg-ens33
. Pressi
to enterinsert
edit mode.
SetBOOTPROTO
asdhcp
,ONBOOT
set asyes
, press Esc to enter the command mode, enter to:wq
save and exit:
- After the configuration is complete, enter the command:
service network restart
, restart the network card to make the network card settings take effect, and then you can go online; - Enter
ip addr
to check the dynamically allocated IP, and you can find that it has been automatically allocated.
- Finally, verify whether you can access the Internet normally, and enter the command
ping www.baidu.com
:
At this point, the installation is complete!