欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

vncview 多屏_OpenStack中VNC协议实现多屏共享(多屏不踢访问)

发布时间:2025/4/16 编程问答 55 豆豆
生活随笔 收集整理的这篇文章主要介绍了 vncview 多屏_OpenStack中VNC协议实现多屏共享(多屏不踢访问) 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

OpenStack中VNC协议实现多屏共享

by 无若

libvirt设置基本说明:

"vnc"

Starts a VNC server. The port attribute specifies the TCP port number (with -1 as legacy syntax indicating that it should be auto-allocated). The autoportattribute is the new preferred syntax for indicating autoallocation of the TCP port to use. The listen attribute is an IP address for the server to listen on. Thepasswd attribute provides a VNC password in clear text. The keymap attribute specifies the keymap to use. It is possible to set a limit on the validity of the password be giving an timestamp passwdValidTo='2010-04-09T15:51:00' assumed to be in UTC. The connected attribute allows control of connected client during password changes. VNC accepts keep value only. since 0.9.3 NB, this may not be supported by all hypervisors.

The optional sharePolicy attribute specifies vnc server display sharing policy. "allow-exclusive" allows clients to ask for exclusive access by dropping other connections. Connecting multiple clients in parallel requires all clients asking for a shared session (vncviewer: -Shared switch). This is the default value. "force-shared" disables exclusive client access, every connection has to specify -Shared switch for vncviewer. "ignore" welcomes every connection unconditionally since 1.0.6.

Rather than using listen/port, QEMU supports a socket attribute for listening on a unix domain socket path.Since 0.8.8 For VNC WebSocket functionality,websocket attribute may be used to specify port to listen on (with -1 meaning auto-allocation and autoport having no effect due to security reasons). Since 1.0.6

说明:

1、将sharePolicy设置为"ignore"则支持多屏不踢访问,使用安卓多屏共享访问时,需要开启此功能。

2、将sharePolicy设置为'allow-exclusive'则支持token和ip-port方式访问,这是默认设置,注意使用tightvnc有share connection设置,也支持共享连接(不踢)。

3、将sharePolicy设置为"force-shared"则仅支持token方式访问。

下面是临时修改:

#/usr/lib/python2.7/dist-packages/nova/virt/libvirt/config.py

classLibvirtConfigGuestGraphics(LibvirtConfigGuestDevice):def __init__(self, **kwargs):

super(LibvirtConfigGuestGraphics, self).__init__(root_name="graphics",**kwargs)

self.type= "vnc"self.autoport=True

self.keymap=None

self.listen=None

self.sharePolicy= "ignore"

#test code compress

#self.image_compression = "auto_glz"

#self.streaming_mode = "filter"

defformat_dom(self):

dev=super(LibvirtConfigGuestGraphics, self).format_dom()

dev.set("type", self.type)ifself.autoport:

dev.set("autoport", "yes")else:

dev.set("autoport", "no")ifself.keymap:

dev.set("keymap", self.keymap)ifself.listen:

dev.set("listen", self.listen)

dev.set("sharePolicy", "ignore")#test code compress

#self.type == "spice"

#drv_image = etree.Element("image")

#drv_image.set("compression", self.image_compression)

#dev.append(drv_image)

#/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py

#NB some versions of libvirt support both SPICE and VNC

#at the same time. We're not trying to second guess which

#those versions are. We'll just let libvirt report the

#errors appropriately if the user enables both.

add_video_driver =Falseif ((CONF.vnc_enabled andCONF.libvirt.virt_typenot in ('lxc', 'uml'))):

graphics=vconfig.LibvirtConfigGuestGraphics()

graphics.type= "vnc"graphics.keymap=CONF.vnc_keymap

graphics.listen=CONF.vncserver_listen

graphics.sharePolicy= "ignore"guest.add_device(graphics)

add_video_driver= True

总结

以上是生活随笔为你收集整理的vncview 多屏_OpenStack中VNC协议实现多屏共享(多屏不踢访问)的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。