在使用spice客户端(Rmote viewer)远控虚拟机时,发现虚拟机桌面不能随着远控窗口的大小实时调整,或者当使用spice满屏功能时,虚机的桌面并不能占满当前屏幕。
解决方法:
通过查阅spice官网上spice的使用说明 https://www.spice-space.org/spice-user-manual.html ,可以发现spice提供了一个虚机内部使用的插件spice-vdagent,这个插件可以解决分辨率无法调整的问题。
vdagent使用方法:
使用vdagent需要在虚机操作系统中安装vdagent相关rpm包 spice-vdagent,并且为虚拟机添加 virtio-serial PCI设备和spicevmc char设备,这两个设备通过虚拟机的xml添加,如下
<devices> <controller type='virtio-serial' index='0'/> <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> </channel> </devices>
附加说明:
按照vdagent官网上的说明,使用vdagent后可以直接从spice远控窗口中将虚机中的文件拷贝到host上,我尝试了一下,没有效果,不清楚是不是还有相关配置没有设置,后面确认后再更新帖子;
我验证时使用的是centos7.2的虚机镜像。