我正在使用 Ubuntu 16.04.3 xenial。我正在尝试设置 VNC 远程会话以从我的笔记本电脑登录。VNC 服务器工作正常,我可以连接,但我看到的只是一个灰色屏幕。我使用 SSH 端口转发登录,然后启动 vncserver:
vncserver :7
我的 xstartup 文件是:
#!/bin/sh
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
xsetroot -solid "#DAB082"
x-terminal-emulator -geometry "80x24+10+10" -ls -title "$VNCDESKTOP Desktop" &
x-window-manager
就像我说的,我可以登录,但我看到的只是灰色屏幕。日志文件
is:20/08/17 14:53:54 Xvnc version TightVNC-1.3.10
20/08/17 14:53:54 Copyright (C) 2000-2009 TightVNC Group
20/08/17 14:53:54 Copyright (C) 1999 AT&T Laboratories Cambridge
20/08/17 14:53:54 All Rights Reserved.
20/08/17 14:53:54 See http://www.tightvnc.com/ for information on TightVNC
20/08/17 14:53:54 Desktop name 'X' (fiji:7)
20/08/17 14:53:54 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
20/08/17 14:53:54 Listening for VNC connections on TCP port 5907
Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
20/08/17 14:53:59 Got connection from client 127.0.0.1
20/08/17 14:53:59 Using protocol version 3.8
20/08/17 14:54:01 Full-control authentication passed by 127.0.0.1
20/08/17 14:54:01 rfbProcessClientNormalMessage: ignoring unknown encoding 15
20/08/17 14:54:01 Using hextile encoding for client 127.0.0.1
20/08/17 14:54:01 rfbProcessClientNormalMessage: ignoring unknown encoding 22
20/08/17 14:54:01 rfbProcessClientNormalMessage: ignoring unknown encoding 21
20/08/17 14:54:01 rfbProcessClientNormalMessage: ignoring unknown encoding 16
20/08/17 14:54:01 rfbProcessClientNormalMessage: ignoring unknown encoding -314
20/08/17 14:54:01 Enabling full-color cursor updates for client 127.0.0.1
20/08/17 14:54:01 rfbProcessClientNormalMessage: ignoring unknown encoding -223
20/08/17 14:54:01 Pixel format for client 127.0.0.1:
20/08/17 14:54:01 32 bpp, depth 24, little endian
20/08/17 14:54:01 true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
20/08/17 14:54:01 no translation needed
20/08/17 14:54:09 Client 127.0.0.1 gone
20/08/17 14:54:09 Statistics:
20/08/17 14:54:09 key events received 0, pointer events 96
20/08/17 14:54:09 framebuffer updates 1, rectangles 2, bytes 400448
20/08/17 14:54:09 cursor shape updates 1, bytes 1068
20/08/17 14:54:09 hextile rectangles 1, bytes 399380
20/08/17 14:54:09 raw bytes equivalent 3145740, compression ratio 7.876559
我没有看到任何错误。如果我通过此 xstartup 使用 xfce4,它可以正常工作:
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
#unity &
“unity &” 是我为了使用 unity 而不是 xfce4 而做出的努力。我不在乎使用 xfce4,只是由于 xkeyboard 问题,我在使用 notepadqq 时遇到了问题(请参阅这里)。请注意,xfce4 日志存在问题(例如,Xlib:显示缺少扩展 RANDR”,但它仍然有效。
我查看过许多事件。我尝试过 vnc4server。当我使用 systemd 版本时,Unity 确实可以工作,但我想通过 SSH 更安全地进行端口转发来“改进”情况。