使用VNC连接Ubuntu

4
我需要从另一台Ubuntu PC和Windows PC远程连接到一个Ubuntu PC(需要查看UI)。我知道我们可以使用VNC来实现。有人能否给我解释一下步骤或者提供一个具有说明的适当链接。
我按照以下步骤操作: 在我需要进行远程访问的Ubuntu机器上安装了VNC服务器。 我按照下面链接中的说明进行操作。

http://www.ubuntu-unleashed.com/2007/10/setup-vnc-server-for-ubuntu-gutsy.html

当我执行第四步时:
x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800

我得到
20/12/2012 02:12:02 passing arg to libvncserver: -httpport

20/12/2012 02:12:02 passing arg to libvncserver: 5801

20/12/2012 02:12:02 -usepw: found /home/sjayara5/.vnc/passwd

20/12/2012 02:12:02 x11vnc version: 0.9.12 lastmod: 2010-09-09  pid: 4821

20/12/2012 02:12:02 XOpenDisplay("") failed.

20/12/2012 02:12:02 Trying again with XAUTHLOCALHOSTNAME=localhost ...

20/12/2012 02:12:02 

20/12/2012 02:12:02 *** XOpenDisplay failed. No -display or DISPLAY.

20/12/2012 02:12:02 *** Trying ":0" in 4 seconds.  Press Ctrl-C to abort.

20/12/2012 02:12:02 *** 1 2 3 4 

20/12/2012 02:12:06 XOpenDisplay(":0") failed.

20/12/2012 02:12:06 Trying again with XAUTHLOCALHOSTNAME=localhost ...

20/12/2012 02:12:06 XOpenDisplay(":0") failed.

20/12/2012 02:12:06 Trying again with unset XAUTHLOCALHOSTNAME ...

20/12/2012 02:12:06 



20/12/2012 02:12:06 ***************************************

20/12/2012 02:12:06 *** XOpenDisplay failed (:0)



*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.

*** There may be "Xlib:" error messages above with details about the failure.

一些提示和指南:

谢谢

1个回答

3

请阅读您的错误信息!它似乎非常明显,您正在运行来自SSH会话或类似会话的命令,因为DISPLAY没有设置。将其设置为正确的值(检查/tmp中的X11套接字;您可能需要“:0”)。

DISPLAY=":0"; export DISPLAY

您还需要设置XAUTHORITY以便x11vnc可以连接! 这是与此问题重复的一个问题。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接