使用kvm连接windows管理

虚拟机
1.环境要求
KVM 需要有 CPU 的支持(Intel VT 或 AMD SVM),在安装 KVM 之前检查一下 CPU 是否提供了虚拟技术的支持。
- 基于 Intel 处理器的系统,运行grep vmx /proc/cpuinfo
- 基于 AMD 处理器的系统,运行grep svm /proc/cpuinfo
- 检查BIOS,确保BIOS里开启VT
- 本测试基于阿里云Centos源,请看文章末尾下载链接
2.安装与启动
yum install kvm libvirt virt-install qemu-kvm virt-viewer bridge-utils
/etc/init.d/libvirtd start
3.建立虚拟机
- 建一个200G的硬盘
qemu-img create -f qcow2 -o preallocation=metadata /cdata/vm/test.qcow2 200G
2.基于桥接网络建虚拟机
virt-install --name=test --ram 2048 --vcpus=2 --disk path=/cdata/vm/test.qcow2,bus=scsi,sparse --cdrom /cdata/vm/cn_windows_server_2012_r2_with_update_x64_dvd_6052725.iso --graphics vnc,listen=0.0.0.0,port=5920,password=123456, --network bridge=virbr0,model=virtio --force --autostart
4.使用vnc连接虚拟机
注意上面命令行使用5920端口给虚拟机,vnc客户端使用5920连接,密码123456

远程虚拟机
5.附件
官方免费vnc客户端下载链接:https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.19.325-Windows.exe
Centos阿里云下载链接请看我上篇文章。
6.预告
明天打算解决windows鼠标跟随,好像有两种方法,欢迎留言给我。