CentOS6 5下安装远程桌面服务端软件VNC Server

本文详细介绍了如何在CentOS6系统上安装和配置VNC Server,包括安装服务、设置密码、配置用户以及解决常见错误。通过VNC Server,可以远程管理和控制计算机,使用VNC Viewer进行连接。教程中还提到了一些实用命令和服务管理方法,以及从官网下载VNC Server安装文件和连接远程服务器的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

               

VNC 使您可以远程访问和控制您的计算机从另一计算机或移动设备上,无论你在世界的任何地方。常见的使用情形,包括给同事和朋友提供桌面支持、远程管理您的服务器。

将 VNC Server部署到您想要控制计算机,使用VNC Viewer连接到你想要控制的计算机。

安装服务:

yum install tigervnc-server

这名称有点怪,没用过不知道的话是猜测不到的。

[root@localhost ~]# yum install tigervnc-serverLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * base: mirror.bit.edu.cn * extras: mirrors.yun-idc.com * updates: mirrors.yun-idc.comSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package tigervnc-server.x86_64 0:1.1.0-8.el6_5 will be installed--> Finished Dependency ResolutionDependencies Resolved=============================================================================================================================================================================================== Package                                           Arch                                     Version                                            Repository                                 Size===============================================================================================================================================================================================Installing: tigervnc-server                                   x86_64                                   1.1.0-8.el6_5                                      updates                                   1.1 MTransaction Summary===============================================================================================================================================================================================Install       1 Package(s)Total download size: 1.1 MInstalled size: 2.9 MIs this ok [y/N]: yDownloading Packages:tigervnc-server-1.1.0-8.el6_5.x86_64.rpm                                                                                                                                | 1.1 MB     00:02     Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction  Installing : tigervnc-server-1.1.0-8.el6_5.x86_64                                                                                                                                        1/1   Verifying  : tigervnc-server-1.1.0-8.el6_5.x86_64                                                                                                                                        1/1 Installed:  tigervnc-server.x86_64 0:1.1.0-8.el6_5        Complete!

运行并设置密码:

vncserver :1

注意: vncserver和:1之间必须有空格的。

输入密码,会生成相关的文件

[root@localhost ~]# vncserver :1You will require a password to access your desktops.Password:Verify:xauth:  creating new authority file /root/.XauthorityNew 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1Creating default startup script /root/.vnc/xstartupStarting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost.localdomain:1.log

配置用户

vim /etc/sysconfig/vncservers  

最后一行加入:

VNCSERVERS="1:root" 多个用户用空格分开


实用命令

usage: vncserver [:<number>] [-name <desktop-name>] [-depth <depth>]
                 [-geometry <width>x<height>]
                 [-pixelformat rgbNNN|bgrNNN]
                 [-fp <font-path>]
                 [-fg]
                 <Xvnc-options>...
       vncserver -kill <X-display>
       vncserver -list
vncserver[:n]开服务
vncserver -list看有几个在运行
vncserver -kill :n   杀掉第几个x-display
vncpasswd           修改密码

服务管理

service vncserver restart
其它用法:/etc/init.d/vncserver {start|stop|restart|try-restart|status|force-reload}
chkconfig vncserver on 加入到自启动(chkconfig --level 35 vncserver on)

客户端连接
CentOS:使用TigerVNC Viewer 连接 ip:1
Windows:使用Real VNC Viewer 连接ip:1
输入密码即可访问

错误记录及解决方案:

