摘要:linux环境下,利用VNC连接远程桌面是经常用到的。这里,我们介绍centos上,利用VNC连接远程桌面的方法和常见的两个问题的解决方法1)由于字体问题,导致VNCserver无法启动 2)由于防火墙问题,导致开启VNCserver以后,无法在VNCviewer连接过来。

本文来源:http://blog.csdn.net/trochiluses/article/details/10946181

一、查看是否安装 VNC

[root@xen ~]# rpm -qa|grep tigervnc
tigervnc-1.0.90-0.17.20110314svn4359.el6.x86_64
tigervnc-server-1.0.90-0.17.20110314svn4359.el6.x86_64

如果没有就安装下了

[root@xen ~]# yum install tigervnc tigervnc-server

添加启动项

[root@xen ~]# chkconfig --add vncserver
[root@xen ~]# chkconfig vncserver on

二、设置 VNC 密码

[root@xen ~]# vncserver
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xen:1.log

会在当前用户主目录下 生成 .vnc  目录和配置文件

[root@xen ~]# vncpasswd 
Password:
Verify:

设置的密码保存在  /root/.vnc/passwd

三、VNC 配置

修改 xstartup 文件 把最后的 twm & 删掉 加上 gnome-session & 
编辑/root/.vnc/xstartup,

vi /root/.vnc/xstartup

如果直接 启动
[root@xen .vnc]# /etc/init.d/vncserver start
正在启动 VNC 服务器:no displays configured                [失败]

所以要修改  /etc/sysconfig/vncservers 文件添加以下内容
VNCSERVERS="2:root"
# 桌面号:用户    监听 590* 端口
VNCSERVERARGS[2]="-geometry 800x600"

这样修改后,就算 /etc/inittab 启动模式为 3  也可以正常进入图形界面

启动 vncserver
[root@xen ~]# /etc/init.d/vncserver start
正在启动 VNC 服务器:2:root xauth: (stdin):1:  bad display name "xen:2" in "add" command

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

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/xen:2.log

四、常见问题

1)由于防火墙,导致外部无法连接远程桌面

解决方法:启动完毕后使用netstat -nat查看监听端口(默认为5901,5902,5903等),如果开启了防火墙,则需要配置规则允许对应端口tcp包通过。

iptables -I INPUT 1 -p tcp --dport 5901 -j ACCEPT(其中-I INPUT 1代表插入一条规则,这条规则的位置是1,详情请查阅iptables相关配置)

2)字体问题导致无法启动vncserver

出错提示:WARNING: the first attempt to star Xvnc failed,possibly because the font catalog is not properly configured, attempting to determine an appropriate font path

for this system and restart Xvnc using that font path ...

解决方法:

a.查看需要更新的字体:yum list updates | grep font

b.将上一步中需要更新的字体都安装

外部参考:

[1]http://stonebird.blog.51cto.com/1651861/942945

[2]http://www.cnblogs.com/zhangxiaodong/archive/2013/03/29/2989495.html

