有时候,在linux上启动一个vncserver :1时,报警告:Warning: ***** is taken because of /tmp/.X1-lock
那需要将提示删除的文件都删除掉。比如: /tmp/.X1-lock
CODE:[root@localhost ~]# cd .vnc
[root@localhost .vnc]# ls
localhost.localdomain:1.log localhost.localdomain:2.log passwd
localhost.localdomain:1.pid localhost.localdomain:2.pid xstartup
[root@localhost .vnc]#
编辑这个名为xstartup的脚本,
将这内容前面的注释符号去掉,否则你将只能得到一个什么都没有的灰屏。
#!/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 80×24+10+10 -ls -title “$VNCDESKTOP Desktop”
twm
因为我们已经修改了启动脚本,现在来重新启动vncserver.