KVM镜像管理(win)

编程知识 更新时间:2023-04-28 07:18:25

制作Windows7镜像

(1)新建Windows7的虚拟机,安装系统方法选本地安装介质

(2)选择安装镜像,需先讲win7镜像移动到default存储池里

(3)安装前准备工作,安装前需进行定制,所以勾选

(4)定制磁盘文件,disk bus设置为virtio

(5)定制网卡设备的模式,把device model设置为virtio,提高网卡性能

(6)添加一块软盘,点击连接,选择驱动

(7)设置虚拟机启动顺序

(8)进行Windows7安装,点击加载驱动程序,选win7,下一步安装

(9)Windows7中安装phpstudy

(10)对Windows进行封装,封装前记得讲IP设为自动获取

(11)进入虚拟机详情页,弹出连接的光盘并删除软盘

(12)查看虚拟机的镜像文件,发现镜像文件为16G,实际占用8.4G

[root@localhost ~]# qemu-img info /var/lib/libvirt/images/win7.qcow2 
image: /var/lib/libvirt/images/win7.qcow2
file format: qcow2
virtual size: 16G (17179869184 bytes)
disk size: 8.4G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: true
[root@localhost ~]# 

(13)安装virt-sysprep所提供的软件包libguestfs-tools

yum install libguestfs-tools -y

(14)压缩镜像文件,压缩后的镜像为/var/lib/libvirt/images/win7_phpstay.qcow2

[root@localhost ~]# virt-sparsify --tmp /tmp --compress --convert qcow2 /var/lib/libvirt/images/win7.qcow2 /var/lib/libvirt/images/win7_phpstay.qcow2 

测试Windows7镜像

(1)新建虚拟机,选导入现有磁盘映像,选Windows7,完成

(2)进入到桌面

(3)查看IP

(4)查看phpstudy是否可用

更多推荐

KVM镜像管理(win)

本文发布于:2023-04-21 05:19:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/a4de6767a9ffdb1894e4117a8522ae2a.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:镜像   KVM   win

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 92477文章数
  • 23544阅读数
  • 0评论数