Centos7 tigervnc installation experience
1. If tigervnc is installed for the first time, skip the precautions;
2, if you have installed before, pay attention to the points: view the/tmp/. X11-unix directory, delete the X [1-9] File, note that X0 can not be deleted;
Installation steps:
1,Yum install tigervnc-server;
2. Create a userUseradd 000; if an existing user is used, check whether the. vnc directory exists in/home of the user. If yes, delete it;
3,Cp/lib/systemd/system/vncserver @. service/etc/systemd/system/vncserver @: 1. service. Note that this 1 parameter may not be set here and needs to be determined by the subsequent steps;
4,Vi/etc/systemd/system/vncserver @: 1. service,Edit the content in vncserver @: 1. service:
[...][Service]Type=forking# Clean any existing files in /tmp/.X11-unix environmentExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'#ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"#PIDFile=/home/<USER>/.vnc/%H%i.pidExecStart=/sbin/runuser -l 000 -c "/usr/bin/vncserver %i"PIDFile=/home/000/.vnc/%H%i.pidExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
You can leave it unchanged elsewhere;
5. add firewall rules
Firewall-cmd -- permanent -- zone = public -- add-service vnc-server
Firewall-cmd -- reload
If the system prompts that firewalld is not started, run firewalld to start the firewall and then run the preceding two commands;
6. Switch to 000 users
Su-000
Vncserver
[Srijan @ server1 ~] $ Vncserver
You will require a password to access your tops.
Password:<-- Yourvncpassword
Verify:<-- Yourvncpassword
Xauth: file/home/srijan/. Xauthority does not exist
New 'server1 .example.com: 1 (srijan) 'desktop is server1.example.com: 1
Creating default startup script/home/kishore/. vnc/xstartup
Starting applications specified in/home/kishore/. vnc/xstartup
Log file is/home/srijan/. vnc/server1.example.com: 1.log
Pay attention to this "1" here. If the result is not 1Vncserver @: 1. The service is changed to the corresponding value. The reason is unknown;
7. Set startup
Systemctl daemon-reload
Systemctl enable vncserver @: 1. service
Systemctl start vncserver @: 1. service
If Error Code 98 appearsVncserver @:1Change forking in. service to simple;