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. 14、oracle sql语法

    14.0.注释: 1.单行注释:-- 2.多行注释:/* */ 14.1.sqlplus中的set指令: 1.设置每行显示的数据长度: SET LINESIZE 500; #有效范围是1-32767, ...

  2. 『动善时』JMeter基础 — 53、JMeter集合点功能的使用

    目录 1.集合点介绍 2.同步定时器界面介绍 3.集合点的使用 (1)测试计划内包含的元件 (2)线程组元件内容 (3)HTTP请求组件内容 (4)同步定时器内容 (5)运行脚本查看结果 4.集合点设 ...

  3. keycloak~自定义rest接口

    rest资源 对于我们集成keycloak来说,你可能会遇到它没有实现的功能,这时需要对kc进行扩展,资源的扩展是其中一个方面,它需要实现RealmResourceProvider和RealmReso ...

  4. POJ 3304 Segments 叉积

    题意: 找出一条直线,让给出的n条线段在这条直线的投影至少有一个重合的点 转化一下,以重合的点作垂线,那么这条直线一定经过那n条线段.现在就是求找到一条直线,让这条直线经过所有线段 分析: 假设存在这 ...

  5. JAVA并发(8)-ThreadPoolExecutor的讲解

    很久前(2020-10-23),就有想法学习线程池并输出博客,但是写着写着感觉看不懂了,就不了了之了.现在重拾起,重新写一下(学习一下). 线程池的优点也是老生常谈的东西了 减少线程创建的开销(任务数 ...

  6. CG-CTF Our 16bit Games

    一.放到xp上面跑,发现是一个图形界面的飞机游戏...估计是分数到达多少,然后就可以输出flag. 打开ida,一脸懵逼,主要这玩意16位,我直接静态调试了 发现很多汇编代码,有点懵逼,在最下方的地方 ...

  7. ELK处理Spring Boot 日志,妙!

    在排查线上异常的过程中,查询日志总是必不可缺的一部分.现今大多采用的微服务架构,日志被分散在不同的机器上,使得日志的查询变得异常困难. 工欲善其事,必先利其器.如果此时有一个统一的实时日志分析平台,那 ...

  8. C语言相关知识

    1.指针:在程序中定义了一个变量,在进行编译时就会给该变量再内存中分配一个地址,通过访问这个地址可以找到所需变量,这个变量的地址成为该变量的指针.指针看作是内存中的一个地址,多数情况下,这个地址是内存 ...

  9. XXE学习(待更新)

    XXE基础 XXE(XMl External Injection),即XML外部实体注入漏洞. XXE漏洞发生在应用程序解析XML输入时,没有禁止外部实体得加载,导致可以加载恶意外部文件,造成文件读取 ...

  10. C语言:n++ , ++n,n--,--n

    #include <stdio.h> int main() { int a=3,x; x=(a++)+(++a)+(++a); // 3(4) 5(5) 6(6) printf(" ...