当前位置: > Linux服务器 > VNC >

CentOS 配置VNC

时间:2015-03-26 21:43来源:linux.it.net.cn 作者:IT
对于用惯了WIN系统的朋友来说,没有图形化操作界面的Linux用起来实在太难受了。实际上,Linux也是有图形化操作界面的,这就是VNC。接下来罗伊将告诉大家如何 VNC图形化操作界面。
1,安装桌面环境
[root@dlp ~]#yum -y groupinstall "X Window System"
[root@dlp ~]#yum -y groupinstall "Desktop"
[root@dlp ~]#yum -y groupinstall "General Purpose Desktop" groupinstall "X Window System"

2,安装VNC服务器
[root@tanvps ~]# yum -y install tigervnc-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror-fpt-telecom.fpt.net
* extras: mirror-fpt-telecom.fpt.net
* updates: mirror-fpt-telecom.fpt.net
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package tigervnc-server.i686 0:1.0.90-0.17.20110314svn4359.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================== ==============================
Package Arch Version Repository
Size
================================================== ==============================
Installing:
tigervnc-server i686 1.0.90-0.17.20110314svn4359.el6 base 1.1 M

Transaction Summary
================================================== ==============================
Install 1 Package(s)

Total download size: 1.1 M
Installed size: 2.9 M
Downloading Packages:
tigervnc-server-1.0.90-0.17.20110314svn4359.el6.i686.rpm | 1.1 MB 00:02
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key)

Installed:
tigervnc-server.i686 0:1.0.90-0.17.20110314svn4359.el6

Complete!
[root@tanvps ~]#

3,配置VNC
[root@tanvps ~]# su -jackiebui
[jackiebui@tanvps ~]# vncpasswd
Password:******
verify:******
[jackiebui@tanvps ~]# ls .vnc/

4,编辑VNC配置文件
[root@tanvps ~]# vi /etc/sysconfig/vncservers

# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# 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 this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028

# Use “-nolisten tcp” to prevent X connections to your VNC server via TCP.

# Use “-localhost” to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the “-via” option in the
# `man vncviewer’ manual page.

VNCSERVERS=”1:jackiebui” //Uncomment 2 last lines, and edit your VNC user
VNCSERVERARGS[2]=”-geometry 800×600 -nolisten tcp -localhost” // Save and exit

启动VNC
[root@tanvps ~]# vncserver
[root@tanvps ~]# chkconfig vncserver on //设置为开机启动

接下来就可以开始使用VNC了:


输入密码:


连接成功:


注意:如出现以下错误

vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: Listening for HTTP connections on all interface(s), port 5801
vncext: created VNC server for screen 0
[dix] Could not init font path element /usr/share/X11/fonts/misc, removing from list!
[dix] Could not init font path element /usr/share/X11/fonts/Type1, removing from list!
[dix] Could not init font path element /usr/share/fonts/default/Type1, removing from list!
[dix] Could not init font path element built-ins, removing from list! Fatal server error:
could not open default font 'fixed'

请安装下列三个包解决字体问题。
yum install libXfont xorg-x11-xinit xorg-x11-fonts-Type1 
(责任编辑:IT)
------分隔线----------------------------