Vnc-server Installation and Configuration

Source: Internet
Author: User
Tags server installation and configuration

first, what is VNC?

VNC (Virtual network computer) is an abbreviation for a computer that is virtualized. VNC is an excellent remote control tool software developed by the prestigious European Research Laboratory at T. VNC is a free, open source software based on UNIX and Linux operating systems that is powerful, efficient and practical, with performance comparable to any remote control software in Windows and Macs. In Linux, VNC consists of the following four commands: VNCSERVER,VNCVIEWER,VNCPASSWD, and Vncconnect. In most cases, users only need two of these commands: Vncserver and Vncviewer.

second, the characteristics of VNC

It is also possible to remotely connect to UNIX, Linux for graphical operation and the popular XMANAGER,VNC compared to it-the two works differently, the former (VNC) is a remote connection to the operating system, all operations on the UNIX, Linux host server, even during the operation " The local computer is disconnected from the operations host network "and does not affect the smooth operation of the operations, and the latter (Xmanager) is through the port to boot the host server UI interface to the local computer for presentation, such as" Local computer and Operation host Network disconnect ", operation will be interrupted failure! If the tasks in the operation are very important and cannot be interrupted, such as the Oracle RAC implementation, the results are catastrophic! More importantly, VNC is free, open source, xmanager you may use to crack the registered version.

third, the workflow of VNC operation is as follows:

1. The VNC client connects to the VNC Server via the browser or VNC viewer.

2. VNC server transmits a conversation window to the client, requires the connection password, and accesses the VNC server display device.

3. After the client enters the online password, VNC server verifies that the client has access rights.

4. If the client authenticates with VNC server, the client requires VNC server to display the desktop environment.

5, VNC server through x Protocol require x server to display control of the screen to the VNC server responsible.

6, VNC server in the future by the X Server desktop environment using the VNC communication protocol to the client, and allows the client to control the VNC server desktop environment and input devices.

Iv. Preparation before installation:

Operating system: CentOS release 6.5 (Final)

Kernel version: 2.6.32-431.el6.x86_64

VNC Server version:

VNC Client version: Vnc-viewer-5.2.3-windows-64bit.msi

Minimize installed Linux To install the desktop environment

Yum groupinstall-y "desktop" "Desktop Platform" "Desktop Platform Development" "Fonts" "General Purpose Desktop" "Graphic Al Administration Tools "Graphics Creation Tools" "Input Methods" "X Window System" "Chinese support [zh]" "Internet brow Ser

v. Installation of Vncserver

1. Query whether to install VNC Server

# Rpm-qa |grep VNC

2, Installation Vncserver

# yum-y Install Tigervnc-server

3. Configuration resolution and User login information

# vim/etc/sysconfig/vncservers

Refer to the last two lines to add your own configuration
Vncservers= "2:root"
vncserverargs[2]= "-geometry 1024x768"

4. Configure the VNC login password

Execute the following command
# Vncserver
First prompt to set a password, according to the prompt to enter the password two times

5. Configure VNC Login Desktop mode
Centos Linux supports two graphics modes: KDE mode and GNOME mode, and if it is a GNOME desktop, you need to modify/root/.vnc/xstartup configuration dependencies
# Vim/root/.vnc/xstartup

Personal understanding above means that the user directory is required. VNC directory because I can directly connect to Linux directly via VNC viewver without configuration

Start/stop/restart of VNC

# service Vncserver Start/stop/restart

Close the specific vncserver command: Vncserver-kill:1 vncserver-kill:2

if not installed with Yum installation
yum-y Install VNC
2.
Configure the VNC user to log in as root, enter
vncpasswd
Password:
Verify:
set the root user's VNC login username and password
3. Configuring the Vnc-server configuration file

/etc/sysconfig/vncservers
The contents are as follows:
# 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'll also
# need to set a VNC password; Run ' man vncpasswd '
# to does that .
#
# do not RUN the this SERVICE if your The local area network is
# untrusted! For a secure to Usingvnc, see
#<url:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.
# Use "-nolisten TCP" to prevent X connections to your VNC server viatcp.
# Use the "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting Exceptwhen
# Doing so through a secure tunnel. seethe "-via" option in the
# ' Man vncviewer ' manual page.
vncservers= "1:root"
# vncservers= "2:myusername"
# vncserverargs[2]= "-geometry 800x600-nolisten tcp-nohttpd-localhost"
vncserverargs[1]= "-geometry 800x600"
1.vncservers= can support multiple users, separated by spaces. such as:
vncservers= "1:myusername 15:otheruser"---> here 1 and 15 are port numbers for ports when connecting
the data in the back of the 2.VNCSERVERARGS will be consistent with the value of the corresponding user behind the vncservers. It doesn't matter if it's inconsistent .
Vncserverargs Basic parameters are:
-geometry desktop size, default is 1024x768
-nohttpd do not listen on the HTTP port
-nolisten TCP does not listen on X port
-localhost only allow access from native computer
-alwaysshared Default, there can only be one Vncviewer connection (which is also related to client configuration), and once the 2nd is connected, the 1th one is disconnected. This parameter allows multiple vncviewer to be connected at the same time
-securitytypes None login does not require password Authentication vncauth default value, to password Authentication
Start Vncserver
/sbin/nvcserver Start
If there is no error, the VNC service will be activated.
4. Modify the default desktop settings
Below the. vnc directory under the root user directory, some files are generated and we now want to modify the Xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop: (remove the following lines of # to allow the desktop to be used)
unset Session_manager
EXEC/ETC/X11/XINIT/XINITRC
[-x/etc/vnc/xstartup] && exec/etc/vnc/xstartup
[-R $HOME/. Xresources] && Xrdb $HOME/. Xresources
Xsetroot-solid Grey
Vncconfig-iconic &
#xterm-geometry 80x24 10-ls-title "$VNCDESKTOP Desktop" &
#twm &---Comment out these two lines, plus
#exec Startxfce4
gnome-session
Restart Vncserver
NETSTAT-ANTPL view can be found with three ports on the monitor.
5901 5801 6001
these three ports:
by default, the VNC service listens on 3 TCP ports
RFB (Remote FrameBuffer) protocol default port: 5900 Display number
HTTP protocol default port: 5800 Display Number
x Protocol Default port: 6000 display number
Vncserver The display number used by default starts at 1, is used in turn, and can also specify the port number
We only needed the RFB protocol, so we turned off the 5800 6000 ports.
need to modify/etc/sysconfig/vncservers
Add the following parameters:
-nohttpd do not listen on the HTTP port

-nolisten TCP does not listen on X port

5. Windows Login to VNC Server

(1). Login from IE
Enter the following address directly from the IE browser:
http://xxx.xxx.xxx.xxx:5801
Enter a password to use.
(2). Login from VNC view
Install VNC view on Windows, then enter xxx.xxx.xxx.xxx:1, connect to login, and enter your password.
Note: If you are prompted for connectionrefused (10061) when you log in from VNC view, it is because of Linux firewall problems, log in to the CentOS system, select System-->preferences-->remote Desktop, tick two of the sharing, security two not tick, click Close, and then re-use VNC view login.

Vnc-server Installation and Configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.