1. install necessary software packages
Centos 6.0 is used to minimize installation.
A. Install the vncserver server and client
- Yum install tigervnc-server-y
B. Install fontforge
- 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
- 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.
- Useradd-u 10000 10000l
3. Add vncserver service startup parameters
- VI/etc/sysconfig/vncservers
- Vncservers = "1: Oracle"
- 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
- Su-Oracle
- Vncpasswd
- Password:
- Verify:
Set the client connection password.
B. Add the Host Name
- VI/etc/hosts
- 192.168.1.11 linuxjcq0
Add your host name and corresponding IP address to the hosts file. Otherwise, the following error will be reported:
- Xauth: (stdin): 1: Bad display name "hostname: 1" in "add" command
C. Set the password
- Vncpasswd
- Password:
- Verify
Set the client connection password.
C. Generate the configuration file
- Vncserver
-
- New 'linuxjcq01: 1 (Oracle) 'desktop is linuxjcq01: 1
-
- Creating default startup script/home/Oracle/. VNC/xstartup
- Starting applications specified in/home/Oracle/. VNC/xstartup
- 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
- Vi. VNC/xstartup
- # TWM &
- Gnome-session &
Set it to gnome-session desktop. If you have installed the KDE Desktop before, set it to startkde.
E. End setting
- Vncserver-kill: 1
- Killing xvnc process ID 15883.
- # Exit setting user
- 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
- Chkconfig vncserver on
B. start, stop, and restart
- Service vncserver START | stop | restart
- Service vncserver start
- Starting VNC Server: 1: Oracle
- New 'linuxjcq01: 1 (Oracle) 'desktop is linuxjcq01: 1
-
- Starting applications specified in/home/Oracle/. VNC/xstartup
- 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
- Vncserver: <number> [-name <desktop-Name>] [-depth <depth>] [-geometry <width> x
-
- Vncserver-kill <X-display>
- Verserver-list
This article is from the "linuxjcq" blog, please be sure to keep this source http://linuxjcq.blog.51cto.com/3042600/748382