VNC 使您可以远程访问和控制您的计算机从另一计算机或移动设备上,无论你在世界的任何地方。常见的使用情形,包括给同事和朋友提供桌面支持、远程管理您的服务器。
将 VNC Server部署到您想要控制计算机,使用VNC Viewer连接到你想要控制的计算机。
安装服务:
yum install tigervnc-server
这名称有点怪,没用过不知道的话是猜测不到的。
-
[root@localhost ~]# yum install tigervnc-server
-
Loaded plugins: fastestmirror, refresh-packagekit, security
-
Loading mirror speeds from cached hostfile
-
* base: mirror.bit.edu.cn
-
* extras: mirrors.yun-idc.com
-
* updates: mirrors.yun-idc.com
-
Setting up Install Process
-
Resolving Dependencies
-
--> Running transaction check
-
---> Package tigervnc-server.x86_64 0:1.1.0-8.el6_5 will be installed
-
--> Finished Dependency Resolution
-
-
Dependencies Resolved
-
-
===============================================================================================================================================================================================
-
Package Arch Version Repository Size
-
===============================================================================================================================================================================================
-
Installing:
-
tigervnc-server x86_64 1.1.0-8.el6_5 updates 1.1 M
-
-
Transaction Summary
-
===============================================================================================================================================================================================
-
Install 1 Package(s)
-
-
Total download size: 1.1 M
-
Installed size: 2.9 M
-
Is this ok [y/N]: y
-
Downloading Packages:
-
tigervnc-server-1.1.0-8.el6_5.x86_64.rpm | 1.1 MB 00:02
-
Running rpm_check_debug
-
Running Transaction Test
-
Transaction Test Succeeded
-
Running 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!
[root@localhost ~]# yum install tigervnc-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tigervnc-server.x86_64 0:1.1.0-8.el6_5 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================================================
Installing:
tigervnc-server x86_64 1.1.0-8.el6_5 updates 1.1 M
Transaction Summary
===============================================================================================================================================================================================
Install 1 Package(s)
Total download size: 1.1 M
Installed size: 2.9 M
Is this ok [y/N]: y
Downloading Packages:
tigervnc-server-1.1.0-8.el6_5.x86_64.rpm | 1.1 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running 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 :1
-
-
You will require a password to access your desktops.
-
-
Password:
-
Verify:
-
xauth: creating new authority file /root/.Xauthority
-
-
New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1
-
-
Creating default startup script /root/.vnc/xstartup
-
Starting applications specified in /root/.vnc/xstartup
-
Log file is /root/.vnc/localhost.localdomain:1.log
[root@localhost ~]# vncserver :1
You will require a password to access your desktops.
Password:
Verify:
xauth: creating new authority file /root/.Xauthority
New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log 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
输入密码即可访问
错误记录及解决方案:
(责任编辑:IT) |