Use the browser (webdriver)-based selenium technology to crawl data, so the program needs to run in a GUI environment. This article briefly introduces the steps of installing the GUI interface and remote connection in three parts. Installation GUI interface Most cloud server vendors provide images without a GUI interface, so you need to install a graphical environment first. This article uses the GNOME desktop environment: yum -y groups install "GNOME Desktop" This command will install the necessary packages for the GNOME desktop and then configure the X system to use GNOME: echo "exec gnome-session" >> ~/.xinitrc The two commands for installing the KDE or MATE desktop environment are slightly different: # kde yum -y groups install "KDE Plasma Workspaces" echo "exec startkde" >> ~/.xinitrc #mate yum --enablerepo=epel -y groups install "MATE Desktop" echo "exec /usr/bin/mate-session" >> ~/.xinitrc The above has installed the GUI desktop environment. There are two ways to start the desktop environment:
Install vnc-server With a desktop environment, you can generally access the desktop remotely through the web terminal provided by the cloud server manufacturer. When using the web terminal, you need to open the browser every time, then log in to the cloud management background and connect again, which is quite troublesome. We adopt the method of remote connection directly from the desktop client, eliminating the need to open the browser and log in to the cloud management background. There are many remote desktop technologies, such as VNC, TeamViewer, RDP, etc. This article uses the free and widely used VNC. Install the server first on the server (tigervnc is a branch of tightvnc): yum install -y tigervnc-server Then copy a copy of the VNC configuration: cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service Note the “@:1” in the above command parameter. You can Edit the configuration file and replace <USER> with the login username for remote connection (if it is root, be sure to remove "/home" from the second <USER> line). Example configuration as root: # The vncserver service unit file # # Quick HowTo: # 1. Copy this file to /etc/systemd/system/[email protected] # 2. Replace <USER> with the actual user name and edit vncserver # parameters appropriately # (ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i" # PIDFile=/home/<USER>/.vnc/%H%i.pid) # 3. Run `systemctl daemon-reload` # 4. Run `systemctl enable vncserver@:<display>.service` # # DO NOT RUN THIS SERVICE if your local area network is # untrusted! For a secure way of using VNC, you should # limit connections to the local host and then tunnel from # the machine you want to view VNC on (host A) to the machine # whose VNC output you want to view (host B) # # [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB # # this will open a connection on port 590N of your hostA to hostB's port 590M # (in fact, it ssh-connects to hostB and then connects to localhost (on hostB). # See the ssh man page for details on port forwarding) # # You can then point a VNC client on hostA at vncdisplay N of localhost and with # with the help of ssh, you end up seeing what hostB makes available on port 590M # # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP. # # Use "-localhost" to prevent remote VNC clients connecting except when # doing so through a secure tunnel. See the "-via" option in the # `man vncviewer' manual page. [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 Next, set the vnc connection password: Note that the connection password is different from the login password: the connection password is used to display the remote desktop, and the login password is used by users to log in to the system. After setting up, start the vnc service: systemctl daemon-reload systemctl start vncserver@:1 systemctl enable vncserver@:1 If the firewall is enabled, make sure to allow access to the corresponding ports. Client Connection After the server is configured, connect with the client. VNC is a free technology and many clients support the protocol. This article uses the free "Remote Desktop - VNC" software on the App Store for connection. After opening the software interface is as follows: Fill in the server address in the input box: vnc://ip:port, where ip is the server's IP or domain name, and port is the listening port, such as 5901. After entering, press Enter. A password input box will pop up. Enter the password set by vncpasswd. If the password is correct, you can see the server's graphical desktop, for example: Press the Enter key to enter the login interface and enter the login username and password to enter the system: Next you can do various graphics operations. refer to How to install a GUI on top of CentOS 7 The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Using JS to implement a small game of aircraft war
>>: Mysql join query principle knowledge points
This article shares the shell script of mysql5.6....
Introduction The mysql-utilities toolset is a col...
Body part: <button>Turn on/off light</bu...
1. Create a folder to store nginx shell scripts /...
Overview There are many form requirements in the ...
Table of contents 1. Some concepts you need to un...
After the green version of mysql5.6 is decompress...
Use examples to familiarize yourself with the mean...
Today, when I was using VMware to install a new v...
Table of contents Business scenario: Effect demon...
There are many ways to generate a global ID. Here...
As shown below: XML/HTML CodeCopy content to clip...
1: Introduction to syslog.conf For different type...
1. Download mysql-8.0.17-winx64 from the official...
Table of contents 1. What is a window function? 1...