我安装的是红旗的操作系统。连接vnccserver后黑屏
·查看系统已经安装了vnc
#rpm -q vnc
·解决方案:
1.修改配置文件/root/.vnc/xstartup
注:有的系统配置里有 –nolisten tcp 和 –nohttpd ,这两个是阻止Xwindows登陆和HTTP方式VNC登陆的,如果需要图形界面,那就删除这部分
如果使用的是gnome图像界面,则需要注释掉以下两行,
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
并添加以下这行:
gnome-session &
例如:我的配置文件如下
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#gnome-session & #set starting GNOME desktop
startkde & #kde desktop
#twm & #Text interface
startkde & #kde desktop
#twm & #Text interface