我有 Ubuntu 服务器 (18.04),我想使用 VNC 对其进行可视化,我设法安装了ubuntu-desktop
和tigervncserver
,但未能可视化。我使用了从互联网上找到的几种方法,但也失败了。然后我尝试安装lubuntu-desktop
,但也失败了。这是我的日志:
user@as0018:~/.vnc$ cat /home/user/.vnc/as0018:1.log
22/06/20 10:23:32 Xvnc version TightVNC-1.3.10
22/06/20 10:23:32 Copyright (C) 2000-2009 TightVNC Group
22/06/20 10:23:32 Copyright (C) 1999 AT&T Laboratories Cambridge
22/06/20 10:23:32 All Rights Reserved.
22/06/20 10:23:32 See http://www.tightvnc.com/ for information on TightVNC
22/06/20 10:23:32 Desktop name 'X' (as0018:1)
22/06/20 10:23:32 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
22/06/20 10:23:32 Listening for VNC connections on TCP port 5901
Error: XKB extension not present on :1
Exiting
XKB extension not present on :1
Starting session: /etc/X11/Xsession
Session terminated with return code 1
22/06/20 10:23:36 Got connection from client 192.168.10.14
22/06/20 10:23:36 Using protocol version 3.8
22/06/20 10:23:44 Full-control authentication passed by 192.168.10.14
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 24
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 16
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 22
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 21
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 15
22/06/20 10:23:44 Using zlib encoding for client 192.168.10.14
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding -314
22/06/20 10:23:44 Enabling full-color cursor updates for client 192.168.10.14
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding -223
22/06/20 10:23:44 Pixel format for client 192.168.10.14:
22/06/20 10:23:44 8 bpp, depth 6
22/06/20 10:23:44 true colour: max r 3 g 3 b 3, shift r 4 g 2 b 0
22/06/20 10:23:44 Using raw encoding for client 192.168.10.14
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 24
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 22
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 21
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 16
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 15
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding -314
22/06/20 10:23:44 Enabling full-color cursor updates for client 192.168.10.14
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding -223
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 24
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 16
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 22
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 21
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding 15
22/06/20 10:23:44 Using zlib encoding for client 192.168.10.14
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding -314
22/06/20 10:23:44 Enabling full-color cursor updates for client 192.168.10.14
22/06/20 10:23:44 rfbProcessClientNormalMessage: ignoring unknown encoding -223
22/06/20 10:23:44 Pixel format for client 192.168.10.14:
22/06/20 10:23:44 32 bpp, depth 24, little endian
22/06/20 10:23:44 true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
22/06/20 10:23:44 no translation needed
我猜编码有问题?当我通过 VNC Viewer 连接时,它说连接不会被加密,输入密码后,它就变成灰屏。
答案1
看起来没有针对 gnome 的解决方案,所以我选择了 xfce4
$ sudo apt update
$ sudo apt install xfce4 xfce4-goodies
$ sudo apt install tightvncserver
$ vncserver
$ vncserver -kill :1
$ mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
$ nano ~/.vnc/xstartup
(paste the follow being in the xstartup file and write out)
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
$ sudo chmod +x ~/.vnc/xstartup
$ vncserver