CentOS7 installation graphical interface method https://blog.csdn.net/weixin_30315435/article/details/98017270

1. Linux installation (root user operation)

1. Install vncserver;

yum install tigervnc-server

2. Install vncviewer;

yum install vnc

3. Set password:

vncpasswd

4. Start vncserver:

vncserver

4. Stop and disable the firewall;

systemctl stop firewalld.service
systemctl disable firewalld.service

5. Install linux graphical desktop

yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

Two, placement

1. Modify the startup file

vim /root/.vnc/xstartup

Fill it with the following:

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1200x800"
gnome-session &

Indicates that the window is based on geome's desktop configuration

2. Create a new configuration file, take opening window 1 as an example (you can also open multiple windows at the same time, just modify the number), the method is as follows:

cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:1.service

Or add another window:

cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:2.service

Edit /lib/systemd/system/vncserver@:1.service, set user root related parameters, and the final content is as follows:

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking

# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target
 

#Start window 1

# To kill the process may exist 
vncserver -kill: 1
# Start
vncserver: 1

#View startup list status

vncserver -list

The result of a successful startup should be as follows:

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/eunke-network002:1.log

View the log to obtain the port number:

cat /root/.vnc/eunke-network002:1.log

If the startup fails, enter the folder, delete the X1 file, and restart window 1:

cd /tmp/.X11-unix 
rm -rf X1 #kill
window 1
vncserver -kill :1 #start
window 1
vncserver :1

Four, Windows install VNC viewer

1. 64bit download address: https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.19.923-Windows-64bit.exe

2. Enter IP: port after installation, as follows:

 

 

 

 

 

 

After pressing Enter, you can open the remote linux desktop (if you see a black window when you open it, just restart the linux server).

 

 

 If the browser displays Chinese garbled characters, refer to the solution:

https://blog.csdn.net/weixin_30315435/article/details/98017270

Finished~~~~

Guess you like

Origin blog.csdn.net/qq_45534098/article/details/112634660