温馨提示  2024年 6月我们已经停止开发者板块文章内容更新,谢谢来访。存档数据
知识 2023-08-21 44 次阅读

centos怎么通过vnc远程桌面管理配置

    系统运维

本文主要介绍“centos怎么通过vnc远程桌面管理配置”,在日常操作中,相信很多朋友在centos怎么通过vnc远程桌面管理配置问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”centos怎么通过vnc远程桌面管理配置”的疑惑有所帮助!下一步,请跟着小编一起来学习吧!

一、查看是否安装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怎么通过vnc远程桌面管理配置”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注名翠软件,小编会继续努力为大家带来更多实用的文章!