tigervnc使用总结

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.80, built Nov 28 2019 19:49:15

Usage: x0vncserver [<parameters>]
       x0vncserver --version

Parameters can be turned on with -<param> or off with -<param>=0
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=1)
  UseIPv4        - Use IPv4 for incoming and outgoing connections. (default=1)
  ZlibLevel      - Zlib compression level (default=-1)
  ImprovedHextile - Use improved compression algorithm for Hextile encoding
                   which achieves better compression ratios by the cost of
                   using more CPU time (default=1)
  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=0)
  AcceptSetDesktopSize - Accept set desktop size events from clients.
                   (default=1)
  SendCutText    - Send clipboard changes to clients. (default=1)
  AcceptCutText  - Accept clipboard updates from clients. (default=1)
  AcceptPointerEvents - Accept pointer press and release events from clients.
                   (default=1)
  AcceptKeyEvents - Accept key press and release events from clients.
                   (default=1)
  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=1)
  NeverShared    - Never treat incoming connections as shared, regardless of
                   the client-specified setting (default=0)
  AlwaysShared   - Always treat incoming connections as shared, regardless of
                   the client-specified setting (default=0)
  Protocol3.3    - Always use protocol version 3.3 for backwards compatibility
                   with badly-behaved clients (default=0)
  FrameRate      - The maximum number of updates per second sent to each client
                   (default=60)
  CompareFB      - Perform pixel comparison on framebuffer to reduce
                   unnecessary updates (0: never, 1: always, 2: auto)
                   (default=2)
  ClientWaitTimeMillis - The number of milliseconds to wait for a client which
                   is no longer responding (default=20000)
  MaxIdleTime    - Terminate after s seconds of user inactivity (default=0)
  MaxConnectionTime - Terminate when a client has been connected for s seconds
                   (default=0)
  MaxDisconnectionTime - Terminate when no client has been connected for s
                   seconds (default=0)
  IdleTimeout    - The number of seconds after which an idle VNC connection
                   will be dropped (zero means no timeout) (default=0)
  MaxCutText     - Maximum permitted length of an incoming clipboard update
                   (default=262144)
  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 5901 -display :0 -PasswordFile ~/.vnc/passwd

其中:

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

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

扫描二维码关注公众号,回复: 8144765 查看本文章

-PasswordFile 指定密码文件

猜你喜欢

转载自www.cnblogs.com/oboth-zl/p/12018289.html