Vncserver installation start and stop

Source: Internet
Author: User
Tags windows download iptables

Installation

RPM-IVH vnc-server-4.1.2-14.el5_6.6.x86_64.rpm

Service Vncserver Restart

CentOS 6.5 can be used vnc-server-4.1.2-14.el5_6.6.x86_64, direct installation, RPM command installation can be, without the tube is not installed, directly can run. However, if you want to run under Oracle, you need to find vncserver, and then you can run it as follows. Then go to Windows download vnc-5.3.0-windows, run the desktop of the VNC Viewer, on it, ip:1, it's OK.

, no more, remember to turn off the firewall.

You can't use kill directly, you need to use Vncserver-kill:1


As a DBA, in the process of creating an Oracle database, you typically use DBCA and NETCA imagery for building and listening (if you use a scripting library to say otherwise), if you are well estimated to be able to complete the database creation process in the shivering room, because I am more sensitive to the cold, And I don't want to exercise in this way, so more willing to taste the aroma of coffee in a comfortable room, passing through relatively boring process of database installation and configuration, so, graphical operation tool is essential, in the Linux operating system, the most popular graphical operation of the software is VNC, I have the spirit of summary, The purpose of sharing and reminding completed this detailed little text son, hope everybody likes.

1. Confirm that VNC is installed
By default, the Red Hat Enterprise Linux Installer installs the VNC service on the system.
Confirm that VNC service is installed and view the installed VNC version
[Root@testdb ~]# rpm-q Vnc-server
Vnc-server-4.1.2-9.el5
[Root@testdb ~]#

If the system is not installed, you can go to the operating system installation disk in the server directory to find VNC service RPM package vnc-server-4.1.2-9.el5.x86_64.rpm, installation commands are as follows
rpm-ivh/mnt/server/vnc-server-4.1.2-9.el5.x86_64.rpm

2. Start VNC service
Use the Vncserver command to start the VNC service, the command format is "Vncserver: Desktop Number", where "desktop number" in the form of "digital" means that each user needs to occupy 1 desktop
An example of a desktop with a startup number of 1 is shown below
[Root@testdb ~]# vncserver:1

You'll require a password to access your desktops.

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

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

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

During the execution of the above command, because it is the first execution, a password is required to be encrypted and stored in the. VNC subdirectory (/ROOT/.VNC/PASSWD) in the user's home directory, and the Xstartup configuration file is automatically established for users in the. VNC subdirectory under the user's home directory ( /root/.vnc/xstartup), the configuration information in the file is read every time the VND service is started.
The btw:/root/.vnc/directory also has a "testdb:1.pid" file that records the process number that corresponds to the acquired operating system after the start of VNC, and the exact location of the process number when the VNC service is stopped.

The relationship between the port number used by the 3.VNC service and the desktop number
The port number used by the VNC service is related to the desktop number, and VNC uses the TCP port starting at 5900, which corresponds to the following
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 Java-based VNC client Web Services TCP port starts at 5800 and is also related to the desktop number, which corresponds to the following
Desktop number is "1"----port number is 5801
Desktop number is "2"----port number is 5802
Desktop number is "3"----port number is 5803
......
Based on the above introduction, if the Linux firewall features, you need to manually open the appropriate port, to open the desktop number of "1" the corresponding port for example, the following command
[Root@testdb ~]# iptables-i input-p tcp--dport 5901-j ACCEPT
[Root@testdb ~]# iptables-i input-p tcp--dport 5801-j ACCEPT

