OpenStack中VNC协议实现多屏共享
by 无若
 
libvirt设置基本说明:
 
  <devices>
<graphics type='sdl' display=':0.0'/>
<graphics type='vnc' port='5904' sharePolicy='allow-exclusive'>
<listen type='address' address='1.2.3.4'/>
</graphics>
<graphics type='rdp' autoport='yes' multiUser='yes' />
<graphics type='desktop' fullscreen='yes'/>
<graphics type='spice'>
<listen type='network' network='rednet'/>
</graphics>
</devices>
 
 
"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
class LibvirtConfigGuestGraphics(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" def format_dom(self):
dev = super(LibvirtConfigGuestGraphics, self).format_dom() dev.set("type", self.type)
if self.autoport:
dev.set("autoport", "yes")
else:
dev.set("autoport", "no")
if self.keymap:
dev.set("keymap", self.keymap)
if self.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 = False
if ((CONF.vnc_enabled and
CONF.libvirt.virt_type not 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
 
 
 
 

OpenStack中VNC协议实现多屏共享(多屏不踢访问)的更多相关文章

  1. Linux&Windows中VNC协议及使用方法

    [转载]window下使用vnc远程登录ubuntu/linux图形界面_五个粽子_新浪博客http://blog.sina.com.cn/s/blog_677265f601012mqg.html V ...

  2. 在Ubuntu下的OpenStack中配置使用Spice协议

    在Ubuntu下的OpenStack中配置使用Spice协议 by 无若 ####控制节点#安装apt-get install nova-spiceproxy spice-html5 spice-vd ...

  3. 在CentOS7下的OpenStack中配置使用Spice协议

    在CentOS7下的OpenStack中配置使用Spice协议 by 无若   1. 需要的包 在计算节点上 #yum install spice-html5   注意:使用yum安装spice-ht ...

  4. 解决配置Ubuntu中vnc远程显示灰屏

    解决配置Ubuntu中vnc远程显示灰屏a. 缺失图形化工具b.  ~/.vnc/xstartup 权限不对1. Ubuntu 16.04 安装 VNC 及 Mate 桌面环境https://www. ...

  5. 探索 OpenStack 之(14):OpenStack 中 RabbitMQ 的使用

    本文是 OpenStack 中的 RabbitMQ 使用研究 两部分中的第一部分,将介绍 RabbitMQ 的基本概念,即 RabbitMQ 是什么.第二部分将介绍其在 OpenStack 中的使用. ...

  6. VNC协议分析

    VNC协议分析 摘自: http://blog.csdn.net/forever_feng/article/details/4703088 简介 VNC(Virtual Network Computi ...

  7. OpenStack 中 RabbitMQ 的使用

    OpenStack 中 RabbitMQ 的使用 本文是 OpenStack 中的 RabbitMQ 使用研究 两部分中的第一部分,将介绍 RabbitMQ 的基本概念,即 RabbitMQ 是什么. ...

  8. Openstack的vnc界面定制

    先来看一下青云的vnc界面: 在来看一下openstack的自带的vnc界面: 区别于感受 本身原理是一样的,但是vnc上面的html布局不一样而已,但是青云的vnc界面给人的感受是:清晰提示,信息给 ...

  9. 嵌入式操作系统VxWorks中网络协议存储池原理及实现

    嵌入式操作系统VxWorks中网络协议存储池原理及实现 周卫东 蔺妍 刘利强 (哈尔滨工程大学自动化学院,黑龙江 哈尔滨,150001) 摘  要  本文讨论了网络协议存储池的基本原理和在嵌入式操作系 ...

随机推荐

  1. 44、djanjo工程(介绍)

    44.1.什么时web框架: 1.框架,即framework,特指为解决一个开放性问题而设计的具有一定约束性的支撑结构,使用看框架可以 帮助你快速开发特定的形同,简单的说,就是你用别人搭建好的舞台来做 ...

  2. 5、mysql_sql语言介绍

    5.1.什么是sql: 总结:sql语句是关系型数据库的结构化查询和程序设计语言: 5.2.sql的分类: 1.数据库查询语言(DQL): select user,host,password from ...

  3. JS replace 替换全部数据

    (1)使用具有全局标志g的正则表达式 var str = "dogdogdog"; var str2 = str.replace(/dog/g,"cat");/ ...

  4. POJ 2947 2947 Widget Factory 高斯消元

    给出组件的数量n,给出记录的数量m(n就是变元数量,m是方程数量).每一个记录代表一个方程,求每个组件的生产天数. 高斯消元即可 #include <cstdio> #include &l ...

  5. AcWing 829. 模拟队列

    实现一个队列,队列初始为空,支持四种操作: (1) "push x" – 向队尾插入一个数x: (2) "pop" – 从队头弹出一个数: (3) " ...

  6. 资源:Postgresql数据库下载路径

    postgresql下载路径: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

  7. python中的内置函数lambda map filter reduce

    p.p1 { margin: 0; font: 12px "Helvetica Neue" } p.p2 { margin: 0; font: 12px "Helveti ...

  8. tf-gpu报错:ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

    错误1:ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory 一般这种问题 ...

  9. 鸟哥的Linux私房菜基础学习篇--进程(process)一 归纳总结

    权限!权限!权限! 没有权限,一些资源你是没办法使用的.在Linux中cat filename,结果屏幕显示了filename的内容,为什么你能看见,而我不能?权限.与UID/GID有关,与文件的属性 ...

  10. C语言:异或

    异或运算符"∧"也称XOR运算符.它的规则是若参加运算的两个二进位同号,则结果为0(假):异号则为1(真).即 0∧0=0,0∧1=1, 1^0=1,1∧1=0. 相同为0,不相同 ...