操作系统 
首页 > 操作系统 > 浏览文章

CentOS通过VNC远程桌面管理配置教程分享

(编辑:jimmy 日期: 2024/10/3 浏览:3 次 )

一、查看是否安装VNC

1、安装桌面

yum groupinstall "Chinese Support"

2、安装中文支持

yum groupinstall "Desktop"

打开配置文件的目录: 

1) cd /etc/sysconfig

2) 编辑配置文件: vi i18n

3) 用#号把第一行(LANG="en_US.UTF-8")注释掉,其实直接在这行改也是可以的,不过保险点的做法,还是先注释掉,等成功后再删除不迟。

在第一行下添加一行新行,输入(LANG="zh_CN.UTF-8"),然后保存文件,重启系统,就能见到亲切的中文啦。

3、关闭防火墙并改为开机不启动防护墙

[root@centos ~]# service iptables stop

[root@centos ~]# chkconfig iptables off


4、查看是否已经安装VNC

[root@centos ~]# rpm -qa |grep vnc 出现下面类似的说明已安装,否则进行下面的安装配置操作;
tigervnc-server-1.0.90-0.17.20110314svn4359.el6.x86_64

二、安装VNC

[root@centos ~]# yum –y install tigervnc-server
添加启动项
[root@centos ~]# chkconfig vncserver on

三、设置VNC 密码

[root@centos ~]# vncserver
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/centos:1.log
会在当前用户主目录下生成.vnc 目录和配置文件
[root@centos ~]# vncpasswd
Password:
Verify:
设置的密码会保存在/root/.vnc/passwd

三、VNC 配置

修改xstartup 文件把最后的twm & 删掉加上gnome-session &

[root@centos ~]#vi /root/.vnc/xstartup
xsetroot -solid grey



xsetroot -solid grey

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

twm &

将twm &修改为gnome-session &
如果直接启动会失败
[root@centos ~]#service vncserver start

Starting VNC server: no displays configured [FAILED]


所以要修改/etc/sysconfig/vncservers 文件添加以下一条内容
VNCSERVERS="2:root"
# 桌面号:用户;

# 监听的端口为:590* ,星号代表桌面号


VNCSERVERARGS[2]="-geometry 800x600" 这样修改后,就算/etc/inittab 启动模式为3 也可以正常进入图形界面

注:修改默认启动界面为修改本行的数字,3为文本界面,5位图形界面:id:3:initdefault:


启动vncserver
[root@centos ~]#service vncserver start
正在启动VNC 服务器:2:root xauth: (stdin):1: bad display name "centos:2" in "add" command

New 'centos:2 (root)' desktop is centos:2

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/centos:2.log

Ok,现在可以通过VNC Viewer来远程连接了。

上一篇:CentOS 6.3 挂载读写NTFS分区的方法(ntfs-3g)
下一篇:CentOS 6.3 NFS的安装配置、启动及mount挂载方法
一句话新闻
高通与谷歌联手!首款骁龙PC优化Chrome浏览器发布
高通和谷歌日前宣布,推出首次面向搭载骁龙的Windows PC的优化版Chrome浏览器。
在对骁龙X Elite参考设计的初步测试中,全新的Chrome浏览器在Speedometer 2.1基准测试中实现了显著的性能提升。
预计在2024年年中之前,搭载骁龙X Elite计算平台的PC将面世。该浏览器的提前问世,有助于骁龙PC问世就获得满血表现。
谷歌高级副总裁Hiroshi Lockheimer表示,此次与高通的合作将有助于确保Chrome用户在当前ARM兼容的PC上获得最佳的浏览体验。