重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2598|回复: 0
打印 上一主题 下一主题

[分享]CentOS 安装VNC

[复制链接]
跳转到指定楼层
楼主
发表于 2014-10-8 11:10:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式



1.验证是否已经安装VNCCentOS一般自带

rpm –qa |grep vnc

如果结果为:

tigervnc-server-1.0.90-0.17.20110314svn4359.el6.i686(不同版本的名称不同)

说明已安装

如果没有安装,可使用命令:

 rpm –ivh tigervnc-server-1.0.90-0.17.20110314svn4359.el6.i686.rpm

2.指定远程桌面用户

vi /etc/sysconfig/vncservers

在里面添加

[root@muxiyuan ~]# vim /etc/sysconfig/vncservers

VNCSERVERS="1:root 2:root 3:root "

VNCSERVERARGS[1]="-geometry 1360x768  -alwaysshared -depth 16"

VNCSERVERARGS[2]="-geometry 1024x600  -alwaysshared -depth 16"

VNCSERVERARGS[3]="-geometry 800x600  -alwaysshared -depth 16"

3.添加密码

vncpasswd

会出现输入密码的提示

 

4.关闭iptables或在该文件中加入特例

此处直接关闭

service iptables stop

4.2

vi /etc/sysconfig/iptables 加上下面的内容:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5903 -j ACCEPT

[root@localhost~]#/sbin/service iptables restart

 

5.新建一个 /root/.vnc/xstartup文件,权限为755

内容为:

#!/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 &

gnome-session &

 

6.启动VNC

/sbin/service vncserver start

 

7.开机启动VNCSERVER

chkconfig vncserver on

 

8.登录时填写192.168.10.10:1212为桌面号)

9.停止vncserver

#vncserver -kill :1(1为桌面号)

[此贴子已经被作者于2014-11-07 17:56:26编辑过]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-28 15:22 , Processed in 0.081856 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表