日期:2014-05-16  浏览次数:20797 次

Linux 开机启动VNCserver

Debian开机启动VNC:

?

启动VNC并设置:

startjwm &
firefox --display=:1

?

设置VNC开机启动

vim /etc/init.d/vncserver

?

### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
PATH="$PATH:/usr/X11R6/bin/"
# The Username:Group that will run VNC
export USER="root"
#${RUNAS}
# The display that VNC will use
DISPLAY="1"
# Color depth (between 8 and 32)
DEPTH="16"
# The Desktop geometry to use.
#GEOMETRY="x"
GEOMETRY="800x600"
#You Can Choice GEOMETRY="1024x768" && GEOMETRY="1280x1024"
# The name that the VNC Desktop will have.
NAME="Vncserver"
OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
. /lib/lsb/init-functions
case "$1" in
start)
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;
stop)
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;
restart)
$0 stop
$0 start
;;
esac
exit 0

?

添加权限

chmod +x /etc/init.d/vncserver

使配置生效

update-rc.d vncserver defaults

添加计划任务,定时重启vnc或者系统,以防止firefox假死不出分

crontab -e


CentOS开机启动VNC:

1.配置vnc

/etc/sysconfig/vncservers

2.shift+g 移到最后插入下面的代码

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 800x600"

?

3.设置vnc自动启动

chkconfig vncserver on

4.安装flash插件

wget http://blog.firetry.com/soft/libflashplayer.so
mkdir -p ~/.mozilla/plugins
cp libflashplayer.so ~/.mozilla/plugins/

?


5.下载vagex 插件,youtube优化插件

wget http://vagex-debian.googlecode.com/files/youtube_video_quality_manager-1.2-fx.xpi

?