目录
一.真机准备
?二.母板虚拟机建立
三.真机封装硬盘
一.真机准备
1.rhel7.6镜像准备
2.本地私有网段在br0中添加 172.25.7.250?
3.挂载镜像在apache目录 /var/www/html/rhel7.6上
?
?二.母板虚拟机建立
virt-manager
新的虚拟机? 本地镜像选用

?后面设内存1024 cpu 2 硬盘30G?? 虚拟机名称自己取? 这里是server
安装? 添加超级用户密码即可? 重启
?对此母板进行配置
配置完网络记得restart network,并且网络仓库要可用
yum repolist?? 网关 172.25.7.250

关掉selinux, 防火墙,还有网络管理器
systemctl disable --now firewalld
vi /etc/sysconfig/selinux 注:还没有vim编辑器
systemctl disable --now NetworkManager
yum install vim lftp bash-* net-tools -y 下载一些需要的工具
tab补齐 常用网络命令
本地解析的添加?? 将原来虚拟机上母机改名server1

?母机
poweroff
三.真机封装硬盘
查看母盘大小 和压缩工具是否存在? 然后下载

yum search libguestfs-tools
yum install libguestfs-tools -y

virt-sysprep -d server ? 清楚缓存数据
查看内存使用情况

virt-sparsify --compress server.qcow2 new_server.qcow2
将母板压缩成新母板

?节省电脑空间,删掉旧的母板

?创建虚拟机快照
qemu-img create -f qcow2 -b server.qcow2 sever1
?
?母机此时可以删掉了

用快照镜像建立新的虚拟机


?
?进行网络配置使用???? 主机名要与本地解析对应

|