vncserver和x0vncserver用法总计

通常vncserver :port 会调用到xvnc,这时系统会新建一个虚拟桌面通过vncserver分享出去。

vncserver的用法很简单:

 vncserver -h

usage: vncserver [:<number>] [-name <desktop-name>] [-depth <depth>]
[-geometry <width>x<height>]
[-pixelformat rgbNNN|bgrNNN]
[-fp <font-path>]
[-fg]
[-autokill]
[-noxstartup]
[-xstartup <file>]
<Xvnc-options>... vncserver -kill <X-display> vncserver -list

若需要通过脚本使用vncserver,可使用如下方法:

su - $vncuser <<EOF
vncserver -kill $vncport
vncserver $vncport
EOF

而和vncserver不同,x0vncserver则是分享当前物理屏幕(类似于克隆),若通过vncserver方式出现问题,则可采用此方法。

x0vncserver常见用法:

x0vncserver -h
TigerVNC Server version 1.10., built Nov :: Usage: x0vncserver [<parameters>]
x0vncserver --version Parameters can be turned on with -<param> or off with -<param>=
Parameters which take a value can be specified as -<param> <value>
Other valid forms are <param>=<value> -<param>=<value> --<param>=<value>
Parameter names are case-insensitive. The parameters are: Global Parameters:
UseIPv6 - Use IPv6 for incoming and outgoing connections. (default=)
UseIPv4 - Use IPv4 for incoming and outgoing connections. (default=)
ZlibLevel - Zlib compression level (default=-)
ImprovedHextile - Use improved compression algorithm for Hextile encoding
which achieves better compression ratios by the cost of
using more CPU time (default=)
pam_service - Alias for PAMService
PAMService - Service name for PAM password validation (default=vnc)
PlainUsers - Users permitted to access via Plain security type (including
TLSPlain, X509Plain etc.) (default=)
GnuTLSPriority - GnuTLS priority string that controls the TLS session’s
handshake algorithms (default=NORMAL)
QueryConnect - Prompt the local user to accept or reject incoming
connections. (default=)
AcceptSetDesktopSize - Accept set desktop size events from clients.
(default=)
SendCutText - Send clipboard changes to clients. (default=)
AcceptCutText - Accept clipboard updates from clients. (default=)
AcceptPointerEvents - Accept pointer press and release events from clients.
(default=)
AcceptKeyEvents - Accept key press and release events from clients.
(default=)
DisconnectClients - Disconnect existing clients if an incoming connection is
non-shared. If combined with NeverShared then new
connections will be refused while there is a client active
(default=)
NeverShared - Never treat incoming connections as shared, regardless of
the client-specified setting (default=)
AlwaysShared - Always treat incoming connections as shared, regardless of
the client-specified setting (default=)
Protocol3. - Always use protocol version 3.3 for backwards compatibility
with badly-behaved clients (default=)
FrameRate - The maximum number of updates per second sent to each client
(default=)
CompareFB - Perform pixel comparison on framebuffer to reduce
unnecessary updates (: never, : always, : auto)
(default=)
ClientWaitTimeMillis - The number of milliseconds to wait for a client which
is no longer responding (default=)
MaxIdleTime - Terminate after s seconds of user inactivity (default=)
MaxConnectionTime - Terminate when a client has been connected for s seconds
(default=)
MaxDisconnectionTime - Terminate when no client has been connected for s
seconds (default=)
IdleTimeout - The number of seconds after which an idle VNC connection
will be dropped (zero means no timeout) (default=)
MaxCutText - Maximum permitted length of an incoming clipboard update
(default=)
RemapKeys - Comma-separated list of incoming keysyms to remap. Mappings
are expressed as two hex values, prefixed by 0x, and
separated by -> (default=)
Blackl

1、首先通过vncpasswd新建一个vnc密码。

2、将物理桌面转发出去。

x0vncserver -rfbport  -display : -PasswordFile ~/.vnc/passwd

其中:

-rfbport 指定转发到哪个端口,默认为5900。

-display 指定转发哪个物理显示器(若存在多个显示器的情况下)。

-PasswordFile 指定密码文件

A VNC  server is already running as :xx

当提示这个错误时我们会习惯性想到端口被占用,我们执行vncserver -kill :xx即可,但有时候这种方法就不灵了。

明明提示已经没有这个进程了,当执行vncserver :xx时还是说端口已在使用。

并且执行lsof :59xx时并没有其他进程占用此端口。

真这么神奇?脑壳大。。。

但理智告诉我肯定是有原因的,于是我看看了vncserver这个命令其实是一个perl脚本(PS:我们可以在这里修改vnc的默认端口,比如从59xx改到39xx。)

看看了vncserver这个脚本顿时茅塞顿开。

除了默认的59xx端口,Xvnc进程还会用到60xx端口。

于是我马上看了看60xx端口的使用情况。

What?其他进程占用了这个端口。kill掉这个进程,重新执行vncserver :xx后成功启动vnc。

正常启动后我们可以看到Xvnc会同时用到两个端口,但对外连接的应该是那个非60xx端口。

