全部博文(66)
分类:
2009-10-27 10:52:23
VNC Free Edition for HP-UX 11/11i (PA-RISC) Version 4.1.1
GZipped Depot (1.7M) 这个最小
安装:
[quote:fd5d2e0ce1]# cd /tmp
# gunzip vnc-4_1_1-parisc_hpux.depot.gz
# swinstall -s /tmp/vnc-4_1_1-parisc_hpux.depot
安装好后需要把/usr/local/bin加到PATH环境变量中,修改/etc/PATH即可
切换到你用来运行vncserver的用户,假设是user1
[quote:fd5d2e0ce1]# su - user1
设置连接密码
[quote:fd5d2e0ce1]$ vncpasswd
Password:
Verify:[/quote:fd5d2e0ce1]
切回root用户,启动vncserver
[quote:fd5d2e0ce1]# vncserver :3
用windows下的vnc客户端连接服务器的5903端口,应该可以连上了!但现在只是一个x终端,不是CDE的界面。下面来设置用CDE的界面
停止vnc服务
[quote:fd5d2e0ce1]# vncserver -kill :3
先修改user1的xstartup文件
[quote:fd5d2e0ce1]# vi /home/user1/.vnc/xstartup
原来的内容:
[quote:fd5d2e0ce1]#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
修改成这样:
[quote:fd5d2e0ce1]#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
在启动vnc,需要用query选项
[quote:fd5d2e0ce1]# vncserver :3 -query localhost
再用vnc客户端连,应该是CDE界面了,不过字体似乎有些问题。可以这样解决:
需要启动x font server
修改/etc/rc.config.d/xfs
把RUN_X_FONT_SERVER=0
改成RUN_X_FONT_SERVER=1
然后,启动xfs服务
[quote:fd5d2e0ce1]# /sbin/init.d/xfs start
重新启动vnc服务,这回需要fp选项
[quote:fd5d2e0ce1]# vncserver -kill :3
# vncserver :3 -query localhost -fp tcp/localhost:7000(solaris和Linux的为7100)
设置机器重启时自动启动vnc服务
在/etc/rc.config.d下新建文件vncservers,内容如下:
[quote:fd5d2e0ce1]VNCSERVERS="3:user1"
VNCSERVERARGS[3]="-geometry 800x600 -query localhost -fp tcp/localhost:7000"
在/sbin/init.d下新建文件vncserver,内容如下:
[code:1:fd5d2e0ce1]#!/sbin/sh
#
# vncserver startup: Startup and kill script for the VNC server
#
PATH=i/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/usr/local/bin
export PATH
VNCSERVERS=""
[ -f /etc/rc.config.d/vncservers ] && . /etc/rc.config.d/vncservers
prog="VNC server"
# See how we were called.
case "$1" in
start)
echo "Starting $prog: \c"
/usr/bin/ulimit -S -c 0 >/dev/null 2>&1
RETVAL=0
for display in ${VNCSERVERS}
do
echo "${display}"
DISP="${display%%:*}"
USER="${display##*:}"
VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
/usr/bin/su ${USER} -c "cd ~${USER} && export HOME=~${USER} && [ -f
.vnc/passwd ] && /usr/local/bin/vncserver :${DISP} ${VNCUSERARGS}"
RETVAL=$?
[ "$RETVAL" -ne 0 ] && break
done
[ "$RETVAL" -eq 0 ] && touch /var/tmp/vncserver
;;
stop)
echo "Shutting down $prog: \c"
for display in ${VNCSERVERS}
do
echo "${display}"
DISP="${display%%:*}"
USER="${display##*:}"
/usr/bin/su ${USER} -c "export HOME=~${USER} && /usr/local/bin/vncserver -
kill :${DISP}" >/dev/null 2>&1
done
RETVAL=$?
[ "$RETVAL" -eq 0 ] && rm -f /var/tmp/vncserver
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac
exit 0
然后,加上执行权限,建到rc3.d和rc2.d的软链接
[quote:fd5d2e0ce1]# chmod +x vncserver
# ln -s /sbin/init.d/vncserver /sbin/rc3.d/S999vncserver
# ln -s /sbin/init.d/vncserver /sbin/rc2.d/K100vncserver