vncserver 灰屏 ubuntu 16.04 LTS

vncserver 灰屏 ubuntu 16.04 LTS

您好。我在使用 ubuntu 16.04 LTS。这是一个亚马逊 EC2 实例,我在安装和启动 vncserver 时出现灰屏,我尝试了很多关于这个问题的建议,但仍然无法让它工作......谢谢你的帮助

在此处输入图片描述

我的日志文件:

Xvnc Free Edition 4.1.1 - built Feb 25 2015 23:02:21
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 40300000, The XFree86 Project, Inc
Tue Jul 19 03:03:37 2016
 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!
Tue Jul 19 03:03:44 2016
 Connections: accepted: 0.0.0.0::61550
 SConnection: Client needs protocol version 3.8
 SConnection: Client requests security type VncAuth(2)
Tue Jul 19 03:03:50 2016
 VNCSConnST:  Server default pixel format depth 16 (16bpp) little-endian rgb565
Tue Jul 19 03:03:51 2016
 VNCSConnST:  Client pixel format depth 8 (8bpp) colour-map

我的 xstartup

#!/bin/sh
# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /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 &

答案1

我在 Ubuntu 16.04 LTS (64 位) 上遇到了同样的问题。我将~/.vnc/xstartup文件更新为如下所示,对我来说成功了。

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /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" &
x-window-manager &

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &

参考:https://www.linode.com/docs/applications/remote-desktop/install-vnc-on-ubuntu-16-04

答案2

我也遇到了同样的问题。为了解决这个问题,我安装了:

$ sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

然后我将下面的几行添加到~/.vnc/xstartup

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &

答案3

在撰写本文时没有任何答案提到:还值得注意的是 xstartup 文件需要可执行:

chmod +x ~/.vnc/xstartup

如果不是,则无论文件内容如何,​​灰屏问题都会继续发生。

答案4

刚刚遇到了类似的问题并找到了解决方案,而我在过去几天尝试解决这个问题时阅读的任何文章中都没有看到过这个解决方案。

除了@Waqas的回答之外,我还必须确保我拥有主文件夹中的所有文件。显然,这是关于一些特定文件的,但我没有时间检查这一点

sudo chown user:user /home/user

只是认为它可能会帮助到某些人。

相关内容