CentOS 5 下安装配置VNC

CentOS 5 下安装配置VNC

我的博客:http://1990172.blog.51cto.com

 

 

 

1. 检查vnc客户端和服务器是否已经安装

[root@centos ~]$ rpm -q vnc vnc-server
package vnc is not installed
vnc-server-4.0-8.1

cent os 5已包含vnc的安装包

2. 将用户名称加入到配置文件

(注:这里的“用户名”是指linux系统用户的名称)
[root@centos ~]# vi /etc/sysconfig/vncservers
#
# 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
# <
URL:http://www.uk.research.att.com/vnc/sshvnc.html>.

# VNCSERVERS="1:myusername"

# VNCSERVERS="1:root 2:user" # use the method for more user
VNCSERVERS="1:root 2:user"

# VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[1]="-geometry 1024x768"

VNCSERVERARGS[2]="-geometry 1024x768"

3. 设置用户的密码

[user@centos ~]$ vncpasswd
Password:
Verify:

4. 启动VNC服务

[user@centos ~]# /sbin/service vncserver start
Starting VNC server: 1:user
               [   OK   ] 

5. 编写xstartup脚本

[user@centos ~]$ cd ~/.vnc/
[user@centos .vnc]$ vi xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
#unset SESSION_MANAGER
#e xec /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"

& gnome-session &    

#set starting GNOME desktop
#startkde &                

#kde desktop
#twm &                       

#Text interface

6. 重启vncserver

[root@centos ~]# /sbin/service vncserver restart

Shutting down VNC server: 1:root                           [   OK   ]
Starting VNC server: 1:root
               [   OK   ] 

7. Windows登陆到VNC Server

启动:vnc-E4_2_8-x86_win32_viewer.exe
输入:
server:192.168.1.13:1 (这里,我的VNC服务器在192.168.1.13上,用的是Display1(对应gavin帐号))
Encryption:Let Server Choose(Default)

注:红色标注部分是更改的配置。

 

 

转载于:https://my.oschina.net/xxjbs001/blog/286599

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值