VNC 灰屏(Ubuntu 16.04,TightVNC,Xfce4)

VNC 灰屏(Ubuntu 16.04,TightVNC,Xfce4)

我已经使用 VNC 很多年了,但我不知道为什么有时会发生这种情况。在一台新的 Ubuntu 16.04 机器上,我首先尝试使用 Vino。它运行良好,但我认为它相当慢,所以我决定使用带有 Xfce4 窗口管理器的 TightVNC。然而,我再次得到了这个“灰屏”(我以前遇到过几次..)。
我的xstartup是:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
startxfce4 &

日志文件是:

24/08/18 09:47:09 Xvnc version TightVNC-1.3.10
24/08/18 09:47:09 Copyright (C) 2000-2009 TightVNC Group
24/08/18 09:47:09 Copyright (C) 1999 AT&T Laboratories Cambridge
24/08/18 09:47:09 All Rights Reserved.
24/08/18 09:47:09 See http://www.tightvnc.com/ for information on TightVNC
24/08/18 09:47:09 Desktop name 'X' (kimchan:1)
24/08/18 09:47:09 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
24/08/18 09:47:09 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
/usr/bin/startxfce4: X server already running on display :1
Xlib:  extension "RANDR" missing on display ":1".
xfce4-session: Another session manager is already running

24/08/18 09:48:08 Got connection from client 129.254.132.39
24/08/18 09:48:08 Using protocol version 3.8
24/08/18 09:48:12 Full-control authentication passed by 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 16
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 22
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 21
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 15
24/08/18 09:48:12 Using zlib encoding for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -314
24/08/18 09:48:12 Enabling full-color cursor updates for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -223
24/08/18 09:48:12 Pixel format for client 129.254.132.39:
24/08/18 09:48:12   32 bpp, depth 24, little endian
24/08/18 09:48:12   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
24/08/18 09:48:12   no translation needed
24/08/18 09:48:12 Using raw encoding for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 22
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 21
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 16
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 15
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -314
24/08/18 09:48:12 Enabling full-color cursor updates for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -223
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 16
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 22
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 21
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding 15
24/08/18 09:48:12 Using zlib encoding for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -314
24/08/18 09:48:12 Enabling full-color cursor updates for client 129.254.132.39
24/08/18 09:48:12 rfbProcessClientNormalMessage: ignoring unknown encoding -223

这里出了什么问题?是X server already running on display :1错误吗?那怎么办?那么多消息"RANDR" missing on display:1又是什么?ignoring unknown encoding

答案1

我发现https://bbs.archlinux.org/viewtopic.php?id=180965

并将我的 xstartup 更改为

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

并且它有效!

答案2

Gnome 的工作配置

#!/bin/sh
#
# Config requires following packages:
# gnome-panel nautilus gnome-terminal metacity
#


export XKL_XMODMAP_DISABLE=1

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
    
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey

gnome-session &
gnome-panel &

metacity &
gnome-terminal &

答案3

根据其他赞同的答案,我简单说一下:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

在我的~/.vnc/xstartup文件中,我能够本地连接。此外,我必须编辑/etc/vnc/conf添加以下行:

$localhost = "no";

让我的私有网络上的其他机器连接到 tigervnc 服务器(而不是仅仅localhost客户端)。

答案4

还要确保你有‘dbus-x11’已安装

sudo apt-get install dbus-x11

根据软件包信息网:此软件包包含 dbus-launch 实用程序,它会自动为每个用户的每个 X11 显示器启动一个 D-Bus 会话总线。如果还安装了 dbus-user-session 软件包,则它优先于此软件包。

相关内容