Remote control between LINUX and windows using VNC

Source: Internet
Author: User
Tags gstreamer
Use VNC to implement remote control between LINUX and windows. 1. check whether VNC is installed in linux. by default, the RedHatEnterpriseLinux installer installs the VNC service on the system. [Root @ localhost ~] # Rpm-qa | grepvncvnc-server-4.1.2-9...
Use VNC to implement remote control between LINUX and windows. 1. check whether VNC is installed in linux. by default, the Red Hat Enterprise Linux installer installs the VNC service on the system. [Root @ localhost ~] # Rpm-qa | grep vncvnc-server-4.1.2-9.el5 www.2cto.com [root @ localhost ~] #2. [root @ localhost ~] # When service vncserver start is started for the first time, the system will prompt you to enter the password, which is the verification password required by the client to log on to the VNC server. After the vncserver service is started, the. vnc directory is generated in the current user's home directory, as shown below:
[Root @ localhost ~] # Ls-.. cshrc. gnome2. metacity. vnc .. desktop. gnome2_private. mozilla. xauthorityanaconda-ks.cfg. dmrc. gstreamer-0.10. nautilus. xsession-errors.bash_history. eggcups. gtkrc-1.2-gnome2. redhat. bash_logout. gconf. ICEauthority. tcshrc. bash_profile. gconfd install. log. trash. bashrc. gnome install. log. syslog. twmjtHtnR [root @ localhost ~] # [Root @ localhost. vnc] # lslocalhost. localdomain: 1.log localhost. localdomain: 1.pid passwd xstartup [root @ localhost. vnc] # because the service is executed for the first time, you need to enter a password, which is encrypted and saved in the user's main directory. vnc subdirectory (/root /. in vnc/passwd. in the vnc subdirectory, the xstartup configuration file (/root /. vnc/xstartup), the configuration information in this file is read every time the VND service is started. :/Root /. there is also a "testdb: 1. pid file, which records the process number corresponding to the operating system the day after the VNC is started, used to accurately locate the process number when the VNC service is stopped.
3. the 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 TCP port number used by the VNC starts from 5900, the corresponding relationship is as follows: desktop number is "1" ---- port number is 5901 desktop number is "2" ---- port number is 5902 desktop number is "3" ---- port number is 5903 ...... The TCP port of 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 is "2" ---- port number is 5802 desktop number is "3" ---- port number is 5803
4. to log on to the linux GUI, you need to modify the configuration file: [root @ testdb ~] # Vi/root/. vnc/xstartup #! /Bin/sh www.2cto.com # 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 &
5: how to restart the vncserver service: [root @ testdb ~] # Vncserver-kill: 1 [root @ testdb ~] # Vncserver: 1 configure the VNC server on the linux host with the IP address 192.168.1.234: [root @ localhost ~] # Rpm-qa | grep vncvnc-server-4.1.2-9.el5 [root @ localhost ~] # Vncserver: 1You will require a password to access your tops. password: Verify: you can use vncpasswd to modify the xauth: creating new authority file/root /. xauthorityNew 'localhost. localdomain: 1 (root) 'desktop is localhost. localdomain: 1 Creating default startup script/root /. vnc/xstartupStarting applications specified in/root /. vnc/xstartupLog file is/root /. vnc/localhost. localdomain: 1.log[ root @ localhost ~] # Ls-.. bashrc. gconfd. ICEauthority. tcshrc... cshrc. gnome install. log. trashanaconda-ks.cfg Desktop. gnome2 install. log. syslog. vnc. bash_history. dmrc. gnome2_private. metacity. xauthority. bash_logout. eggcups. gstreamer-0.10. nautilus. xsession-errors.bash_profile. gconf. gtkrc-1.2-gnome2. redhat [root @ localhost ~] # Cd. vnc/www.2cto.com [root @ localhost. vnc] # lslocalhost. localdomain: 1.log localhost. localdomain: 1.pid passwd xstartup [root @ localhost. vnc] # lltotal 16-rw-r -- r -- 1 root 556 May 19 10:28 localhost. localdomain: 1. log-rw-r -- 1 root 5 May 19 10:28 localhost. localdomain: 1. pid-rw ------- 1 root 8 May 19 passwd-rwxr-xr-x 1 root 334 May 19 xstartup [root @ localhost. vnc] # [r Oot @ localhost. vnc] # netstat-ntpl | grep vnctcp 0 0 0.0.0.0: 5801 0.0.0.0: * LISTEN 3480/Xvnc tcp 0 0 0.0.0.0: 5901 0.0.0.0: * LISTEN 3480/Xvnc tcp 0 0 0.0.0.0: 6001 0.0.0.0: * LISTEN 3480/Xvnc tcp 0 ::: 6001 ::: * LISTEN 3480/Xvnc do not forget to disable the firewall. Install the VNC client on a windows host: install the Enterprise edition VNC (including the server side and client side). at this time, you can use the client vnc viewer to remotely run the linux VNC server, currently, only linux character interfaces can be used. Note that the access is 192.168.1.234: 1. if you want to use the GUI, you must modify the configuration file [root @ localhost. vnc] # vi xstartup #! /Bin/sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER www.2cto.com # exec/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 &
After removing the comments from the above two lines, restart VNCSERVER [root @ localhost. vnc] # vncserver-kill: 1 Killing Xvnc process ID 3480 [root @ localhost. vnc] # vncserver: 1new'localhost. localdomain: 1 (root) 'desktop is localhost. localdomain: 1 Starting applications specified in/root /. vnc/xstartupLog file is/root /. vnc/localhost. localdomain: 1.log[ root @ localhost. vnc] # Use the vnc viewer on xp to remotely access the linux GUI. The second method is to use a Web browser (such as Firefox, IE, Safari) to log on to the test. The operation procedure is as follows: http://192.168.1.234:5801/ --> The VNC viewer for Java (this tool is a VNC client program written in Java) interface is displayed. in The VNC viewer dialog box that appears, enter "192.168.1.234: 1 "click" OK "--> Password enter login Password --> click" OK "to log on to the X-Window graphic desktop environment --> The test is successful (note: VNC viewer for Java requires JRE support. if the page cannot be displayed, it indicates that JRE is not installed. http://java.sun.com/javase/downloads/index_jdk5.jsp Download the latest JRE and install it on the client ). # Vi/etc/sysconfig/vncservers, The following is The file content: # The VNCSERVERS variable is a list of display: user pairs. # Uncomment the line below to start a VNC server on display: 1 # 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 #. www.2cto.com VNCSERVERS = "1: user1 2: user2 3: user3 "VNCSERVERARGS [1] ="-geometry 1024 × 768 "VNCSERVERARGS [2] ="-geometry 1024 × 768 "VNCSERVERARGS [3] ="-geometry 800 × 600"
This file explains: VNCSERVERS is configured to start several VNC servers at system startup. in the preceding example, three VNC servers are run, where user1 is displayed at display: 1, user2 in display: 2, user3 in display: 3. VNCSERVERARGS is configured with startup parameters for VNC server 1, 2, and 3. in the preceding example, the screen resolution of user1 and user2 is 1024 × 768, use the "man vncserver" command to query other supported parameters of user3. Edit the file, save it, and run the vncserver of user1, user2, and user3 like/sbin/service vncserver start as root. After each system restart, the vncserver of these three users will be automatically started. Note: The above three users must have used the vncpasswd command to set the vnc password, or their vncserver will fail to start!
[Root @ localhost ~] # Service vncserver restartShutting down VNC server: 1: root 2: lisi 3: tom [OK] Starting VNC server: 1: rootNew 'localhost. localdomain: 1 (root) 'desktop is localhost. localdomain: 1 Starting applications specified in/root /. vnc/xstartupLog file is/root /. vnc/localhost. localdomain: 1. log2: lisiNew 'localhost. localdomain: 2 (lisi) 'desktop is localhost. localdomain: 2 Starting applications specified in/home/li Si /. vnc/xstartupLog file is/home/lisi /. vnc/localhost. localdomain: 2. log3: tomNew 'localhost. localdomain: 3 (tom) 'desktop is localhost. localdomain: 3 Starting applications specified in/home/tom /. vnc/xstartupLog file is/home/tom /. vnc/localhost. localdomain: 3.log www.2cto.com [OK] [root @ localhost ~] # Using VNC View to remotely access Linux, there is always no way to switch out the SCIM input method. after a long study, I finally found a solution. 1) modify. in the vnc/xstartup file, add scim-d to the last line, which means to enable SCIM Input Method 2) after you access the Linux system using VNC View, modify the shortcut key of the scim input method, by default, the shortcut key for enabling the input method is ctrl space. the shortcut key for switching the input method to the local machine is abrupt, and the system receives the local command first. Therefore, the default shortcut key cannot be used to open the input method. Change the shortcut key for enabling the SCIM input method to Ctrl Alt Space. Install a vncserver on windows and use vnc4.0.rar. it is best not to use the Enterprise Edition. During installation, you can set a remote verification password. after installation, you can remotely use the vnc viewer in linux. you only need to enter the windows IP address to access the author dnfonbbs.

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.