Install and configure vncserver in centos 6.0

Source: Internet
Author: User

1. install necessary software packages

Centos 6.0 is used to minimize installation.

A. Install the vncserver server and client

  1. Yum install tigervnc-server-y

B. Install fontforge

  1. Yum install fontforge-y

If fontforge is not installed, the text will become a square when the vncviewer client is connected.

C. install desktop software

  1. Yum groupinstall desktop-y

To install GNOME desktop, I am used to gnome. You can also use Yum groupinstall "KDE Desktop ".

2. Add a user (if the user already exists, you can skip this step)

I want to add oracle users because I need a desktop to install Oracle software.

  1. Useradd-u 10000 10000l

3. Add vncserver service startup parameters

  1. VI/etc/sysconfig/vncservers
  2. Vncservers = "1: Oracle"
  3. Vncserverargs [1] = "-geometry 1024x768-localhost

The format of the vncservers parameter is:

Vncservers = "number01: user01 number02: user02 ..."

Vncserverargs [number01] = "-Geometry Resolution ..."

Vncserverargs [number01] = "-Geometry Resolution ..."

....

A. Specify the-localhost option to listen to the local IP address. Because the SSH tunnel is used to encrypt data and port forwarding is used, the local IP address can be monitored.

B. If the listening address is not the local machine, you need to enable the corresponding port in iptables. The port number rules are as follows:

Port: Number + 5900.

4. Configure the corresponding user

A. Set the password for the Login User

  1. Su-Oracle
  2. Vncpasswd
  3. Password:
  4. Verify:

Set the client connection password.

B. Add the Host Name

  1. VI/etc/hosts
  2. 192.168.1.11 linuxjcq0

Add your host name and corresponding IP address to the hosts file. Otherwise, the following error will be reported:

  1. Xauth: (stdin): 1: Bad display name "hostname: 1" in "add" command

C. Set the password

  1. Vncpasswd
  2. Password:
  3. Verify

Set the client connection password.

C. Generate the configuration file

  1. Vncserver
  2.  
  3. New 'linuxjcq01: 1 (Oracle) 'desktop is linuxjcq01: 1
  4.  
  5. Creating default startup script/home/Oracle/. VNC/xstartup
  6. Starting applications specified in/home/Oracle/. VNC/xstartup
  7. Log File is/home/Oracle/. VNC/linuxjcq01: 1.log

Run the vncserver command to generate the corresponding configuration file, for example, xstartup.

D. Set the configuration file

  1. Vi. VNC/xstartup
  2. # TWM &
  3. Gnome-session &

Set it to gnome-session desktop. If you have installed the KDE Desktop before, set it to startkde.

E. End setting

  1. Vncserver-kill: 1
  2. Killing xvnc process ID 15883.
  3. # Exit setting user
  4. Exit

Kill the created vncserver and exit the account. If you do not want to configure it as a service, you can also directly start vncserver under the user.

5. Configure and start the service

A. if you want to start the instance, you can set

  1. Chkconfig vncserver on

B. start, stop, and restart

  1. Service vncserver START | stop | restart
  2. Service vncserver start
  3. Starting VNC Server: 1: Oracle
  4. New 'linuxjcq01: 1 (Oracle) 'desktop is linuxjcq01: 1
  5.  
  6. Starting applications specified in/home/Oracle/. VNC/xstartup
  7. Log File is/home/Oracle/. VNC/linuxjcq01: 1.lo

6. Set an SSH Tunnel

A. Set the connection name and the host name or IP address of the server to be connected.

B. Set the connection user name and password (the key is used here)

C. Set port forwarding

Send the data received from Port 5901 of the local machine to the server through an SSH tunnel, and the server forwards the data to port 5901 of the local server.

D. Connect to the session just set

7. Connect using a client

A. Download the client

Go to http://www.realvnc.com/the website to download the vncviewer.exe file. The personal client is free of charge. You can download the file by filling in the information.

B. connection settings

Set the VNC server to: localhost: 5901, which corresponds to the local configuration in port forwarding.

C. Connection

Click Connect to connect.

8. Command description

  1. Vncserver: <number> [-name <desktop-Name>] [-depth <depth>] [-geometry <width> x
  2.  
  3. Vncserver-kill <X-display>
  4. Verserver-list

 

This article is from the "linuxjcq" blog, please be sure to keep this source http://linuxjcq.blog.51cto.com/3042600/748382

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.