Chinaunix首页 | 论坛 | 博客
  • 博客访问: 78808
  • 博文数量: 12
  • 博客积分: 1560
  • 博客等级: 上尉
  • 技术积分: 146
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-07 07:23
文章分类
文章存档

2011年(2)

2010年(8)

2008年(2)

分类: LINUX

2010-05-12 20:08:31

系统为CentOS 5.4 32bit
uname -a
Linux sts223 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux
1.yum -y install vnc
 
2.vncserver
输入初始化密码,并再次输入确认
 
3.杀掉vncserver 的第一个进程。
vncserver -kill :1
 
4. vi ~/.vnc/xstartup
内容修改如下:
 
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
/etc/X11/xinit/Xclients
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
保存退出
 
5.编辑IPTABLES策略,开启TCP 5801,5802,5901,5902,6001,6002端口
6.再次运行vncserver
可以看到启动信息有提示:
[root@sts223 .vnc]# vncserver
New 'xxx:2 (root)' desktop is xxx:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xxx:1.log
xxx为主机名。
: ( ) { : | : & } ; :
7.用VNC viewer测试--连接到: 主机IP:1,其后就像使用远程桌面一样,使用LINUX。运行各种程序都比较稳定。没有出现过VNCserver Down的情况。
搞掂,收工。
 
阅读(1422) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~