安装虚拟,centos7,putty全过程
首先下载如下安装包
putty链接:https://pan.baidu.com/s/1oXNOkUi6d2rRjFwUJFco-Q
提取码:gcgi
vmware链接:https://pan.baidu.com/s/1XIg_07g-EM-7mPyjInYkLw
提取码:4e6e
Centos链接:
http://mirrors.shu.edu.cn/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso
阿里云yum源
http://mirrors.aliyun.com/repo/Centos-7.repo
运行vmware之后如果需要注册,可以直接百度vmware15的注册码(根据提示百度),注册成功后,点击添加虚拟机,找到下载的centos7
由于我接下来使用的是远程使用centos,所以在安装时选择 最小安装,其他步骤一直点击下一步即可
安装完成之后是没有图形界面的,而且ifconfig、vim等基本命令的,如果查看ip的话,使用ip addr即可,接下来先设置IP
如图,首先找网关地址,根据网关地址设置ip地址,编辑-》虚拟网络编辑器
点击Vmnet8-》NAT设置
看到网关ip为192.168.85.2,子网掩码为255.255.255.0
此时可以设置的ip范围为192.168.85.1 - 192.168.85.254
在此区间随意设置,我设置的是192.168.85.12/24
然后进入虚拟机中,执行命令
nmcli connection show 查看识别的网卡,根据识别的网卡设置ip,一般都为ens33,然后
nmcli connection modify ens33 ipv4.method manual ipv4.address ‘192.168.85.12/24’ ipv4.gareway ‘192.168.85.2’ connection.autoonnect yes
nmcli connection up ens33
然后ping www.baidu.com
Ping 通即为成功
然后设置yum源
rm -rf /etc/yum.repos.d/*.repo
vi /etc/yum.repos.d/ali.repo
这个是阿里云的yum源,配置文件在下面,也可以根据开头提供的地址下载(但是使用不了wget)
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
以上全部为配置文件
使用yum repolist 可看到大概一万一千个安装包
安装ifconfig命令
可以先搜索 yum search ifconfig
发现要安装net-tools
yum -y install net-tools
安装完成之后就可以使用ifconfig命令
关于远程:
设置完ip之后,就可以运行putty,
在Host Name输入ip,点击open即可。关于putty其他功能,可自行百度
以上即为全过程,如果有些命令不可用,可以百度,然后安装相关包或者修改配置文件