为什么 VNC 在 14.04 桌面中损坏了以及如何修复它?

为什么 VNC 在 14.04 桌面中损坏了以及如何修复它?

我不认为自己是个白痴,但显然我是个白痴。所以请帮助这个白痴。我有一个全新的 Ubuntu 14.04.1 LTS 安装,在 vmware 上运行。我希望从 Windows 7 计算机访问它。听起来很简单,所以我去了终端并运行 vncserver,它要求我设置密码,然后似乎正在运行。

然后,我在 Windows 7 计算机上安装了 UltraVNC(仅限 Viewer),然后尝试连接。输入密码后(这向我确认我可以访问计算机),我只看到一个空白屏幕。经过多次 Google 搜索,这似乎是正常的响应。我研究了许多 Google 文章,其中大部分都涉及某种形式的魔法咒语,但我无法让它起作用。

vncserver 日志文件抱怨“打开安全策略文件 /etc/X11/xserver/SecurityPolicy 时出错”,随后出现一堆消息“无法初始化字体路径元素....”

之后,它显示看似有效的连接或断开连接,但我无法在屏幕上显示任何东西。当然,这应该可以直接使用。

我决定从 Ubuntu 计算机添加到这个帖子,以便我可以添加,这样我就可以使用剪切和粘贴添加日志和 xstartup 文件。

     Sun Feb 22 17:42:13 2015
      vncext:      VNC extension running!
      vncext:      Listening for VNC connections on port 5901
      vncext:      created VNC server for screen 0
     error opening security policy file /etc/X11/xserver/SecurityPolicy
     Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
     Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
     Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
     Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
     Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!
     Could not init font path element /usr/share/fonts/X11/75dpi/, removing from list!
     Could not init font path element /usr/share/fonts/X11/100dpi/, removing from list!

     Sun Feb 22 17:42:42 2015
      Connections: accepted: 0.0.0.0::54270
      SConnection: Client needs protocol version 3.8
      SConnection: Client requests security type VncAuth(2)

     Sun Feb 22 17:42:49 2015
      SConnection: AuthFailureException: Authentication failure
      Connections: closed: 0.0.0.0::54270 (Authentication failure)

     Sun Feb 22 17:43:21 2015
      Connections: accepted: 0.0.0.0::54281
      SConnection: Client needs protocol version 3.8
      SConnection: Client requests security type VncAuth(2)

     Sun Feb 22 17:43:28 2015
      VNCSConnST:  Server default pixel format depth 16 (16bpp) little-endian rgb565
      VNCSConnST:  Client pixel format depth 16 (16bpp) little-endian rgb565

     Sun Feb 22 17:43:41 2015
      Connections: closed: 0.0.0.0::54281 (Clean disconnection)
      SMsgWriter:  framebuffer updates 3
      SMsgWriter:    ZRLE rects 4, bytes 1380
      SMsgWriter:    raw bytes equivalent 3146800, compression ratio 2280.289855

     #!/bin/sh

     # Uncomment the following two lines for normal desktop:
     unset SESSION_MANAGER
     exec sh /etc/X11/xinit/xinitrc

     [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
     [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
     #xsetroot -solid grey
     #vncconfig -iconic &
     #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
     startx &

答案1

在steeldriver的帮助下,解决方案非常简单。忘记vncserver,而是搜索“桌面共享”。回答问题,然后使用VNC连接到端口5900或:0。根据您的客户端,可能需要禁用加密。这可以从终端使用以下命令完成:

    gsettings set org.gnome.Vino require-encryption 'false'

相关内容