解决VNC连接灰屏或黑屏
1.进入vnc配置文件路径
cd .vnc/
2.修改配置文件 .vnc/xstartup
vim ~/.vnc/xstartup
3.替换配置文件内容如下
#!/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 &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
#gnome-terminal &
sesion-manager & xfdesktop & xfce4-panel &
xfce4-menu-plugin &
xfsettingsd &
xfconfd &
xfwm4 &
metacity &
nautilus &
修改完成后重启vnc
先停止
vncserver -kill :1
#(注意kill后面要有个空格,1为vnc端口)
再启动vnc
vncserver :1 -geometry 1536x864
#(1536x864为创建的vnc窗口分辨率)
vnc连接启动 ip:vnc端口号