Centos vnc configuration notes

Source: Internet
Author: User

 

1. First, check whether the VNC Server is installed.
Rpm-qa | grep vnc
For example:
Vnc-server-
Vnc-server has been installed.
Use yum if not installed
Yum-y install vnc

2. Configure the VNC user. If the user logs on as root, enter

Vncpasswd
Password:
Verify:
Set the root user's VNC logon username and password

3. Configure the vnc-server configuration file

/Etc/sysconfig/vncservers
The content is 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 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
# <URL: http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

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

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting tables t when
# Doing so through a secure tunnel. See the "-via" option in
# 'Man vncviewer 'manual page.
VNCSERVERS = "1: root"
# VNCSERVERS = "2: myusername"
# VNCSERVERARGS [2] = "-geometry 800x600-nolisten tcp-nohttpd-localhost"
VNCSERVERARGS [1] = "-geometry 800x600"

1. VNCSERVERS = multiple users can be added to the backend and separated by spaces. For example:
VNCSERVERS = "1: myusername 15: otheruser" ---> here, "1" and "15" are the port numbers used for connection.
2. The data in [] After VNCSERVERARGS must be consistent with the value of the user corresponding to VNCSERVERS. It seems that inconsistency does not matter.
Basic VNCSERVERARGS parameters include:
-Geometry desktop size. The default value is 1024x768.
-Nohttpd does not listen to HTTP ports
-Nolisten tcp does not listen to port X
-Localhost only allows access from the Local Machine
-AlwaysShared: by default, only one vncviewer connection is allowed at the same time (also related to client configuration). Once 2nd connections are connected, 1st are disconnected. This parameter allows multiple vncviewer connections at the same time.
-SecurityTypes None password authentication is not required for Logon. The default value is VncAuth. password authentication is required.

Start vncserver
/Sbin/nvcserver start
If no error occurs, the vnc service will be started.

4. Modify the default desktop settings
Some files will be generated under the. vnc directory under the root user directory. Now we need to modify xstartup
#! /Bin/sh
# Uncomment the following two lines for normal desktop: (remove the following two lines # You can use the desktop)
Unset SESSION_MANAGER
Exec/etc/X11/xinit/xinitrc
[-X/etc/vnc/xstartup] & exec/etc/vnc/xstartup
[-R $ HOME/. Xresources] & xrdb $ HOME/. Xresources
Xsetroot-solid gray
Vncconfig-iconic &
# Xterm-geometry 80x24 10 10-ls-title "$ VNCDESKTOP Desktop "&
# Twm & --- comment out the two lines and add
# Exec startxfce4
Gnome-session

Restart vncserver

View netstat-antpl and check that three ports are listening.
5901 5801 6001
These three ports:
By default, the vnc service listens to three TCP ports.
RFB (Remote FrameBuffer) protocol default port: 5900 display number
Default HTTP port: 5800 display number
X protocol default port: 6000 display number
The display number used by the vncserver starts from 1 by default. You can also specify the port number.
We only need the RFB Protocol, so we can turn off the two ports 5800 6000.
/Etc/sysconfig/vncservers to be modified
Add the following after the parameter:
-Nohttpd does not listen to HTTP ports

-Nolisten tcp does not listen to port X

 

5. log on to the VNC Server in Windows 

(1). Log On from IE
Enter the following address in IE:

Http://xxx.xxx.xxx.xxx: 5801

Enter the password.

(2). Log On from VNC view

Install vnc view on windows, enter xxx. xxx: 1, connect to log on, and enter the password.

NOTE: If connection refused (10061) is prompted when you log on from the vnc view, it is because of a linux Firewall problem. log on to the centos System and select System --> Preferences --> Remote Desktop, check the two items in sharing. If the two items are not checked, click Close and log on again with vnc view.

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.