[Linux] Install a virtual machine

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;

insert image description here

Next step;

insert image description here

Choose to install the operating system later, the next step;

insert image description here

Select LINUX for the client operating system;

insert image description here

It is recommended to customize and change the installation path;

insert image description here

Choose 2 processors;

insert image description here

The virtual machine memory selects 4GB;

insert image description here

Choose to use Network Address Translation (NAT);

insert image description here

Select the LSI Logic SAS method;

insert image description here

Select the SCSI mode;

insert image description here

Choose to create a new virtual disk;

insert image description here

Select 60GB as the disk size, and split the virtual disk into multiple files;

insert image description here

Direct next step;

insert image description here

Unneeded sound cards and printers can be removed from virtual machines;

insert image description here

Select the specified image file for configuration;

insert image description here

After carefully checking the configuration of the installed virtual machine, click Finish;

insert image description here

Start the virtual machine;

insert image description here

Select Install CentOS 7;

insert image description here

Choose Simplified Chinese;

insert image description here

Click Software Installation, select GNOME Desktop, Development Tools;

insert image description here

Click the installation location and select the partition I want to configure;

insert image description here

Choose to click here to automatically create them, and select the standard partition for the partition scheme;

insert image description here

Decide whether to delete /home and /boot according to your own needs, whether you delete it or not;

insert image description here

Double-check that the change summary is correct, then select Accept Changes;

insert image description here

Click KDUMP to uncheck the enable kdump;

insert image description here

After the above configuration is complete, choose to start the installation;

insert image description here

Wait for a while, then you can create a user and change the password;

insert image description here

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)

insert image description here

Create a local common user;

insert image description here

So far, the installation steps of the virtual machine have been successfully completed!

insert image description here

Click to restart;

insert image description here

Choose to accept the license agreement;

insert image description here

Select not listed, change the user login method, and log in as the administrator root;

insert image description here

2. System command configuration

2.1 Switch user

su 用户名		#切换后所在目录不变
su - 用户名		#切换后所在目录变成用户家目录
[CLR@localhost root]$ su CLR
密码:
[CLR@localhost root]$ su - root
密码:
上一次登录:四 323 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 ~]# 


insert image description here

3. Connect to the virtual machine through Xshell

Click Edit to view the virtual network editor;

insert image description here

Keep in mind the subnet IP range and gateway address, then enter the system file;

永久修改网卡IP
vi /etc/sysconfig/network-scripts/ifcfg-ens33   ##进入系统文件修改相关网卡配置

insert image description here

重启网卡
systemctl restart network		#重启所有的网卡
ifdown ens33 ; ifup ens33
ifdown ens33					#关闭某个网卡
ifup ens33						#启动某个网卡

ifconfig ens33 down				#临时禁用某个网卡
ifconfig ens33 up				#重新激活某个网卡(不会更新IP地址)

insert image description here

Restart, the network card configuration takes effect;

insert image description here

In Xshell, select the file, create a new session, and connect to the virtual machine;

insert image description here

Enter the Xshell page to connect to the virtual machine;

insert image description here
insert image description here

Enter the password to realize the connection between Xshell and the virtual machine;

insert image description here

So far, you have successfully connected to the virtual machine, and the experiment is successfully concluded!
insert image description here

Guess you like

Origin blog.csdn.net/cailirong123/article/details/129712090
Recommended