如果不知道kill多少值,可通过ps -ef | grep vnc进行查看
1.先kill掉现在的vnc端口进程(假设端口是1):比如:vncserver -kill :1
2.打开启动文件xstartup:vim ~/.vnc/xstartup
3.修改其中的内容如下:
#!/bin/shexport XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESSxfce4-panel &
xfsettingsd &
xfwm4 &
xfdesktop &
pcmanfm &
xfce4-terminal &
按Esc,输入:wq,保存退出即可
或者:
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESSexec /etc/X11/xinit/xinitrcxfce4-panel &
xfsettingsd &
xfwm4 &
xfdesktop &
pcmanfm &
xfce4-terminal &[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &startxfce4 &
4.重新开启服务:vncserver :1 -geometry 1920x1080 -depth 24
可以通过vncviewer连上桌面成功
标签:vnc,etc,SESSION,kill,黑屏,解决,xstartup,vncviewer,unset From: https://blog.51cto.com/u_16193086/7421093