The restart of VNCServer in CentOS still takes effect.

Source: Internet
Author: User

The restart of VNCServer in CentOS still takes effect.

Prerequisites: The gnome desktop has been installed. If not, run the following command to install it.

yumgroupinstall "Desktop" "XWindowSystem" -y

Install the VNC Server

yuminstalltigervnc-server-y

Add three accounts test1 test2 test3 for VNC access testing.

Switch to these accounts and run the vncpasswd command to generate the VNC access password. Here, we set the password to 11111, 222222, and 333333.

Run vncserver once under the root account:

Vi. vnc/xstartup.

UnsetSESSION_MANAGER # If commented out, cancel the comment for this row.UnsetDBUS_SESSION_BUS_ADDRESS # uncomment this row if it is commented out.Gnome-session & # change the last line to gnome-session &

Copy related configuration files:

cp.vnc/xstartup/home/test1/.vnc/cp.vnc/xstartup/home/test2/.vnc/cp.vnc/xstartup/home/test3/.vnc/

Change vi/etc/sysconfig/vncservers to the following:

VNCSERVERS="1:test12:test23:test3"VNCSERVERARGS[1]="-geometry800x600"VNCSERVERARGS[2]="-geometry1024x768"VNCSERVERARGS[3]="-geometry800x600"

Start the vncserver service

Service vncserver start

Use VNC Viewer to connect to the VNC Server:

Connect 192.168.2.10: 1,192.168.2.10: 2,192.168.2.10: 3 and enter the password 11111 22222 generated in the preceding step.

The result is shown in:

Supplement:

Set vncserver startup

chkconfig--level35vncserveron

View which VNC processes are started and their corresponding desktop numbers

ps-ef|grepXvnc


To end a vncserver connection, follow these steps:

Usage: vncserver-kill: Desktop numberFor example:vncserver-kill:1vncserver-kill:2

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.