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-yAdd 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--level35vncserveronView 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