vncviewer:VNC服务器关闭连接

vncviewer:VNC服务器关闭连接

因此,我在我的工作站“orac”上安装了一个 VNC 服务器(Tight VNC),该工作站运行带有 KDE Plasma 的 Debian Jessie。我的工作站“tact”上有一个 VNC 客户端(也是 Tight VNC),运行 Debian Stretch 和 KDE Plasma。

我在 orac 上运行 vncpasswd 来配置密码。

我想使用 VNC 来使用“tact”中的“orac”。

我通过 ssh 连接到 orac 并启动了 vncserver:

jj5@orac:~$ vncserver 

New 'X' desktop is orac:1

Starting applications specified in /home/jj5/.vnc/xstartup
Log file is /home/jj5/.vnc/orac:1.log

然后我从机智的控制台运行:

jj5@tact:~$ vncviewer orac:1
Connected to RFB server, using protocol version 3.8
Enabling TightVNC protocol extensions
Performing standard VNC authentication
Password: 
Authentication successful
Desktop name "jj5's X desktop (orac:1)"
VNC server default format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Using default colormap which is TrueColor.  Pixel format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
vncviewer: VNC server closed connection

在报道之前vncviewer: VNC server closed connection,一切似乎都进展顺利。一个窗口打开,我看到 KDE Plasma 正在执行登录/加载操作,然后我的 orac 桌面加载,加载一堆默认的 Dolphin 窗口,KDE Plasma 开始处理我的自动启动脚本,所以一切似乎都工作正常,然后几乎就像一旦启动,KDE/VNC 就会消失并关闭,通常是vncviewer: VNC server closed connection,但有时是vncviewer: read: Connection reset by peer

那么为什么 KDE(或 VNC?)一启动就退出呢?非常感谢任何帮助!

ps 以下是有关 VNC 服务器 (orac) 环境的一些额外信息:

jj5@orac:~/.vnc$ ls -al
total 24K
drwx------  2 jj5 jj5 4.0K May  4 17:35 ./
drwxr-xr-x 74 jj5 jj5 4.0K May  4 17:35 ../
-rw-r--r--  1 jj5 jj5 1.3K May  4 17:36 orac:1.log
-rw-r--r--  1 jj5 jj5    5 May  4 17:35 orac:1.pid
-rw-------  1 jj5 jj5    8 May  4 15:52 passwd
-rwxr-xr-x  1 jj5 jj5  263 May  4 17:32 xstartup*

日志文件显示:

jj5@orac:~/.vnc$ cat orac\:1.log 
04/05/17 17:35:57 Xvnc version TightVNC-1.3.9
04/05/17 17:35:57 Copyright (C) 2000-2007 TightVNC Group
04/05/17 17:35:57 Copyright (C) 1999 AT&T Laboratories Cambridge
04/05/17 17:35:57 All Rights Reserved.
04/05/17 17:35:57 See http://www.tightvnc.com/ for information on TightVNC
04/05/17 17:35:57 Desktop name 'X' (orac:1)
04/05/17 17:35:57 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
04/05/17 17:35:57 Listening for VNC connections on TCP port 5901

04/05/17 17:36:04 Got connection from client 10.1.1.126
04/05/17 17:36:04 Using protocol version 3.8
04/05/17 17:36:04 Enabling TightVNC protocol extensions
04/05/17 17:36:06 Full-control authentication passed by 10.1.1.126
04/05/17 17:36:06 Pixel format for client 10.1.1.126:
04/05/17 17:36:06   32 bpp, depth 24, little endian
04/05/17 17:36:06   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
04/05/17 17:36:06   no translation needed
04/05/17 17:36:06 Using tight encoding for client 10.1.1.126
04/05/17 17:36:06 Using compression level 1 for client 10.1.1.126
04/05/17 17:36:06 Using image quality level 6 for client 10.1.1.126
04/05/17 17:36:06 Enabling X-style cursor updates for client 10.1.1.126
04/05/17 17:36:06 Enabling cursor position updates for client 10.1.1.126
04/05/17 17:36:06 Enabling LastRect protocol extension for client 10.1.1.126

请注意,10.1.1.126 是我的 VNC 客户端“tact”。

我的 xstartup 脚本几乎只是默认脚本(我没有 ~/.Xresources 文件,因此我从 xrdb 命令中删除了该文件,否则它按原样):

jj5@orac:~/.vnc$ cat xstartup 
#!/bin/sh

#xrdb $HOME/.Xresources
xrdb
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

答案1

哦哇。所以我发现了这个问题并像这样修复了它:

jj5@orac:~$ rm .config/autostart/dropbox.desktop

当我尝试在我的系统上安装 Dropbox 客户端时,dropbox.desktop 文件似乎已安装(但我无法使其正常工作并且不使用它)。我忘记了这个文件在这里。在尝试通过 VNC 访问 orac 后,我通过查看主目录中最近修改的文件/目录发现了这一点。例如:

jj5@orac:~$ ls -Alt | head
total 21292
drwx------    4 jj5  jj5      4096 May  4 18:12 Dropbox
drwx------    5 jj5  jj5      4096 May  4 18:12 .dropbox
drwx------    2 jj5  jj5      4096 May  4 18:12 .vnc
-rw-------    1 jj5  jj5      3136 May  4 18:12 .Xauthority
-rw-------    1 jj5  jj5     26860 May  4 18:07 .viminfo
-rw-------    1 jj5  jj5      6692 May  4 17:49 .bash_history
drwx------    2 jj5  jj5      4096 May  4 17:36 .pulse
-rw-r--r--    1 jj5  jj5        75 May  4 17:25 .selected_editor
-rw-r--r--    1 jj5  jj5       697 May  4 17:22 .profile
-rw-r--r--    1 jj5  jj5      3963 May  4 17:22 .bashrc

dropbox.desktop 文件如下所示:

jj5@orac:~/archive/2017-05-04-181328$ cat dropbox.desktop 
[Desktop Entry]
Name=Dropbox
GenericName=File Synchronizer
Comment=Sync your files across computers and to the web
Exec=dropbox start -i
Terminal=false
Type=Application
Icon=dropbox
Categories=Network;FileTransfer;
StartupNotify=false

相关内容