Linux运维学习笔记-系统环境的搭建

虚拟机版本:VMware-workstation-full-15.0.0-10134415.exe
系统:rhel-server-7.3-x86_64-dvd.iso

一、系统安装

1、新建虚拟机

新建一个虚拟机
Linux运维学习笔记-系统环境的搭建
选择自定义安装
Linux运维学习笔记-系统环境的搭建
硬件兼容性选择15.x或者12.x
Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建

这里Linux版本选择“Red Hat Enterprise Linux 7 64”
Linux运维学习笔记-系统环境的搭建
修改虚拟机名称和安装位置

Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建
这里一般给个2G内存

Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建

Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建
选择”将虚拟磁盘拆分成多个文件(M)”

Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建

2、系统安装

选择镜像文件
Linux运维学习笔记-系统环境的搭建
启动虚拟机
Linux运维学习笔记-系统环境的搭建
第一项为直接安装,第二项为先检测文件再安装
这里我选择”直接安装”

Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建

选择安装方式:最小化安装
Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建

选择安装目标,并进行磁盘分区:
Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建
Linux运维学习笔记-系统环境的搭建

开始安装
Linux运维学习笔记-系统环境的搭建
设置root用户密码:

Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建
Linux运维学习笔记-系统环境的搭建
Linux运维学习笔记-系统环境的搭建
Linux运维学习笔记-系统环境的搭建

二、系统基础环境配置

1、网卡配置

a、虚拟机网卡桥接

为了在外界网络变化不影响系统的网络,这里使用NAT方式进行桥接

这里查看虚拟网卡VMnet8所分配的网段是192.168.197.0/24网段,待会为系统设置静态IP时,设置此网段的地址,网关地址为192.168.197.2
Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建

网卡桥接:将虚拟机系统网卡桥接到Vmnet8
Linux运维学习笔记-系统环境的搭建

b、系统网卡配置

打开网卡配置文件
/etc/sysconfig/network-scripts/ifcfg-ens33

Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建
Linux运维学习笔记-系统环境的搭建
修改项:
IP地址获取方式修改为静态配置
BOOTPROTO=static
**网卡
ONBOOT=yes

添加项:
IPADDR=192.168.197.201
NETMASK=255.255.255.0
GATEWAY=192.168.197.2
DNS1=192.168.197.2
IP地址配置刚刚桥接的Vmnet8网卡的网段
Linux运维学习笔记-系统环境的搭建
重启网络服务:
systemctl restart network
Linux运维学习笔记-系统环境的搭建
Linux运维学习笔记-系统环境的搭建
测试:
Linux运维学习笔记-系统环境的搭建

2、本地Xshell连接

a、启动sshd服务

系统是默认启动的:
如果没有启动可以使用”systemctl start sshd”启动服务

Linux运维学习笔记-系统环境的搭建

b、本地网卡设置

找到虚拟机网卡VMnet8
Linux运维学习笔记-系统环境的搭建

Linux运维学习笔记-系统环境的搭建

c、使用XShell连接

Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建Linux运维学习笔记-系统环境的搭建

成功连接

Linux运维学习笔记-系统环境的搭建

3、YUM源配置

在“/etc/yum.repos.d/”目录下创建一个以”.repo”
Linux运维学习笔记-系统环境的搭建
编辑内容:
[xxxxxx] ----- 该源的唯一标识(名称任意)
name=Used to test Env ----- 描述
baseurl=file:///mnt ----- 将光盘(媒介)中的内容挂载到哪里
enabled=1 ---- 是够启用这个仓库 1启用 0不启用
gpgcheck=0 ---- 是否检测仓库 1检测(配合使用gpgkey指定检测文件位置) 0不检测
Linux运维学习笔记-系统环境的搭建
将系统ISO镜像光盘连接到服务器
Linux运维学习笔记-系统环境的搭建
挂载:
mount /dev/cdrom /mnt/
Linux运维学习笔记-系统环境的搭建