一般安装DB的时候会有图形界面的需求,而Xshell方式连接对图形界面支持不太友好,直接连接也容易因为网络故障导致安装失败。 所以正常都会在服务器上启一个VNC Server,然后通过VNC 客户端连接后安装,这个整个安装过程都在服务器,即使网络异常也不会影响到安装过程。
1 安装VNC server
系统默认不会安装VNC server。 这里看下安装过程。
先配置好本机的yum 源。 参考:
Linux 平台下 YUM 源配置 手册
http://www.cndba.cn/dave/article/154
[root@www.cndba.cn ~]# yum search vnc
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
======================================================== N/S matched: vnc ========================================================
gtk-vnc2.i686 : A GTK3 widget for VNC clients
gtk-vnc2.x86_64 : A GTK3 widget for VNC clients
gvnc.i686 : A GObject for VNC connections
gvnc.x86_64 : A GObject for VNC connections
libvncserver.i686 : Library to make writing a vnc server easy
libvncserver.x86_64 : Library to make writing a vnc server easy
tigervnc.x86_64 : A TigerVNC remote display system
tigervnc-icons.noarch : Icons for TigerVNC viewer
tigervnc-license.noarch : License of TigerVNC suite
tigervnc-server.x86_64 : A TigerVNC server
tigervnc-server-minimal.x86_64 : A minimal installation of TigerVNC server
kdenetwork-krdc.x86_64 : A client for Desktop Sharing and other VNC servers
kdenetwork-krfb.x86_64 : Desktop Sharing server, allow others to access your desktop via VNC
vinagre.i686 : VNC client for GNOME
vinagre.x86_64 : VNC client for GNOME
Name and summary matches only, use "search all" for everything.
[root@www.cndba.cn ~]# yum install tigervnc-server.x86_64 -y
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package tigervnc-server.x86_64 0:1.3.1-9.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================
Installing:
tigervnc-server x86_64 1.3.1-9.el7 cndba.cn 203 k
Transaction Summary
==================================================================================================================================
Install 1 Package
Total download size: 203 k
Installed size: 493 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : tigervnc-server-1.3.1-9.el7.x86_64 1/1
Verifying : tigervnc-server-1.3.1-9.el7.x86_64 1/1
Installed:
tigervnc-server.x86_64 0:1.3.1-9.el7
Complete!
[root@www.cndba.cn ~]# vncserver
You will require a password to access your desktops.
Password:
Verify:
Warning: www.cndba.cn:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server www.cndba.cn:1
New 'www.cndba.cn:2 (root)' desktop is www.cndba.cn:2
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/www.cndba.cn:2.log
这里因为是第一次使用,所以提示输入密码。如果不是第一次,且又忘记了密码可以通过如下命令修改密码:
[root@www.cndba.cn ~]# vncpasswd
Password:
Verify:
[root@www.cndba.cn ~]#
2 客户端连接
通过VNC客户端连接的时候通过启动服务的提示进行:
New 'www.cndba.cn:2 (root)' desktop is www.cndba.cn:2
注意这里冒号后面的部分:2. 如果启动多次,这部分会发生变化。 所以注意查看这个数字。如果连不上注意网络和防火墙。
3 关闭VNC Server
如果想停止VNC,使用vncserver命令:
[root@www.cndba.cn ~]# vncserver -help
usage: vncserver [:<number>] [-name <desktop-name>] [-depth <depth>]
[-geometry <width>x<height>]
[-pixelformat rgbNNN|bgrNNN]
[-fp <font-path>]
[-cc <visual>]
[-fg]
[-autokill]
<Xvnc-options>...
vncserver -kill <X-display>
vncserver -list
[root@www.cndba.cn ~]# vncserver -help
[root@www.cndba.cn ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:2 9846
:3 10555
[root@www.cndba.cn ~]# vncserver -kill :3
Killing Xvnc process ID 10555
Xvnc process ID 10555 already killed
[root@www.cndba.cn ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:2 9846
[root@www.cndba.cn ~]#
版权声明:本文为博主原创文章,未经博主允许不得转载。