我描述了我到底做了什么:
首先,我安装了 debian10-netinstall。
然后我通过“Tasksel”命令安装了 Gnome。
然后我用了这个教程用于安装vnc服务器。然后我通过此命令启动 vncserver tightvncserver -geometry 1024x720 :1
,以下是输出:
New 'X' desktop is debian:1
Starting applications specified in /home/parsa/.vnc/xstartup
Log file is /home/parsa/.vnc/debian:1.log
这是 ~/.vnc/debian:1.log :
parsa@debian:~$ tail -f .vnc/debian\:1.log
26/09/19 11:41:12 Xvnc version TightVNC-1.3.9
26/09/19 11:41:12 Copyright (C) 2000-2007 TightVNC Group
26/09/19 11:41:12 Copyright (C) 1999 AT&T Laboratories Cambridge
26/09/19 11:41:12 All Rights Reserved.
26/09/19 11:41:12 See http://www.tightvnc.com/ for information on TightVNC
26/09/19 11:41:12 Desktop name 'X' (debian:1)
26/09/19 11:41:12 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
26/09/19 11:41:12 Listening for VNC connections on TCP port 5901
# Failed to parse arguments: Unknown option --login
正如您在最后一行看到的,有一个错误。
我通过注释该文件中包含“--login”的行来解决这个问题:))/usr/bin/x-terminal-emulator
然后我重新启动了 vncserver :
parsa@debian:~$ tightvncserver -kill :1
Killing Xtightvnc process ID 910
parsa@debian:~$ tightvncserver -geometry 1024x720 :1
New 'X' desktop is debian:1
Starting applications specified in /home/parsa/.vnc/xstartup
Log file is /home/parsa/.vnc/debian:1.log
然后再次查看日志文件
tail -f .vnc/debian\:1.log
# watch_established: "/org/gnome/desktop/interface/" (establishing: 1)
# watch_established: "/org/gnome/settings-daemon/peripherals/mouse/" (establishing: 1)
# watch_established: "/org/gnome/desktop/sound/" (establishing: 1)
# watch_established: "/org/gnome/desktop/privacy/" (establishing: 1)
# watch_established: "/org/gnome/desktop/wm/preferences/" (establishing: 1)
# watch_established: "/org/gnome/settings-daemon/plugins/xsettings/" (establishing: 1)
# watch_established: "/org/gnome/desktop/a11y/" (establishing: 1)
# watch_fast: "/org/gnome/terminal/legacy/" (establishing: 0, active: 0)
# unwatch_fast: "/org/gnome/terminal/legacy/" (active: 0, establishing: 1)
# watch_established: "/org/gnome/terminal/legacy/" (establishing: 0)
现在错误已经消失,我连接到 vncserver ,这些行出现在日志中:
26/09/19 12:18:05 Got connection from client 192.168.1.131
26/09/19 12:18:05 Using protocol version 3.8
26/09/19 12:18:05 Full-control authentication passed by 192.168.1.131
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 24
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 16
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 22
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 21
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 15
26/09/19 12:18:05 Using zlib encoding for client 192.168.1.131
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding -314
26/09/19 12:18:05 Enabling full-color cursor updates for client 192.168.1.131
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding -223
26/09/19 12:18:05 Pixel format for client 192.168.1.131:
26/09/19 12:18:05 8 bpp, depth 6
26/09/19 12:18:05 true colour: max r 3 g 3 b 3, shift r 4 g 2 b 0
26/09/19 12:18:05 Using raw encoding for client 192.168.1.131
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 24
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 22
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 21
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 16
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 15
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding -314
26/09/19 12:18:05 Enabling full-color cursor updates for client 192.168.1.131
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding -223
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 24
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 16
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 22
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 21
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding 15
26/09/19 12:18:05 Using zlib encoding for client 192.168.1.131
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding -314
26/09/19 12:18:05 Enabling full-color cursor updates for client 192.168.1.131
26/09/19 12:18:05 rfbProcessClientNormalMessage: ignoring unknown encoding -223
26/09/19 12:18:05 Pixel format for client 192.168.1.131:
26/09/19 12:18:05 32 bpp, depth 24, little endian
26/09/19 12:18:05 true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
26/09/19 12:18:05 no translation needed
我在 vnc 查看器中看到灰屏,并带有黑色 X 光标:
你能帮我解决这个问题吗?
我已经用谷歌搜索了很多这个rfbProcessClientNormalMessage: ignoring unknown encoding
错误,但找不到解决方案。
~/.vnc/xstartup
顺便说一句,这是我的:
#!/bin/shxrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &
gnome-session &
谢谢。
答案1
为了克服这个问题,我使用了~/.vnc/xstartup
旧解决方案中的这个:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey &
vncconfig -iconic &
它有效。
答案2
这个问题询问了 debian 和 gnome 3。但其他答案主要是关于 debian 和 xfce。这个问题花了我很多时间。最后这个文档救了我。
我使用安装了 gnome 的 debian 10 ,tigervnc 作为 vnc 服务器。
#install vnc servrer
sudo apt install tigervnc-standalone-server
#start vncserver and allow remote login
vncserver -localhost no :1
#check the port listen stat
netstat -tul | grep 5901
<ip>:1
您可以使用 Tiger vnc 查看器通过或连接到 vnc 服务器<ip>:5901
请记住:
1.在启动 vnc 服务器之前注销当前用户。
2.你应该在公共网络中使用ssh隧道,并且忘记-localhost no
#https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-debian-10
ssh -L 5901:127.0.0.1:5901 -C -N -l loginuser your_server_ip
localhost:1
使用或连接到 vnc 服务器localhost:5901
更多内容:
您可以查看文档https://help.ubuntu.com/community/VNC/Servers查看如何在启动时启动 TigerVNC vncserver。
答案3
尝试通过 VNC 连接到 Debian 10 时遇到同样的问题。
显然 Debian 10 使用 Wayland,而 VNC 存在一些问题。
我的解决方案是禁用 Wayland。为此,请编辑/etc/gdm3/daemon.conf
并取消注释该行
#WaylandEnable=false
这样它就会读取
WaylandEnable=false
然后重新启动服务器,启动 VNC 服务器,我就可以连接到它了。
答案4
我已经红色了答案,这最适合我的设置,即 debian10 + gnome3 :
$ 猫 ~/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
unset DBUS_SESSION_BUS_ADDRESS
gnome-session --disable-acceleration-check --debug &