Configure VNC in RHEL5

Source: Internet
Author: User
Configure vnc under RHEL (linux environment is RedHat Enterprise 5.3) to see If VNC related software packages are installed # rpm-qa | the grepvncvnc-server-4.1.2-14.el5vnc-4.1.2-14.el5 indicates that the vnc service has been installed. If not installed, use the second disc and run the following command: # rpm-ivh/mnt/Server/vnc-server-4.1.2-14.el5.i38

Configure vnc in RHEL (RedHat Enterprise 5.3 in linux)
Check whether VNC software packages are installed.
# Rpm-qa | grep vnc

Vnc-server-4.1.2-14.el5
Vnc-4.1.2-14.el5
Indicates that the vnc service has been installed.
If the installation is not complete, use the second disc and run the following command:
# Rpm-ivh/mnt/Server/vnc-server-4.1.2-14.el5.i386.rpm
Configure vcn services
If you configure the VNC Server for the first time, the password used to log on to the VNC is required. You can also use vncpasswd to change the password later.Each user connects to a desktop. If you need to configure the VNC service for multiple users, the VNC service for different users only has different desktop numbers.. To enable a desktop numbered 1, perform the following configurations:
[Root @ localhost ~] # Vncserver: 1
You will require a password to access your tops.
Password:// My password is vncserver
Verify:// My password is vncserver
Relationship between the port number used by the VNC service and the desktop number
The port number used by the VNC service is related to the desktop number. The VNC uses the TCP port starting from 5900. The corresponding relationship is as follows:
Desktop number is "1" ---- port number is 5901
Desktop number "2" ---- port number is 5902
Desktop number "3" ---- port number is 5903
........
The TCP port of the Java-based VNC client Web service starts from 5800 and is also related to the desktop number. The corresponding relationship is as follows:
Desktop number is "1" ---- port number is 5801
Desktop number "2" ---- port number is 5802
Desktop number "3" ---- port number is 5803

....... .
Based on the above introduction, if the firewall function is enabled in Linux, You need to manually enable the corresponding port. Take the port "1" as an example. When configuring the redhat vncserver, the default port number 5900 + 1 is not added to the firewall. When vncviewer is used to connect to vncserver, it will be blocked by the firewall. The following configurations are required:
# Iptables-I INPUT-p tcp -- dport 5801-j ACCEPT
# Iptables-I INPUT-p tcp -- dport 5901-j ACCEPT
#/Etc/init. d/iptables save
#/Etc/init. d/iptables restart
Configure the VNC graphic desktop environment as KDE or GNOME Desktop Environment
If you configured it according to my above method, it would be very simple to log on to the desktop and only one Shell is available. Why? How can we see the cute and beautiful KDE or GNOME desktop environment? The answer is as follows:
The reason is ugly because the VNC service uses the twm graphical desktop environment by default. You can modify it in the VNC configuration file xstartup. To start the gnome desktop, you can perform the following Configuration:
# Cat $ HOME/. vnc/xstartup

#! /Bin/sh
# Uncomment the following two lines for normal desktop:
Unset SESSION_MANAGER// Cancel SESSION_MANAGER variable
Exec/etc/X11/xinit/xinitrc// Set the desktop environment
[-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 "&
Gnome-session &
If you use kde Desktop, change twn to startkde;
Restart the vncserver service
# Vncserver-kill: 1
# Vncserver: 1
# Vncserver-geometry 800x600Set vncserver resolution
# Vncserver-depth 32Set vncserver color depth
Set the VNC service to take effect permanently and automatically load as the system starts

In addition to $ HOME/. vnc/xstartupAndConfigure iptablesEdit/Etc/sysconfig/vncservers File
# Grep-v ^ #/etc/sysconfig/vncservers
VNCSERVERS = "1: root 2: Oracle" // 2
VNCSERVERARGS [2] = "-geometry 800x600-nolisten tcp-nohttpd-localhost"


Restart the vnc service

#/Etc/init. d/vncserver Restart
Run the "chkconfig" command to set the vnc to automatically start upon startup.
# Chkconfig-level 12345 vncserver on
# Chkconfig -- list vncserver
Vncserver 0: off 1: off 2: on 3: on 4: on 5: on 6: off

VNC service disconnection from the Fedora client to RHEL5

# Yum install vnc

Run vncviewer xxx. xxx: 1 to connect. xxx. xxx is the ip address of the Service port.

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.