![通过 VNC 和 vino-server 访问 Ubuntu 远程主机时出现黑屏](https://linux22.com/image/1102553/%E9%80%9A%E8%BF%87%20VNC%20%E5%92%8C%20vino-server%20%E8%AE%BF%E9%97%AE%20Ubuntu%20%E8%BF%9C%E7%A8%8B%E4%B8%BB%E6%9C%BA%E6%97%B6%E5%87%BA%E7%8E%B0%E9%BB%91%E5%B1%8F.png)
我有一台无头服务器,我正在尝试设置 VNC 连接以便使用 GUI 访问它。现在我只能通过 ssh 获得 root 访问权限。
我已遵循这里给出的大部分说明从命令行启用远程 VNC?。在解决了很多问题之后,我终于可以运行 vino-server 了,但是当我连接 VNC 客户端时,屏幕却变黑了。
到目前为止,我安装了 vino 和 ubuntu-desktop。之后我执行了以下命令:
gconftool-2 --set --type=bool /desktop/gnome/remote_access/enabled true
gsettings set org.gnome.Vino erequire-encryption false
gsettings set org.gnome.Vino lock-screen-on-disconnect false
我vino-preferences
点击了允许查看和控制桌面。还取消了确认传入连接的勾选。
我运行 vino/usr/lib/vino/vino-server
并且这是输出:
(vino-server:8140): EggSMClient-CRITICAL **: egg_sm_client_set_mode: assertion 'global_client == NULL || global_client_mode == EGG_SM_CLIENT_MODE_DISABLED' failed
** (vino-server:8140): WARNING **: Your XServer does not support the XTest extension - remote desktop access will be view-only
25/06/2014 02:09:24 PM Autoprobing TCP port in (all) network interface
25/06/2014 02:09:24 PM Listening IPv6://[::]:5900
25/06/2014 02:09:24 PM Listening IPv4://0.0.0.0:5900
25/06/2014 02:09:24 PM Autoprobing selected port 5900
25/06/2014 02:09:24 PM Advertising security type: 'TLS' (18)
25/06/2014 02:09:24 PM Re-binding socket to listen for VNC connections on TCP port 5900 in (all) interface
25/06/2014 02:09:24 PM Listening IPv6://[::]:5900
25/06/2014 02:09:24 PM Listening IPv4://0.0.0.0:5900
25/06/2014 02:09:24 PM Clearing securityTypes
25/06/2014 02:09:24 PM Advertising security type: 'TLS' (18)
25/06/2014 02:09:24 PM Clearing securityTypes
25/06/2014 02:09:24 PM Advertising security type: 'TLS' (18)
25/06/2014 02:09:24 PM Advertising authentication type: 'No Authentication' (1)
25/06/2014 02:09:24 PM Re-binding socket to listen for VNC connections on TCP port 5900 in (all) interface
25/06/2014 02:09:24 PM Listening IPv6://[::]:5900
25/06/2014 02:09:24 PM Listening IPv4://0.0.0.0:5900
25/06/2014 02:09:24 PM Clearing securityTypes
25/06/2014 02:09:24 PM Clearing authTypes
25/06/2014 02:09:24 PM Advertising security type: 'TLS' (18)
25/06/2014 02:09:24 PM Advertising authentication type: 'No Authentication' (1)
25/06/2014 02:09:24 PM Advertising security type: 'No Authentication' (1)
在谷歌搜索了黑屏问题之后,我还安装了 gnome-core 并附加了 .vnc/Xstartup 文件,如下所示:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
gnome-session –session=gnome-classic &
gnome-panel&
[ -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 &