Article directory
1. Detailed installation steps
First, left-click the file in the upper left corner of the VMware virtual software and selectCreate a new virtual machine;
Select the custom installation method, the next step;
Next step;
Choose to install the operating system later, the next step;
Select LINUX for the client operating system;
It is recommended to customize and change the installation path;
Choose 2 processors;
The virtual machine memory selects 4GB;
Choose to use Network Address Translation (NAT);
Select the LSI Logic SAS method;
Select the SCSI mode;
Choose to create a new virtual disk;
Select 60GB as the disk size, and split the virtual disk into multiple files;
Direct next step;
Unneeded sound cards and printers can be removed from virtual machines;
Select the specified image file for configuration;
After carefully checking the configuration of the installed virtual machine, click Finish;
Start the virtual machine;
Select Install CentOS 7;
Choose Simplified Chinese;
Click Software Installation, select GNOME Desktop, Development Tools;
Click the installation location and select the partition I want to configure;
Choose to click here to automatically create them, and select the standard partition for the partition scheme;
Decide whether to delete /home and /boot according to your own needs, whether you delete it or not;
Double-check that the change summary is correct, then select Accept Changes;
Click KDUMP to uncheck the enable kdump;
After the above configuration is complete, choose to start the installation;
Wait for a while, then you can create a user and change the password;
It is recommended to create a password that is easy to remember; (the first confirmation will prompt that the password is too short, just click confirm twice in a row)
Create a local common user;
So far, the installation steps of the virtual machine have been successfully completed!
Click to restart;
Choose to accept the license agreement;
Select not listed, change the user login method, and log in as the administrator root;
2. System command configuration
2.1 Switch user
su 用户名 #切换后所在目录不变
su - 用户名 #切换后所在目录变成用户家目录
[CLR@localhost root]$ su CLR
密码:
[CLR@localhost root]$ su - root
密码:
上一次登录:四 3月 23 01:27:43 CST 2023pts/1 上
2.2 Set the hostname
查看当前主机的完整名称
hostname
临时设置主机名
hostname 主机名
永久设置主机名
hostnamectl set-hostname 主机名
或
vi /etc/hostname(设置完后需重启系统才生效)
按i键先删除旧主机名,再输入新主机名(只有第一行有效)
按ESC键,再按SHIFT + “:” 组合键,输入 wq ,再按回车键退出
2.3 View system version information
[root@myhost2 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@myhost2 ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
[root@myhost2 ~]# uname -r
3.10.0-1160.el7.x86_64
[root@myhost2 ~]#
3. Connect to the virtual machine through Xshell
Click Edit to view the virtual network editor;
Keep in mind the subnet IP range and gateway address, then enter the system file;
永久修改网卡IP
vi /etc/sysconfig/network-scripts/ifcfg-ens33 ##进入系统文件修改相关网卡配置
重启网卡
systemctl restart network #重启所有的网卡
ifdown ens33 ; ifup ens33
ifdown ens33 #关闭某个网卡
ifup ens33 #启动某个网卡
ifconfig ens33 down #临时禁用某个网卡
ifconfig ens33 up #重新激活某个网卡(不会更新IP地址)
Restart, the network card configuration takes effect;
In Xshell, select the file, create a new session, and connect to the virtual machine;
Enter the Xshell page to connect to the virtual machine;
Enter the password to realize the connection between Xshell and the virtual machine;
So far, you have successfully connected to the virtual machine, and the experiment is successfully concluded!