一:编辑安装脚本

[root@KVM ~]# cat ins-win01.sh
virt-install -v -n SN001_windows01 -r 1024 --vcpus=1 -c /root/tasks/win2003.iso --vnc --vncport=5900 --vnclisten=0.0.0.0 --os-type=windows -f /dev/vg01/windows01_sys  -f /dev/vg01/windows01_data   -w bridge:br2  --connect qemu:///system

 

----------------------------------------

-v 全虚拟化客户端 半虚拟化为-p

-n 虚拟机名称

-r 虚拟机分配的内存

--vcpu 虚拟机分配的cpu核数

-c 使用的CD-ROM路径

--vnc 使用图形配置

--vncport vnc使用的端口

--vnclisten  vnc监听的地址

--os-type  虚拟机类型

-f  指定虚拟机的存储设备

-w 虚拟机使用的桥

 

[root@KVM ~]#sh ins-win01.sh 

运行脚本后查看vnc端口 为5900

[root@KVM ~]# ps -ef|grep vnc
root     15432 15431  0 18:02 pts/1    00:00:02 /usr/bin/python -tt /usr/sbin/virt-install -v -n SN349_windows01 -r 1024 --vcpus=1 -c /root/tasks/win2003.iso --vnc --vncport=5900 --vnclisten=0.0.0.0 --os-type=windows -f /dev/vg01/windows01_sys -f /dev/vg01/windows01_data -w bridge:br2 --connect qemu:///system
qemu     15444     1 99 18:02 ?   

 

二:使用vnc客户端工具管理windows虚拟机

--使用vnc客户端工具连接至虚拟机即可

image