Configuring VNC under Linux

Source: Internet
Author: User

Environment: REDHAT 5


1. Check if VNC is installed:
Rpm-qa Vnc-server

Vnc-server-4.1.2-9.el5


if not installed, install:
Yum Install Vnc-server


2. Configure the Vncserver login password:
[Email protected] ~]# Vncserver


You'll require a password to access your desktops.


Password:
Verify:
Xauth:creating new Authority file/root/. Xauthority

New ' redhat:1 (root) ' Desktop is redhat:1

Creating default startup Script/root/.vnc/xstartup
Starting applications specified In/root/.vnc/xstartup
Log file Is/root/.vnc/redhat:1.log


3. Configure the Vncserver boot file:
VI ~/.vnc/xstartup

Modified file:


#!/bin/sh
# Uncomment the following-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" &
# TWM &
Gnome-session &


4. Configuring the Vncservers File
Vi/etc/sysconfig/vncservers
Modified file:
# 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 see how
# to does that.
#
# do not RUN the this SERVICE if your the local area network is
# untrusted! For a secure-to-the-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 the "-nohttpd" to prevent web-based VNC clients connecting.
# use "-localhost" to prevent remote VNC clients connecting except when
# Doing so through a secure tunnel. See the '-via ' option in the
# ' Man vncviewer ' manual page.
# vncservers= "2:myusername"
# vncserverargs[2]= "-geometry 800x600-nolisten tcp-nohttpd-localhost"
Vncservers= "1:root"
vncserverargs[1]= "-geometry 1024x768-nolisten tcp-nohttpd-localhost"


5. Turn off the firewall
Service Iptables Stop
or open VNC port:
/sbin/iptables-i input-p TCP--dport 5801-j ACCEPT
/sbin/iptables-i input-p TCP--dport 5900:5903-j ACCEPT
/etc/rc.d/init.d/iptables Save
/etc/init.d/iptables restart


6. Kill the current process:
Vncserver-kill:1
Vncserver-kill:2
...

7. Start Vncserver
[Email protected] ~]# Vncserver

New ' redhat:1 (root) ' Desktop is redhat:1

Starting applications specified In/root/.vnc/xstartup
Log file Is/root/.vnc/redhat:1.log



8. Connect via browser (JAVA):
http://192.168.65.131:5801/




9. Connect via the VNC Viewer client:
192.168.65.131:1


Follow the prompts to enter the previously configured login password to open!




PS: Problems that may occur:


A, black screen
Installed in Linux in the configuration of the VNC server, the discovery of multi-user login will appear black screen situation, the specific phenomenon is:
The client can enter the system via IP to the session number, but landing in is dark, except for a forked mouse, pitch.


Cause: The user's VNC startup file permissions are not set correctly.
Workaround: Modify the properties of the black screen user's Xstartup (typically:/home/user name/.vnc/xstartup) file to 755 (rwxr-xr-x).


B, VNC can enter a number, but cannot enter the letter
Reason: VNC server will require VNC viewer this side of the OS's input method to be the same as the VNC Server OS language.
Workaround: Generally we install the Linux OS are e-text, so when using the VNC Viewer connection, please close the local OS Chinese input method, switch to English can be.


--------------------------------

Dylan presents.



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.