一、kvm的vnc服务关闭
1、关闭虚拟机
virsh shutdown privi-server
2、virsh edit privi-server找到下面内容进行删除
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics>
3、启动虚拟机后vnc连接失效
virsh start privi-server
二、设置网络模式
KVM修改虚机网卡模式:由NAT模式改为Bridge模式
1、关闭虚机
virsh shutdown privi-server
2、编辑虚机配置文件
virsh edit privi-server <interface type='default'> 改为<interface type='bridge'> <mac address='52:54:00:50:58:7e'/> <source network='default'/> 改为<source bridge='br0'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> 修改为下面内容 <interface type='bridge'> <mac address='52:54:00:50:58:7e'/> <source bridge='br0'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface>
保存退出
3、启动虚机
virsh start privi-server