4. Test VNC Service
The first approach is to use the VNC Viewer software to log on to the test, the following procedure
Start the VNC viewer software--> Server input "144.194.192.183:1"--> click "OK"--> password Enter login password--> Click "OK" landing to X-window graphics desktop environment--& Gt Test successful
The second approach is to use a Web browser (such as Firefox,ie,safari) to log in to the test, the following procedure
Address bar input http://144.194.192.183:5801/--> The VNC viewer for Java (This tool is a VNC client program written in Java) interface, and also out of the Vnc Viewer dialog box, enter the server "144.194.192.183:1" click "OK"--> password Enter login password--> Click "OK" landing to X-window graphics desktop environment--> test success
(Note: VNC Viewer for Java requires JRE support, and if the page cannot be displayed, it means that the JRE is not installed, and you can download the latest JRE to the http://java.sun.com/javase/downloads/index_jdk5.jsp for installation)

5. Configure VNC Graphics desktop environment for KDE or GNOME desktop environment
If you are configured according to my previous method, landing on the desktop is very simple, only a shell to use, this is why. How do you see the lovely and beautiful KDE or GNOME desktop environment? Answer as follows
The reason it's so ugly is because VNC services use the TWM Graphics desktop environment by default, which can be modified in VNC's profile xstartup to look at the configuration file first
[Root@testdb ~]# vi/root/.vnc/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" &
TWM &

Modify the last line of the Xstartup file to "Startkde &" and then restart the Vncserver service to log on to the KDE desktop environment
Modify the last line of this xstartup file to "Gnome-session &"And then you can log on to the GNOME desktop environment after restarting the Vncserver service

How to restart the Vncserver service:
[Root@testdb ~]# Vncserver-kill:1
[Root@testdb ~]# Vncserver:1

6. Configure multiple Desktops
You can start VNC on multiple desktops using the following methods
Vncserver:1
Vncserver:2
Vncserver:3
......
However, this manual-initiated approach will fail after the server restarts, so here's how to automate the system to manage multiple desktop VNC by adding information that needs to be managed automatically to the/etc/sysconfig/vncservers configuration file. Use desktop 1 for root Desktop 2 as an example for Oracle users as follows:
Format: vncservers= "desktop number: User name Desktop Number: Use username"
[Root@testdb ~]# vi/etc/sysconfig/vncservers
vncservers= "1:root 2:oracle"
vncserverargs[1]= "-geometry 1024x768"
vncserverargs[2]= "-geometry 1024x768"

7. Modify the password for VNC access
Using the command vncpasswd to change the password of VNC for different users, it is important to note that VNC with different users needs to be modified separately from the respective users, for example, in my experiment, root and Oracle users need to be modified separately, and the modification process is as follows:
[Root@testdb ~]# vncpasswd
Password:
Verify:
[Root@testdb ~]#

8. Start and stop VNC service
1 Start VNC service Command
[Root@testdb ~]#/etc/init.d/vncserver start
Starting VNC Server:1:root
New ' testdb:1 (root) ' Desktop is testdb:1

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

2:oracle
New ' Testdb:2 (Oracle) ' Desktop is Testdb:2

Starting applications specified In/home/oracle/.vnc/xstartup
Log file Is/home/oracle/.vnc/testdb:2.log

[OK]
2) Stop VNC Service command
[root@testdb ~]#/etc/init.d/vncserver Stop
Shutting down VNC server:1:root 2:oracle [OK]

3 Restart VNC Service command
[root@testdb ~]#/etc/init.d/vncserver Restart
Shutting down VNC server:1:root 2:oracle [OK]
Starting VNC Server:1:root
New ' testdb:1 (root) ' Desktop is testdb:1

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

2:oracle
New ' Testdb:2 (Oracle) ' Desktop is Testdb:2

Starting applications specified In/home/oracle/.vnc/xstartup
Log file Is/home/oracle/.vnc/testdb:2.log

[OK]

4) Set up VNC service to load automatically with system startup
The first method: Use the "NTSYSV" command to start the graphical service configuration program, add an asterisk before the Vncserver service, click OK, configuration complete.
The second approach is to use "chkconfig" to operate in command-line mode, using the following commands (for predictive chkconfig detailed usage please help yourself man)
[root@testdb ~]# chkconfig vncserver on
[Root@testdb ~]# chkconfig--list vncserver
Vncserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off

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.