centos 6.3 vnc连接—— catalog is not properly configured, attempting to determine an appropriate font p的更多相关文章

  1. 【转】使用vnc连接linux服务器方便hadoop开发调试

    VNC(Virtual Network Computing)它能将完整的窗口界面通过网络,传输到另一台计算机的屏幕上. 类似的软件在Windows服务器中包含的"Terminal Serve ...

  2. CentOS下架设VNC服务器

    CentOS下架设VNC服务器1.什么是VNC服务器?百度百科:VNC (Virtual Network Computer)是虚拟网络计算机的缩写.它 是一款优秀的远程控制工具软件,由著名的 AT&a ...

  3. 通过VNC连接远程服务器,然后登陆服务器上的虚拟机,出现键盘输入问题的解决方法

    前几天由于要在服务器上装一个虚拟机,然后就选择了vmware workstation,装好之后,进入虚拟机中的centOS系统,发现键盘上的Cpas Lock键不起作用,按下之后还是输入小写,而且按住 ...

  4. CentOS 配置XWIN/VNC

    Xwin服务器 CentOS上运维Xwin,在这之前需要理清一些关系: 一,  X window 包括xserver 和x client.linux下的xserver 主要有xorg.xfree86, ...

  5. CentOS 8 配置 VNC Server

    CentOS 8 配置 VNC Server 2020-12-31 | 标签: centos, vnc 前言 CentOS 8 配置 VNC Server, 使用户可以远程访问,本例介绍安装和配置流程 ...

  6. CentOS 8.2远程连接vncserver升级后1.10.1无法启动解决记录

    CentOS 8.2远程连接vncserver升级后1.10.1无法启动解决记录   问题起源:手贱yum upgrade,重启服务器后无法使用vnc viewer远程连接 查看状态 # system ...

  7. VNC连接远程Ubuntu设置

    一.windows 远程软件VNCViewer 这个不多说: 下载地址:http://www.realvnc.com/download/viewer/ 二.安装 vnc-server apt-get ...

  8. vnc连接kali 2.0 报错:A problem has occurred and the system can't recover.

    kali版本: root@kali:~# uname -a Linux kali -kali1-amd64 # SMP Debian -7kali2 (--) x86_64 GNU/Linux 第一步 ...

  9. OS + CentOS / windows / xrdp / vnc

    s 通过windows远程访问linux桌面的方法(简单) https://www.cnblogs.com/lizhangshu/p/9709531.html https://dl.fedorapro ...

随机推荐

  1. oracle数据库中insert与select

    前几天遇到了一个问题,insert语句中,不仅要insert页面传过来的值,还要insert select的值. 语句应该这样写: insert into 表1(字段a,字段b,...) select ...

  2. iOS 获取当前时间以及计算年龄(时间差)

    获取当前时间 NSDate *now = [NSDate date]; NSLog(@"now date is: %@", now); NSCalendar *calendar = ...

  3. Javascript 生成指定范围数值随机数

    JavaScript对随机数的介绍比较少,所以今天分享一下有关随机数的一些事儿.希望能对大家有点小帮助. 主要的公式就是parseInt(Math.random()*(上限-下限+1)+下限); Ma ...

  4. Python 中的用户自定义类型

    Python中面向对象的技术 Python是面向对象的编程语言,自然提供了面向对象的编程方法.但要给面向对象的编程方法下一个定义,是很困难的.问题关键是理解对象 的含义.对象的含义是广泛的,它是对现实 ...

  5. 学习老外用webstorm开发nodejs的技巧--代码提示DefinitelyTyped

    最近入了nodejs的坑,作为老码农,js对我来说还是很容易的.webstorm虽说用得不多,但是pycharms我是老手了,idea的东西一脉相承,想想也就那样了. 但是自从看了某个视频后,觉得毕竟 ...

  6. UVA 10201 Adventures in Moving - Part IV(dp)

    Problem A: Adventures in Moving - Part IV To help you move from Waterloo to the big city, you are co ...

  7. LeetCode77:Combinations

    Given two integers n and k, return all possible combinations of k numbers out of 1 - n. For example, ...

  8. gbs remotebuild使用说明

    本文件从:https://source.tizen.org/documentation/articles/gbs-remotebuild翻译而来. 1 远程构建 使用remotebuild子指令将本地 ...

  9. vcredist_x86.exe 静默安装方法

    我们打包基于VC++开发的应用程序,我们会一同打包一个VC运行库,否则安装到一些非开发环境中,你的应用程序依然可以正确运行. Visual C++ 2008 Redistributable Packa ...

  10. DBA日常管理——数据归档(Archiving-Data)

    原文出处:http://www.sqlnotes.cn/post/2013/09/05/DBA-Daily-Jobs-One%E2%80%94%E2%80%94-Archiving-Data 均为本人 ...