至此问题得到解决。

tigervnc使用总结的更多相关文章

  1. CentOS 6.8 安装TigerVNC 实现 Linux 远程桌面

    CentOS 6.8 有默认的安装的 vnc 位于端口 5900 : 系统->首选项->远程桌面 勾选[共享]的选项,  取消勾选[安全]的选项, 然后防火墙添加 5900 端口 基本就可 ...

  2. ubuntu 安装tigervnc

    root@iZ25q0jd99eZ:~# apt-get install tigervnc Reading package lists... Done Building dependency tree ...

  3. 用windows远程连接linux桌面(使用tightvnc或者tigervnc)

    一.安装tightvnc: tightvnc的安装在安装包中有详细的说明(README文件) 首先你要确保linux已经安装jpeg和zlib库, 2.编译 执行如下两个命令: [root@local ...

  4. windows远程连接linux桌面---使用tightvnc或者tigervnc

    一.安装tightvnc: tightvnc的安装在安装包中有详细的说明(README文件) 首先你要确保linux已经安装jpeg和zlib库, 2.编译 执行如下两个命令: [root@local ...

  5. RHEL7安装配置TigerVNC

    TigerVNC使用非加密的链接,默认会被firewalld blocked 掉,想要 vnc正常工作就需要让firewalld开放相应的端口才行. vnc默认的端口号为5900,而每个vnc win ...

  6. tigerVNC远程桌面,跨内网

    tigerVNC的简单使用教程(CentOS的远程桌面连接) 1.环境和软件准备 (1) CentOS 6.5下 [root@localhost ~]$ yum install tigervnc (2 ...

  7. PCanywhere/teamviewer/RDP/ultraVNC/tigerVNC/realVNC/Xmanager

    PCanywhere/teamviewer/RDP/ultraVNC/tigerVNC/realVNC/Xmanager 1, 通常应用场景一般CentOS/RHEL等linux系统不配置安装Desk ...

  8. tigervnc*

    yum install -y tigervnc* tigervnc-server vncserver www.webmin.cn http://blog.sina.com.cn/s/blog_4ba5 ...

  9. CentOS 6.8 安装TigerVNC 实现 Linux 远程桌面并安装火狐浏览器

    CentOS 6.8 安装TigerVNC 实现 Linux 远程桌面并安装火狐浏览器 vnc客户端地址:https://files.cnblogs.com/files/MYSQLZOUQI/vnc- ...

  10. 放弃 Tightvnc, 选择 Tigervnc

    构建headless vnc server ,我终于放弃了Tightvnc 基于以下原因: 1) 已知的Qt5的键盘映射问题,导致virtualbox 的使用出现困难 https://unix.sta ...

随机推荐

  1. C++走向远洋——57(项目二2、动物这样叫、抽象类)

    */ * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名:text.cpp * 作者:常轩 * 微信公众号:Worldhe ...

  2. C++走向远洋——46(教师兼干部类、多重继承、派生)

    */ * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名:text.cpp * 作者:常轩 * 微信公众号:Worldhe ...

  3. Java树结构

    今天在项目中,运用到了Java树结构,是在一个查询中,选择树结构例如图片 该结构采用了前段的最新的知识,通过xml结构的数据库,后端Spring的映射实现的. 代码示例: 数据库: <!-- 取 ...

  4. 一份简明的 Base64 原理解析

    书接上回,在 记一个 Base64 有关的 Bug 一文里,我们说到了 Base64 的编解码器有不同实现,交叉使用它们可能引发的问题等等. 这一回,我们来对 Base64 这一常用编解码技术的原理一 ...

  5. jinja2的url_for 和数据块

    1.静态文件引入:{{ url_for('static', filename='文件路径') }}   2.定义路由:{{ url_for('模块名.视图名',变量=参数) }}   3.定义数据块: ...

  6. ubuntu下pip的安装,更新及卸载

    在Ubuntu下,不小心uninstall pip了,然后呢,作为小白的我,还是有些着急的,用了一些方法不好使,最后找到了这个方法: 1.安装pip3: sudo apt-get install py ...

  7. 【5min+】AspNet Core中的全局异常处理

    系列介绍 [五分钟的dotnet]是一个利用您的碎片化时间来学习和丰富.net知识的博文系列.它所包含了.net体系中可能会涉及到的方方面面,比如C#的小细节,AspnetCore,微服务中的.net ...

  8. linux 安装Mosquitto

    这篇博客讲的很好:https://www.cnblogs.com/chen1-kerr/p/7258487.html 此处简单摘抄部分内容 1.下载mosquitto安装包 源码地址:http://m ...

  9. RabbitMQ 消息模式

    消息模式实例 视频教程:https://ke.qq.com/course/304104 编写代码前,最好先添加好用户并设置virtual hosts 一.简单模式 1.导入jar包 <depen ...

  10. SpringBoot入门系列(五)Thymeleaf的常用标签和用法

    前面介绍了Spring Boot 中的整合Thymeleaf .不清楚的朋友可以看看之前的文章:https://www.cnblogs.com/zhangweizhong/category/16577 ...