我使用了这一页和这个使用远程桌面连接到 Amazon EC2 ubuntu 实例。但我总是得到如下图所示的灰色背景:
~/.vnc 中的日志文件:
21/12/14 04:20:23 Got connection from client 127.0.0.1
21/12/14 04:20:23 Using protocol version 3.8
21/12/14 04:20:23 Full-control authentication passed by 127.0.0.1
21/12/14 04:20:23 Pixel format for client 127.0.0.1:
21/12/14 04 20:23 8 bpp, depth s
21/12/14 04:20:23 true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
21/12/14 04:20:23 Using tight encoding for client 127.0.0.1
21/12/14 04:20:23 rfbProcessClientNormalMessage: ignoring unknown encoding 16
21/12/14 04:20:23 rfbProcessClientNormalMessage: ignoring unknown encoding 9
21/12/14 04:20:23 rfbProcessClientNormalMessage: ignoring unknown encoding -65527
21/12/14 04:20:23 Using compression level 9 for client 127.0.0.1
21/12/14 04:20:23 Using image quality level 0 for client 127.0.0.1
21/12/14 04:20:23 Enabling X-style cursor updates for client 127.0.0.1
21/12/14 04:20:23 Enabling cursor position updates for client 127.0.0.1
21/12/14 04:20:23 rfbProcessClientNormalMessage: ignoring unknown encoding -131072
21/12/14 04:20:23 rfbProcessClientNormalMessage: ignoring unknown encoding -223
21/12/14 04:20:23 Enabling LastRect protocol extension for client 127.0.0.1
21/12/14 04:20:23 rfbProcessClientNormalMessage: ignoring unknown encoding -131071
21/12/14 04:20:23 rfbProcessClientNormalMessage: ignoring unknown encoding -131070
21/12/14 04:20:23 rfbProcessClientNormalMessage: ignoring unknown encoding -131069
21/12/14 04:20:38 KbdAddEvent: unknown KeySym 0xff15 - allocating KeyCode 89
.vnc/xstartup 的内容为:
#!/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" &
gnome-session &
日志文件的内容为:
22/12/14 15:33:42 Xvnc version TightVNC-1.3.9
22/12/14 15:33:42 Copyright (C) 2000-2007 TightVNC Group
22/12/14 15:33:42 Copyright (C) 1999 AT&T Laboratories Cambridge
22/12/14 15:33:42 All Rights Reserved.
22/12/14 15:33:42 See http://www.tightvnc.com/ for information on TightVNC
22/12/14 15:33:42 Desktop name 'X' (ip-172-31-21-231:1)
22/12/14 15:33:42 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
22/12/14 15:33:42 Listening for VNC connections on TCP port 5901
Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
No VNC extension on display :1
Option "--login" is no longer supported in this version of gnome-terminal; you might want to create a profile with the desired setting, and use the new '--profile' option
gnome-session-is-accelerated: No composite extension.
gnome-session-check-accelerated: Helper exited with code 256
(gnome-terminal:3848): GLib-GIO-CRITICAL **: g_settings_get: the format string may not contain '&' (key 'monospace-font-name' from schema 'org.gnome.desktop.interface'). This call will probably stop working with a future version of glib.
gnome-session-is-accelerated: No composite extension.
gnome-session-check-accelerated: Helper exited with code 256
** (process:3849): WARNING **: software acceleration check failed: Child process exited with code 1
** (gnome-session:3849): CRITICAL **: We failed, but the fail whale is dead. Sorry....
22/12/14 15:33:53 Got connection from client *.*.5.179
22/12/14 15:33:54 Using protocol version 3.8
22/12/14 15:33:54 Enabling TightVNC protocol extensions
22/12/14 15:33:56 Full-control authentication passed by *.*.5.179
22/12/14 15:33:56 Using tight encoding for client *.*.5.179
22/12/14 15:33:56 rfbProcessClientNormalMessage: ignoring unknown encoding 16
22/12/14 15:33:56 rfbProcessClientNormalMessage: ignoring unknown encoding -223
22/12/14 15:33:56 Enabling LastRect protocol extension for client *.*.5.179
22/12/14 15:33:56 Enabling cursor position updates for client *.*.5.179
22/12/14 15:33:56 Enabling full-color cursor updates for client *.*.5.179
从日志文件中我们可以看到有一个错误“CRITICAL **: We failed, but the fail whale is dead. Sorry....”。我想知道这是否是 unity 无法出现的原因。
有人能帮我解决这个问题吗?
后续行动:我按照本文,但是屏幕现在变成了此图所示的状态:tinypic.com/r/2mnm4vm/8——没有统一桌面。
答案1
似乎您需要编辑 xstartup 文件(位于 .vnc 文件夹中)。此链接应该可以让您了解需要编辑的内容...如果不行,只需发布您已有的内容,我们将从那里开始。
好的,让我们尝试修改您的 xstartup 文件以匹配我的文件,然后,如果您在连接时遇到问题,我们会看看。这是来自一个工作文件(刚从我的文件服务器中提取,虽然它是一个 Mint 盒子,但它应该适合您)。
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#sh /etc/X11/xinit/xinitrcxrdb $HOME/.Xresources
#xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
#/etc/X11/Xsession
#exec /usr/bin/gnome-session --session=gnome-classic &
gnome-session --session=gnome-fallback &
备用方案是为了防止 gnome 崩溃(这很重要),因为它经常崩溃(在我的世界中)。我安装了 TightVNC 和 xRDP(这样我就可以从 Windows 或 Linux 进行 RDP 连接)。
(趣味操作截图): https://i.stack.imgur.com/UbAIu.png