linux:RealVNC安装使用释疑

Applicable software

All the information in this Guide applies to connections established between a client computer running the latest version of VNC Viewer and a host computer licensed to use VNC Server (Enterprise). Unless otherwise stated, this combination is assumed. To see how to set these applications up, read Getting the computers ready to use.

Note that general principles of remote control, and information relating to particular supported features, also apply to connections established between any combination of the products and license types listed below.

VNC Server (with different licenses applied)

•  VNC Server (Personal)
Contains most RealVNC remote control features. A thirty day trial is available.

•  VNC Server (Free)
Contains basic remote control features.

For more information on licensing VNC Server, start with Licensing VNC Server.

VNC Viewer

•  VNC Viewer for Java
This application is freely available to download on demand from VNC Server (Enterprise) or VNC Server (Personal).

•  VNC Viewer Plus
This application is available to purchase from www.realvnc.com/products/viewerplus/.

•  VNC Viewer for iOS
This application is available to purchase from the Apple App Store. Visit www.realvnc.com/products/ios/ for more information.

•  VNC Viewer for Android
This application is available to purchase from Google Play. Visit www.realvnc.com/products/android/ for more information.


When a connection is established, VNC Viewer displays the host computer’s desktop in a new window on the client computer:

A.  Desktop of a client computer running Windows 7.   B.  VNC Viewer displaying the desktop of a host computer running Ubuntu 11.04 Linux.

Note: If the host computer is running UNIX/Linux, VNC Viewer may display a virtualdesktop instead, in which case what you see is not the desktop visible to a host computer user. For more information on this feature, see Running multiple instances of VNC Server.

Note that other VNC Viewer users may be connected to the host computer and controlling it at the same time as you. In addition, a host computer user may be present. Operations may occur unexpectedly!

Controlling the host computer using your mouse

Your client computer’s mouse is now shared with the host computer. This means that:

•  Moving the mouse and clicking within the VNC Viewer window affects the host computer and not the client.

•  Moving the mouse and clicking outside the VNC Viewer window, or on the VNC Viewer title bar or window buttons (MinimizeMaximize, and Close), affects the client computer and not the host.

Note: If your mouse has no effect on the host computer, it may have been disabled. For more information, see Restricting access to features.

If client and host computers have different numbers of mouse buttons, you can configure VNC Viewer to emulate those you do not have. See Configuring your mousefor more information.

Controlling the host computer using your keyboard

Your client computer’s keyboard is now shared with the host computer, with the exception of:

•  The function key that opens the shortcut menu (F8 by default).

•  The CTRL-ALT-DELETE key combination.

These commands are interpreted by the client computer. Alternative ways of sending them to the host computer are available; start with Using the shortcut menu for more information. Under Windows, note you can choose for certain other keys or key combinations to be interpreted by your client computer rather than the host. SeeConfiguring your keyboard for more information.

Note: If your keyboard has no effect on the host computer, it may have been disabled. For more information, see Restricting access to features.

Note it is possible for client and host computers to have different types of keyboard. Not all the keys available to a host computer user may be available to you, and some keys with the same name may have different behavior. This is especially likely if you are connecting to Mac OS X from Windows or Linux with a PC keyboard, or vice versa; see www.realvnc.com/products/vnc/documentation/latest/misc/keyboard-mapping/.

Interacting with VNC Server

When you connect, a VNC Server icon  is displayed on the host computer’s desktop, shaded black:

(Windows 7 client computer; Ubuntu 11.10 Linux host)

The VNC Server icon confirms that VNC Server is running on the host computer, provides information to help VNC Viewer users connect, confirms that at least oneVNC Viewer user is connected (the icon changes color), and has a shortcut menu to perform useful operations. All this information and functionality is available to you as a connected user. For more information, see Working with VNC Server.

Note: Under UNIX/Linux, in some circumstances, the VNC Server icon is not shaded black. Under some versions, no VNC Server icon can be displayed. In the latter scenario, shortcut menu commands are available from the More button on the VNC Server dialog.

Note that the VNC Server icon also provides access to VNC Server options. However, you cannot configure VNC Server in Service Mode unless you know the credentials of a user with administrative privileges on the host computer (or are logged in as one). For more information, see Using the VNC Server - Options dialog.


