企业基本linux虚拟环境的部署
1.准备rhel-server-7.6-x86_64-dvd.iso 镜像
2.下载Apache服务 并将镜像挂载到默认发布目录上
3. 开机自动挂载镜像
4. virt-manager 打开虚拟机管理安装虚拟机
选择第二个开始安装
installation destination选择自动分盘
KDUMP中取消对号如图
设置root密码后重启
5. 修改虚拟机配置
输入密码后登陆
禁用网络 防火墙
关闭selinux
vi /etc/selinux/config
配置网络
vi /etc/sysconfig/network-scripts/ifcfg-eth0
地址解析
vi /etc/hosts
172.25.76.250 foundation76.ilt.example.com
172.25.76.1 server1
.
.
.
172.25.76.10 server10
设置repo
vi /etc/yum.repo.d/dvd.repo
[dvd]
name=rhel7.6
baseurl=http://172.25.76.250/rhel7.6
gpgcheck=0
yum repolist
安装基本软件
yum install -y lftp vim net-tools bash-*
关闭虚拟机
6. 封装硬盘
[root@foundation76 images]# dnf install libguestfs-tools.noarch libguestfs-tools-c.x86_64 -y
清理缓存
[root@foundation76 images]# virt-sysprep -d rhel7.6-new -------不要加.qcow2!!!
压缩
[root@foundation76 images]# virt-sparsify --compress rhel7.6-new.qcow2 small.qcow2
7.快捷创建虚拟机
[root@foundation76 images]# qemu-img create -f qcow2 -b small.qcow2 server1234
随后更改对应的服务器号更改ip即可