Chinaunix首页 | 论坛 | 博客
  • 博客访问: 497821
  • 博文数量: 59
  • 博客积分: 4236
  • 博客等级: 上校
  • 技术积分: 755
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-13 13:08
个人简介

六笨哥

文章分类

全部博文(59)

文章存档

2015年(1)

2014年(2)

2013年(4)

2012年(4)

2011年(15)

2010年(5)

2009年(13)

2008年(15)

我的朋友

分类: LINUX

2009-04-03 16:14:23


    redhat 及fedora 一般都自动安装了vncserver了
只要在服务列表中选中启动一下就可以了
2、vncserver的配置
vncserver

vncpassword
 

3、把用户名加入到配置文件中:

[root@localhost ~]# vi /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# <>.

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

VNCSERVERS="1:root 2:phred 3:sysadmin" 1代表“桌面1”,root代表用户名;可同时启动多个用户桌面

VNCSERVERARGS[1]="-geometry 800x600 -alwaysshared -depth 24"

-alwaysshared代表允许多用户同时登录 -depth代为色深,参数有8,16,24,32。

 4、用vncpasswd创建一个vnc的口令

注意这将同时在你的home目录下,创建一个隐藏的目录.vnc,其中有一个文件passwd保存着你的vnc口令.
[root@localhost ~]# vncpasswd
Password:
Verify:
察看一下.vnc这个目录的内容,应该类似于下面的东西.

[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]#

5、通过编辑文件$HOME/.vnc/xstartup来启动你喜欢的窗口管理器。使用startkde
&来启动KDE,使用gnome-session &来启动GNOME,fvwm2
&来启动FVWM2 。
 
编辑这个名为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” &
gnome-session
#startkde
#twm &
######################################################
asswd
 
因为我们已经修改了启动脚本,现在来重新启动vncserver.
 
[root@localhost ~]# service vncserver restart
Shutting down VNC server: 1:root                           [  OK  ]
Starting VNC server: 1:root                                [  OK  ]
[root@localhost ~]#

 
 
阅读(836) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~