空气中的尘埃
分类: LINUX
2012-07-25 10:16:37
1、检查包是否安装
[root@linuxserver1 /]# rpm -q vnc-server vnc
vnc-server-4.1.2-14.el5_3.1
vnc-4.1.2-14.el5_3.1
2、vi /etc/gdm/custom.conf
最后[servers] 后改为
[servers]
# Also note, that if you redefine a [server-foo] section, then GDM will
# use the definition in this file, not the defaults.conf file. It is
# currently not possible to disable a [server-foo] section defined
0=VNC
[server-VNC]
name=VNC Server
command=/usr/bin/Xvnc -SecurityTypes None -geometry 1024x768 -depth 16 \
-BlacklistTimeout 0
flexible=true
redhat 执行,Centos 则不需要
cp /etc/gdm/custom.conf /etc/gdm/gdm.conf
3、vi /etc/sysconfig/vncservers
最后段修改为。
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
# VNCSERVERS="1:root 2:oracle"
VNCSERVERS="1:root"
#VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -nohttpd -localhoSt"
VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -nohttpd -localhost"
4、需要vncserver 远程的用户执行
vncserver
设置密码,并生成相应文件
如需启动gnome 桌面,修改用户主目录中的xstartup
去掉绿色行的注释
vi /root/.vnc/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 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
~
5、使用vncserver 连接 192.168.0.220:1 输入密码即可连接