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

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
时间: 2024-08-28 07:35:11

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

在OPENSTACK中 WIN7和WIN2008 R2实例启动时蓝屏报 STOP:0X0000005DT

故障现象: 在OPENSTACK中 WIN7和WIN2008 R2实例启动时报 STOP:0X0000005DT ,VirtIO驱动已经安装,但WIN2003实例启动正常. 解决方法: 修改nova.conf: libvirt_type=qemu libvirt_cpu_mode=None 其中虚拟化应该选kvm,并且cpu_mode要设为host-model修改为: libvirt_type=kvm libvirt_cpu_mode=host-model 此时重启openstack-nova-

探索 OpenStack 之(14):OpenStack 中 RabbitMQ 使用研究 (上半部分)

本文是 OpenStack 中的 RabbitMQ 使用研究 两部分中的第一部分,将介绍 RabbitMQ 的基本概念,即 RabbitMQ 是什么.第二部分将介绍其在 OpenStack 中的使用. 1 RabbitMQ 的基本概念 RabbitMQ 是实现了高级消息队列协议(AMQP)的开源消息代理软件(亦称面向消息的中间件). AMQP是一个定义了在应用或者组织之间传送消息的协议的开放标准 (an open standard for passing business messages be

VNC协议分析

VNC协议分析 摘自: http://blog.csdn.net/forever_feng/article/details/4703088 简介 VNC(Virtual Network Computing)是基于RFB(Remote Frame Buffer)协议进行通信的,是一个基于平台无关的简单显示协议的超级瘦客户系统, 由Cambridge的AT&T实验室设计开发的. vnc的缺省端口是main:5900(C/S)和http:5800(B/S)端口. RFB (远程帧缓存) 是一个远程图形

vnc+kvm远程安装系统的黑屏问题

利用vnc从Windows远程到linux,再从linux的kvm中远程连接到kvm管理器,安装系统时发现总是黑屏,开始以为是安装包的问题,后来在kvm本地安装发现能够正常显示,这应该是vnc的bug吧. 之后利用Remote viewer工具能够成功远程.过程如下 1.在Windows中vnc远程linux,在kvm中连接远端服务器的kvm管理器,新建虚拟机. 2.在遇到如下图界面时,把箭头所指选项勾上 3.在Display Spice 中改为如下选项,因为kvm默认是localhost不能远

VirtualBOX中的Fedora 25 客户机如何全屏化显示?如何安装增强工具?

首先保证你已经能打开在vbox中安装的Fedora 25. 显示全屏化的时候,却是一个分辨率比较低的窗口.这时候,我们需要安装虚拟机的增强工具. 打开虚拟机的工具栏-->安装增强功能 进入fedora 25虚拟机会有一个挂载好的文件,/run/media/wu/VBOXADDITIONS_5.1.22_115126(后面的版本号会有所差别,wu是我用户名) 打开终端,切换到root用户,执行以下命令,安装需要的包: dnf install -y gcc kernel  kernel-devel

也谈OpenStack中的虚拟机HA

OpenStack是一个旨在为公共及私有云的建设与管理提供软件的开源项目.它的社区拥有超过130家企业及1350位开发者,这些机构与个人都将OpenStack作为基础设施即服务(IaaS)资源的通用前端.OpenStack项目的首要任务是简化云的部署过程并为其带来良好的可扩展性.做为云计算IAAS层事实标准,OpenStack广泛的应用与各行各业.到目前为止OpenStack社区并没有一个完整的虚拟机HA解决方案.起初社区认为虚拟机的HA不是云平台层次的特性,不应该在云平台层面来实现,虚拟机的H

openstack中创建一个虚拟机经过的51步

一.前言 本文在林海峰老师"openstack创建一个VM所需的29步"基础上进行了补充和修改,文中只用到了openstack六个核心组件,为了便于理解,架构中不同组件内的rabbit mq和db为同一个(可以为每个组件配置单独的db和rabbit mq).openstack组件之间通过REST调用,组件内通过RPC协议通信,RPC协议又是基于AMQP模型实现的,rabbit mq就是运用该模型的一款软件. 二.概述 以现实中的PC举例来说明openstack创建的VM,一个PC要能正

讲清楚说明白openstack中vm流量走向之1——集中式网络节点

一.背景介绍 openstack被广大公有云厂商所采用,对于公有云场景来讲Newtron组件所提供的网络功能,一直是较难理解的部分,本文详细介绍在openstack集中网络节点架构下,vm的南北向与东西向流量实现. 二.网络节点功能 由于openstack默认部署模式下,计算节点通过ml2插件实现二层互通,所有三层流量都要经过网络节点,如下图所示: 图中同一tenant下有2个不同子网,vm1/2和vm3/4分别属于不同的subnet,通过上图可以看出不同子网之间通信,以及未绑定fip的vm与公

VNC怎么和宿主机共享粘贴板

VNC怎么和宿主机共享粘贴板 假设目标主机是linux,终端主机是windows(就是在windows上使用VNC登陆linux) 在linux中执行vncconfig -nowin& 在linux选中文字后,无需其他按键,直接在windows中可以黏贴. 在windows中选中文字,Ctrl+C,在linux中按中键黏贴. 具体表现为: 在使用vncconfig &命令后,上面的VNC config出现后,就可以按照上面说的进行复制粘贴了. 原文地址:https://www.cnblog