【问题标题】:VNC Mac OS X and Linux connection refused by computer [closed]VNC Mac OS X和Linux连接被计算机拒绝[关闭]
【发布时间】:2017-06-09 13:28:46
【问题描述】:

我在 MacOS X 和 Linux 之间使用 VNC 时遇到问题。

我在 CentOS Linux 上安装了tightvnc 服务器,在 Mac OS X 上安装了 vncviewer。我已经尽我所能完成了所有设置,然后在 Linux 计算机上启动了 vncserver。我也打开了5901端口。

当我在 Linux 机器上执行命令“vncviewer :1”时,一切正常。我可以看到桌面出现在一个窗口中。

从 Mac OS X 我无法连接到 Linux vncserver。我得到的信息是 “计算机拒绝连接”

我可以通过 SSH 从 Mac 连接到 Linux,因此两台计算机之间存在连接,但 VNC 无法工作。

谁能帮我解决这个问题。我在网上搜索过,但到目前为止没有发现任何有用的东西。 谢谢!

这是来自 vnc 日志文件的消息。

Xvnc TigerVNC 1.1.0 - built May 11 2016 13:01:55
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11704000, The X.Org Foundation


Tue Jan 24 10:03:36 2017
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5901
 vncext:      Listening for HTTP connections on all interface(s), port 5801
 vncext:      created VNC server for screen 0
GNOME_KEYRING_SOCKET=/tmp/keyring-jWrQoB/socket
SSH_AUTH_SOCK=/tmp/keyring-jWrQoB/socket.ssh
GNOME_KEYRING_PID=7644
gnome-session[7629]: WARNING: Could not launch application 'linc-cleanup-sockets.desktop': Unable to start application: Failed to execute
 child process "/usr/bin/linc-cleanup-sockets" (No such file or directory)
Failed to play sound: File or data not found

(polkit-gnome-authentication-agent-1:7668): GLib-GObject-WARNING **: cannot register existing type `_PolkitError'

(polkit-gnome-authentication-agent-1:7668): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
An instance of nm-applet is already running.
Dropbox isn't running!
Dropbox is already running!
Initializing nautilus-dropbox 2015.10.28
(null):  Warning no default label for /home/amit/.gvfs
Failure: Module initalization failed

** (gnome-panel:7657): WARNING **: panel-applet-frame.c:1288: failed to load applet OAFIID:GnoteApplet:
(null)

【问题讨论】:

标签: linux macos vnc vnc-server vnc-viewer


【解决方案1】:

您可以使用本地端口转发通过 SSH 隧道连接 VNC。

启动端口转发:

ssh -NTf -L 5901:localhost:5901 user@linux_server

然后将您的 VNC 查看器指向 localhost。

vncviewer localhost:5901

【讨论】:

  • 对于这个答案的反对者:我该如何改进它?
  • 我想说的是,即使您提供了替代解决方案,您的回答也不能回答所提出的问题。
  • 如果您有更好的解决方案,请告诉我。
  • 只是你的方法提供了另一种方法来建立到vnc服务器主机的路由,但是仍然没有解决主机拒绝连接的问题。在我的特定情况下,无论我是直接通过 LAN 连接还是通过 SSH 隧道(通过我的 LAN)连接,我都会收到与 OP 相同的错误。我没有投反对票,但您特别要求就为什么有人可能投反对票提供反馈。
  • 很公平,感谢您的解释。我不确定 CentOS 机器是否也是如此,但在 Fedora 上,我看到那里运行了一个 firewalld 守护程序(所以不仅仅是 netfilter/iptables)。默认情况下,它会阻止传入流量。也许这值得研究,但我不能肯定 - 我自己不再使用 CentOS。
猜你喜欢
  • 2013-02-22
  • 1970-01-01
  • 2018-08-06
  • 2016-06-03
  • 2013-11-18
  • 1970-01-01
  • 2012-06-03
  • 2016-08-18
  • 1970-01-01
相关资源
最近更新 更多