大家好!
我安装了一个vncserver ,现在运行正常。
但是,每次linux 服务器启动都要,自己再一次启动服务 "vncserver".
服务器不在我的位置上,所以每次启动都很麻烦。
所以请教大家。怎么在服务器设置。每次可以自动启动vnc服务!!!
谢谢大家了!!
|
在/etc/rc2.d目录下
# vi S99vncser
写入诸如如下内容,假设你的vncserver在/usr/bin目录下:
if [ -x /usr/bin/vncserver ]; then
/usr/bin/vncserver
fi
# chmod 755 S99vncser
|
或者在 /etc/rc.d/rc.local文件里面加上这句
[ -x /usr/bin/vncserver ] && /usr/bin/vncserver
|
Server端設置
1.設置vnc server三種方法:
There are three ways this can be done. For XFree86 version 4 X servers, a loadable module is provided which adds the VNC server functionality. For other X servers it is possible to build a replacement for the native X server binary which is VNC-enabled. A third way is an inefficient but non-invasive VNC server called x0vncserver, which continuously polls any X display, allowing it to be controlled via VNC.
A.將 vnc.so 拷貝到 /usr/X11R6/lib/modules/extensions
修改 /etc/ XF86Config, 有的linux可能是 /etc/X11/ XF86Config, 增加如下:
Section "Module"
...
Load "vnc"
EndSection
...
Section "Screen"
...
Option "passwordFile" "/root/.vnc/passwd"
EndSection
重啟就可