分类: LINUX
2010-06-06 15:54:08
在debian上的vncserver启动后,用本地windows上的vncviewer登陆后,发现键盘出现乱序,登陆别的server没有这种情况,把问题定位在debian系统上的vncserver的原因。
debian上卸载vnc4server:
apt-get --purge remove vnc4-common vnc4server
重新安装vnc4server:
apt-get install vnc4-common vnc4server
启动vnc4server,得到错误信息如下:
debian:/var/cache/apt/archives# vnc4server
vnc4server: couldn't find "vncpasswd" on your PATH.
上网查阅后,原因是以前安装的vncserver的一些信息没有删除完全
查看系统中未删除干净的vncserver的信息
debian:/var/cache/apt/archives# ls -l /usr/bin/*vnc* /var/lib/dpkg/alternatives/*vnc* /etc/alternatives/*vnc*
lrwxrwxrwx 1 root root 19 2010-06-06 02:28 /etc/alternatives/vncconfig -> /usr/bin/vnc4config
lrwxrwxrwx 1 root root 35 2010-06-06 02:28 /etc/alternatives/vncconfig.1.gz -> /usr/share/man/man1/vnc4config.1.gz
lrwxrwxrwx 1 root root 19 2010-06-05 12:30 /etc/alternatives/vncpasswd -> /usr/bin/vnc4passwd
lrwxrwxrwx 1 root root 19 2010-06-06 00:35 /etc/alternatives/vncserver -> /usr/bin/vnc4server
lrwxrwxrwx 1 root root 27 2010-06-06 02:06 /usr/bin/vncconfig -> /etc/alternatives/vncconfig
-rw-r--r-- 1 root root 135 2010-06-06 02:28 /var/lib/dpkg/alternatives/vncconfig
-rw-r--r-- 1 root root 28 2010-06-06 02:30 /var/lib/dpkg/alternatives/vncpasswd
然后删除以上信息
debian:/var/cache/apt/archives# rm /etc/alternatives/vncconfig /etc/alternatives/vncconfig.1.gz /etc/alternatives/vncpasswd /etc/alternatives/vncserver /usr/bin/vncconfig /var/lib/dpkg/alternatives/vncconfig /var/lib/dpkg/alternatives/vncpasswd /var/lib/dpkg/alternatives/vncserver
重新卸载后,安装vnc4server
apt-get --purge remove vnc4-common vnc4server
apt-get install vnc4-common vnc4server
启动vnc4server:
debian:/var/cache/apt/archives# vnc4server
Found /usr/local/vnc/classes for http connections.
New 'debian:3 (root)' desktop is debian:3
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/debian:3.log
修改/root/.vnc/xstartup文件如下:
1 #!/bin/sh
2
3 # Uncomment the following two lines for normal desktop:
4 unset SESSION_MANAGER
5 exec /etc/X11/xinit/xinitrc
6
7 #[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
8 #[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
9 #xsetroot -solid grey
10 #vncconfig -iconic &
11 #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
12 #x-window-manager &
重新开启vnc4server后,即可。
上网查阅信息的网址如下: