Chinaunix首页 | 论坛 | 博客
  • 博客访问: 295815
  • 博文数量: 80
  • 博客积分: 1933
  • 博客等级: 上尉
  • 技术积分: 915
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-09 08:43
个人简介

高龄IT运维工程师

文章分类
文章存档

2023年(5)

2021年(3)

2020年(1)

2019年(2)

2018年(3)

2017年(3)

2016年(5)

2014年(3)

2013年(2)

2012年(11)

2011年(12)

2010年(30)

分类: LINUX

2011-10-10 12:50:32

vncserver的配置以root用户为例
首先确认是否安装了这四个软件包:
rpm -qa |grep vnc
gtk-vnc-python-0.3.2-3.el5
vnc-server-4.1.2-14.el5
gtk-vnc-0.3.2-3.el5
vnc-4.1.2-14.el5
安装好后就可以进行配置
目录在/root目录下面
1)第一次启动vncserver     会提示输入密码:      管理员帐户:
      [root@localhost /]# vncserver

You will require a password to access your desktops.

Password:     输入vnc 连接密码

Verify:       确认vnc密码

xauth:  creating new authority file /root/.Xauthority

New ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log

2)配置vnc的配置文件xstartup文件

  如果用的是gnome 桌面环境还需要修改

[root@localhost .vnc]# vi 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 gnome     添加连接时使用 gnome 桌面环境

twm &

这样你的vnc客户端就可以连接到你的linux vncserver上,最后一步chkconfig vncserver on;service vncserver restart.就行。

打开配置文件/etc/sysconfig/vncservers,去掉下面这行的注释,
         VNCSERVERS="1:root"
         VNCSERVERARGS[1]="-geometry 800x600"
        1表示VNC以桌面1运行,这样可以启动root的桌面。

 

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