[Linux] VNC RedHat Configuration and use __linux

Source: Internet
Author: User

Environment: RedHat Linux 6 Enterprise Edition.
Xwindows:gnome (Red Hat Default-installed graphical interface)

Although we can use the SSH connection remotely through the character interface to operate Linux, but for more familiar with the graphics people is very inconvenient,

So it is necessary to open a remote Desktop for Linux. There are two popular ways: the XDM (X display manager) scenario

and VNC solutions, and I personally prefer the VNC scheme, one is because the VNC scheme is relatively easy to configure, and the second is the VNC program support more

Connection, such as access to the Linux desktop through the browser, eliminates the need to install the client's trouble.


Next go to the specific configuration instructions:

First, confirm and install Vncserver.

1, first confirm that your server is configured with Vncserver, you can at the command line to be typed below command to view:

[root@localhost: ~] #rpm-qa |grep VNC

vnc-server-4.1.2-14.el5_3.1.i386.rpm #返回VNCSEVER服务器端版本说明你已经安装了VNCSERVER.

2, if the Vncsever is not installed, then find the installation package from the CD to install.

First mount the disc (also called decompression) to a directory where the RHEL5-64 directory is established under/var/ftp/pub/

Mount-o Loop rhel-server-5.3-x86_64-dvd.iso/var/ftp/pub/rhel5-64/

Then find the VNC-SERVER-4.1.2-14.EL5.X86_64.RPM installation package in the/var/ftp/pub/rhel5-64/server directory (you can also use the address:

http://centos.ustc.edu.cn/centos/5.5/os/i386/CentOS/vnc-server-4.1.2-14.el5_3.1.i386.rpm download), use

RPM command directly installed;

RPM-IVH vnc-server-4.1.2-14.el5_3.1.i386.rpm


Second, start configuring Vncserver

1, start Vncserver, the first start vncserver will prompt input password, here is divided into the administrator account and the ordinary account, start the way

Slightly different.

Administrator:

[Root@localhost/]# Vncserver

You'll require a password to access your desktops.

password:123456 #输入vnc Connection Password

verify:123456 #确认vnc密码

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


Ordinary User:

[Root@localhost/] #su ceboy #ceboy is the user name
[Ceboy@localhost/]$ Vncserver

You'll require a password to access your desktops.

password:123456 #输入vnc Connection Password

verify:123456 #确认vnc密码

Xauth:creating new Authority file/home/ceboy/. Xauthority

New ' Localhost.localdomain:2 (ceboy) ' Desktop is Localhost.localdomain:2

Creating default startup Script/home/ceboy/.vnc/xstartup
Starting applications specified In/home/ceboy/.vnc/xstartup
Log file Is/home/ceboy/.vnc/localhost.localdomain:2.log

#这里要注意: Each user can start their own vncserver Remote Desktop, while each user can start multiple vncserver far

Desktop, they use IP plus port number: ip:1, Ip:2, ip:3 to identify, distinguish, using the same port will make the other logged-on user automatically

Exit. In addition, most of the Vncserver configuration files and log files are in the user's home directory. VNC directory.

Users can customize startup numbers such as:

[Ceboy@localhost/]$ vncserver:2 #注意: 2 must be preceded by a space.
A VNC Server is already running As:2

Third, related desktop configuration, RedHat Linux supports two graphics modes: KDE mode and GNOME mode.

1, your RH use of what graphics mode this generally only login to the graphical interface to see if you can know, or through the PS-A command list

All currently running programs to see if there are any KDE or gnome words to judge.

If you are GNOME desktop, then you need to modify the/root/.vnc/xstartup configuration file.

[Root@localhost. vnc]# VI Xstartup

#!/bin/sh

# Uncomment the following two lines for normal 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 Grey

Vncconfig-iconic &

Xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop" &

Gnome-session Gnome #添加这一句是连接时使用gnome Desktop environment

TWM &

The setup modification is completed preferably by restarting the system, otherwise the settings will not take effect. The method I used was to kill the vncserver process and rerun it.

Vncserver.

[Root@localhost. vnc] #vncserver-kill:1 #这里你启动vncserver时是什么端口号要对应上.
[Root@localhost. VNC] #vncserver: 1 #重启VNCSERVER, note: 1 must be preceded by a space.

2, set the user information and resolution.

[root@localhost: ~] #vi/etc/sysconfig/vncservers

# 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 ' Mans vncpasswd ' to

# to doing that.

#

# do don't RUN this SERVICE if your the local area network is

# untrusted! For a secure way of using VNC, the

# <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 except when

# Doing so through a secure tunnel. The "-via" option in the

# ' Man vncviewer ' manual page.

vncservers= "1:root 2:ceboy" #此处添加用户, usually only add a 1:root also on the line.

vncserverargs[1]= "-geometry 800x600-nolisten tcp-nohttpd-localhost"
vncserverargs[2]= "-geometry 1024x768-nolisten tcp-nohttpd-localhost"

#注意: The above is the resolution of the root and Ceboy two users respectively, and the note is distinguished by the port number.

In addition, you can temporarily modify the resolution and color depth through the command line, this way will be lost after restarting, here for the time being, the command is as follows:

[root@localhost: ~] #vncserver-geometry 800x600 #设置vncserver的分辨率

[root@localhost: ~] #vncserver-depth #设置vncserver的色深

Here the Vncserver server side is configured to complete.

Four, client connection and use.

1, Access mode
A, under Linux, run the vncviewer command, the server address is written in the form of 192.168.1.11:1
b, under Windows, run the Windows version of the Vncviewer, the usage is similar to Linux.
C, with the browser (platform-independent), as a Java applet to implement, in a form like http://192.168.1.11:5801 to start

(VNC ports are 5800,5900 from 5800, which is usually the same as the first)


Here are some common sense:

2, modify the password

Run VNCPASSWD can

3, Stop Vncserver

#vncserver-kill:1
#vncserver-kill:2

Note that vncserver can only be turned off by the user who started it, and that Root does not shut down other user-initiated vncserver, only

Kill orders violence to kill the process.

4, stability setting

Vncserver default when multiple clients connect to the same vncserver display port, the Vncserver port old connection, and the new connection clothing

, you can keep the old connection by-dontdisconnect rejecting the new connection request.

5, the same monitor can connect multiple clients

#vncserver-alwaysshared

6, restart the service

Service Vncserver Restart

7, let the system start automatically when the Vncserver.

Login to the Redhat Linux graphical interface using VNC connection, click on "System"--"manage"--"Server Settings"--"service

, check it after you find vncserver in the background service, and click Save.


Reprint: http://jsx112.iteye.com/blog/1032842

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.