VNC(Virtual Network Computing) 是一款开源的远程控制软件,管理员通过它不仅可以在运行程序的本地机上察看桌面环境,而且可以从 Internet 上的任何地方察看远程机器的运行情况。而且它还不受操作系统平台限制,具有跨平台的特性。可以从 linux 上用 VNC 查看 Windows 系统的机器,也可以在 Windows 系统上利用 VNC 查看 linux 系统的机器。可以上 RealVNC 的官方网站下载 VNC 的安装文件,RealVNC 分为免费版、专业版和企业版,其中专业版和企业版都是要收费的,免费版可以免费使用。不过功能相对于来说会比专业版和企业版少一点,不过对于一般的管理要求,还是可以胜任的。

安装VNC

Tarball 安装方式:
[root @ test root] # tar xvfz vnc-4_1_2-x86_linux.tar.gz
[root @ test root] # cd vnc-4_1_2-x86_linux
[root @ test vnc-4_1_2-x86_linux] # ./vncinstall /usr/local/bin
[root @ test vnc-4_1_2-x86_linux] # cp vnc.so /usr/X11R6/lib/modules/extensions/

RPM 安装方式:
[root @ test root] # rpm –ivh vnc-4_1_2-x86_linux.rpm

启动 vncserver
[root @ test vnc-4_1_2-x86_linux] # vncserver
Your will require a password to access your desktop.
Passwd: 输入密码
Verify: 再次输入密码确认
New ‘test:1’ desktop is test:1
# test:1 test是主机名,:1 是登录VNC 的窗口号。
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/test:1.log

第一次执行 vncserver 时需要设定提供远程连入时的访问密码,密码会记录在 /root/.vnc/passwd 文件中,日后可执行 vncpasswd 更改密码。

现在就可以通过 vncviewer 连入操作

[root @ test vnc-4_1_2-x86_linux] # vncviewer 192.168.98.32:1

会弹出一个对话框,要求输入访问密码,输入密码后,即可连接成功。

VNCServer 的X 桌面默认为 twm, 这时连接进去只能看到终端界面,而看不到远程桌面界面。可修改 /root/.vnc/xstartup 文件,将其改为 GNOME 或 KDE 桌面:

GNOME:
[root @ test vnc-4_1_2-x86_linux] # vi /root/.vnc/xstartup
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot –solid grey
vncconfig –iconic &
xterm –geometry 80x24+10+10 –ls –title “$VNCDESKTOP Desktop” &
gnome-session &

KDE:
[root @ test vnc-4_1_2-x86_linux] # vi /root/.vnc/xstartup
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot –solid grey
vncconfig –iconic &
xterm –geometry 80x24+10+10 –ls –title “$VNCDESKTOP Desktop” &
startkde &

修改完毕后须重新启动 VNCServer
[root @ test vnc-4_1_2-x86_linux] # vncserver –kill :1 && vncserver :1
[root @ test vnc-4_1_2-x86_linux] # vncviewer 192.168.98.32:1

连接后即可使用 GNOME 或 KDE 桌面啦(就像 WinXP 的远程桌面一般),也可以通过 WEB 访问,在浏览器中输入http://192.168.0.252:5801 即可,VNC 默认的端口号为5801。

用 netstat –tlunp | grep 01,可以查看VNC 的端口是否牌监听状态,如看到5801 ,则表示 VNC 端口已正常启动。


遇到错误:

realvnc connect:connection refused(10061)

10061 means that the server computer was contactable, but not accepting
connections on the port you were trying to connect to.  This might be
because VNC Server 4 was not running, or because it couldn't open the
required port.

Given that you are running 3.3.3R3 alongside 4, I'd guess that you started 4
after you started 3.3.3R3 and that you haven't told 4 to run on a different
port number yet - in that case it will try to open the same port as 3.3.3R3,
fail, and not try to re-open that port until it is restarted or a setting is
changed.

A few things...

I assume that since you built it, the XP firewall was opened for the
incoming port (5900 as default)...

However, the port could be blocked by:

a) Any router/switch the XP host is attached to
b) The Hughes 'modem' does not allow incoming IP connections
c) Hughes itself is blocking it before the signal is being set to the sky

Remember Hughes is very different than DSL/Cable/Fiber connections...

If you didn't import your VNC 3.3.7 settings using the Import Legacy
Settings option then you might have found VNC Server 4.1.1 running on port
5900, but not port 8500, which is not a standard RFB port.

The problem you were having with VNC 3.3.7 suggests that your VNC 3.3
Default settings had got out of sync with the per-user settings.

You are attempting to connect to the VNC server computer directly, rather
than via the SSH tunnel port on the viewer machine.  i.e. on the viewer
machine, enter localhost:2 in the Server field.


原文地址:https://www.cnblogs.com/wuyida/p/6300997.html