Configuring VNC under Linux

  
        Environment: REDHAT 51. Check if VNC is installed: rpm -qa vnc-server

vnc-server-4.1.2-9.el5
If it is not installed, install it: yum install vnc-server2. Configure vncserver login Password: [root@Redhat ~]# vncserverYou will require a password to access your desktops.Password:Verify:xauth: creating new authority file /root/.XauthorityNew 'Redhat:1 (root)' desktop is Redhat:1Creating default startup script /root/.vnc/xstartupStarting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/Redhat:1.log3. Configure the vncserver startup file: vi ~/.vnc/xstartup

Modified file:
#!/bin/sh# Uncomment the following two lines for normal desktop:unset SESSION_MANAGERexec /etc/X11/xinit/xinitrc[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresourcesxsetroot -solid greyvncconfig -iconic &xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &# twm & Gnome-se Ssion & 4. Configure 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 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 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" VN CSERVERARGS[1]="-geometry 1024x768 -nolisten tcp -nohttpd -localhost"5. Turn off 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 restart6. Kill the current process: vncserver -kill :1vncserver - Kill :2...7. Start vncserver[root@Redhat ~]# vncserverNew 'Redhat:1 (root)' desktop is Redhat:1Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/Redhat :1.log8. Connect via browser (JAVA): http://192.168.65.131:5801/9. Connect via VNC Viewer client: 192.168.65.131:1 Enter the login password configured before you can open it!

PS: Possible problems:

a, black screen Install and configure the VNC server in Linux, and find that there are black screens when multiple users log in. The specific phenomenon is: The client can pass IP and The session number logged into the system, but the landing was dark, except for a fork-shaped mouse. Cause: The user's VNC startup file permissions are not set correctly. Solution: Change the attribute of the xstartup (usually: /home/username/.vnc/xstartup) file of the black screen user to 755 (rwxr-xr-x). b, vnc can input numbers, but can not input letters. Reason: vnc server will require the input method of the OS of the vnc viewer to be the same as the language of the OS of the vnc server. Solution: Generally, the Linux OS we installed is E-text, so when using vnc viewer, please close the Chinese input method of the local OS and switch to English.

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

Dylan Presents.
zh-CN"],null,[0.92196411],zh-CN"]]]

Copyright © Windows knowledge All Rights Reserved