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. 如何把.a转化为framework

    在Xcode中,framework比分散的.a和.h文件用起来方便的多.然而,只要你一找如何制作framework,多半你就会放弃,“怎么这么麻烦?!” 尤其是当已经有现成的.a和.h时,你就会更不能 ...

  2. elasticsearch 高级查询

    高级查询 子条件查询 (特定字段查询所指特定值) 复合条件查询 (以一定的逻辑组合子条件查询) 一.子条件查询 子条件查询分为 query context.filter context 1.query ...

  3. linux 安装Mosquitto

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

  4. 用vue-cli进行npm run dev时候Cannot GET/

    在用vue cli进行项目npm run dev 时候,页面Cannot GET/ 主要是把config/index.js里面的dev:{assetsPublicPath:'/'}改成了跟build里 ...

  5. django 验证码图片生成视图函数

    def verify_code(request): import random # 定义验证码图片背景颜色 宽和高 bgcolor = (random.randrange(20,180),random ...

  6. Effective Go中文版(更新中)

    原文链接:https://golang.org/doc/effective_go.html Introduction Go是一种新兴的编程语言.虽然它借鉴了现有语言的思想,但它具有不同寻常的特性,使得 ...

  7. [android]从书中编码方式,看编程思想

    <Android权威编程指南第3版>今天学习到第10章,感叹经验丰富的编程理念——解耦合. 编程理念肯定是尽可能解除耦合,让代码可以复用,书中多次提到关于参数传递的解耦,这又出现一次. 本 ...

  8. Vue2.0 【第一季】第2节 v-if v-else v-show 指令

    目录 Vue2.0 [第一季]第2节 v-if v-else v-show 指令 第二节 v-if v-else v-show 指令 2.1 v-if指令.v-else指令: 2.2 v-show的使 ...

  9. C++ 动态创建链表

    #define _CRT_SECURE_NO_WARNINGS #include <iostream> struct Node { int data; Node* next; }; Nod ...

  10. [vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives.

    使用VScode开发vue中,v-for在Eslint的规则检查下出现报错:如下Elements in iteration expect to have ‘v-bind:key’ directives ...