错误记录:[root@localhost media]# service vncserver startStarting VNC server: 1:root WARNING: The first attempt to start Xvnc failed, possibly because the fontcatalog is not properly configured.  Attempting to determine an appropriatefont path for this system and restart Xvnc using that font path ...Could not start Xvnc./usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids                                                           [FAILED]解决方案:yum install pixman pixman-devel libXfont错误记录:[root@localhost /]# vncserver :1WARNING: The first attempt to start Xvnc failed, possibly because the fontcatalog is not properly configured.  Attempting to determine an appropriatefont path for this system and restart Xvnc using that font path ...Could not start Xvnc._XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running解决过程:ps aux |grep -i "xorg|x11"yum -y groupinstall "GNOME Desktop Environment"  CentOS6.5下不能用。yum groupinstall "X Window System" "KDE (K Desktop Environment)"rm -rf /tmp/.X11-unix错误记录:[root@hn opt]# vncserver :1Warning: hn.kd.ny.adsl:1 is taken because of /tmp/.X1-lockRemove this file if there is no X server hn.kd.ny.adsl:1A VNC server is already running as :1[root@hn opt]# cp /tmp/.X1-lock X1-lock.bak[root@hn opt]# rm -rf /tmp/.X1-lock[root@hn opt]# vncserver :1Warning: hn.kd.ny.adsl:1 is taken because of /tmp/.X11-unix/X1Remove this file if there is no X server hn.kd.ny.adsl:1A VNC server is already running as :1[root@hn opt]# vncserver :1Warning: hn.kd.ny.adsl:1 is taken because of /tmp/.X11-unix/X1Remove this file if there is no X server hn.kd.ny.adsl:1A VNC server is already running as :1[root@hn opt]# rm -rf /tmp/.X11-unix/X1[root@hn opt]# vncserver :1xauth:  creating new authority file /root/.XauthorityWARNING: The first attempt to start Xvnc failed, possibly because the fontcatalog is not properly configured.  Attempting to determine an appropriatefont path for this system and restart Xvnc using that font path ...Could not start Xvnc._XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running正在启动 VNC 服务器:1:root WARNING: The first attempt to start Xvnc failed, possibly because the fontcatalog is not properly configured.  Attempting to determine an appropriatefont path for this system and restart Xvnc using that font path ...Could not start Xvnc._XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running                                                           [失败]正在启动 VNC 服务器:1:root WARNING: The first attempt to start Xvnc failed, possibly because the fontcatalog is not properly configured.  Attempting to determine an appropriatefont path for this system and restart Xvnc using that font path ...Could not start Xvnc._XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running                                                           [失败]执行:setup 命令没有需要的选项;以下为2014年10月21日安装VNCServer遇到的问题及解决方法错误记录:[root@hn]# service vncserver restart关闭 VNC 服务器:                                          [确定]正在启动 VNC 服务器:1:root Warning: hn.kd.ny.adsl:1 is taken because of /tmp/.X1-lockRemove this file if there is no X server hn.kd.ny.adsl:1A VNC server is already running as :1                                                           [失败][root@hn]# find -name hn.kd.my.ads1:1[root@hn]# rm -rf /tmp/.X1-lock[root@hn]# [root@hn]# [root@hn]# service vncserver restart关闭 VNC 服务器:                                          [确定]正在启动 VNC 服务器:1:root Warning: hn.kd.ny.adsl:1 is taken because of /tmp/.X11-unix/X1Remove this file if there is no X server hn.kd.ny.adsl:1A VNC server is already running as :1                                                           [失败][root@hn]# rm -rf /tmp/.X11-unix/X1[root@hn]# service vncserver restart关闭 VNC 服务器:                                          [确定]正在启动 VNC 服务器:1:root WARNING: The first attempt to start Xvnc failed, possibly because the fontcatalog is not properly configured.  Attempting to determine an appropriatefont path for this system and restart Xvnc using that font path ...Could not start Xvnc._XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed_XSERVTransMakeAllCOTSServerListeners: server already runningFatal server error:Cannot establish any listening sockets - Make sure an X server isn't already running                                                           [失败][root@hn]# 解决方案:[root@hn]# init 3[root@hn]# service vncserver restart关闭 VNC 服务器:                                          [确定]正在启动 VNC 服务器:1:root New 'hn.kd.ny.adsl:1 (root)' desktop is hn.kd.ny.adsl:1Creating default startup script /root/.vnc/xstartupStarting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/hn.kd.ny.adsl:1.log                                                           [确定][root@hn]# 

如何从官网下载VNC Server服务端安装文件

如何使用VNC Viewer连接远程CentOS服务器



           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.youkuaiyun.com/jiangjunshow

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值